From: Stephen D. <sd...@gm...> - 2012-12-06 12:04:33
|
On Tue, Dec 4, 2012 at 10:24 PM, Gustaf Neumann <ne...@wu...> wrote: > > Today, i was hunting another problem in connection with nsssl, which > turns out to be a weakness of our interfaces. The source for the problem > is that the buffer management of OpenSSL is not aligned with the buffer > management in naviserver. In the naviserver driver, all receive requests > are triggered via the poll, when sockets are readable. With OpenSSL it > might be as well possible that data as a leftover from an earlier > receive when a smaller buffer is provided. Naviserver requested during > upload spool reveive operations with a 4KB buffer. OpenSSL might receive > "at once" 16KB. The read operation with the small buffer will not drain > the OpenSSL buffer, and later, poll() will not be triggered by the fact, > that the socket is readable (since the buffer is still quite full). The > problem happened in NaviServer, when the input was spooled (e.g. file > uploads). I have doubts that this combination ever worked. I have > corrected the problem by increasing the buffer variable in the driver.c. > The cleaner implementation would be to add an "Ns_DriverReadableProc > Readable" similar to the "Ns_DriverKeepProc Keep", but that would > effect the interface of all drivers. Another way to use the openssl library is to manage socket read/writes yourself and hand memory buffers to openssl to encrypt/decrypt. |