Re: Problems with SSL_shutdown() and non blocking socket

2010-03-23 Thread Claus Assmann
On Tue, Mar 23, 2010, Dr. Stephen Henson wrote: > Another possible cause is multiple closes on the same file descriptor in a > multi threaded application. I saw this once myself where the SSL_free() closed > the file descriptor and the application itself closed it as well. The application is send

Re: Problems with SSL_shutdown() and non blocking socket

2010-03-23 Thread Victor Duchovni
On Mon, Mar 22, 2010 at 04:23:53PM -0700, Claus Assmann wrote: > It should probably be > > ssl_errno = SSL_get_error(ssl, rc); > > but even then I get SSL_ERROR_SYSCALL and errno=EBADF using sendmail > 8, while previously it didn't complain about errors. For what it's worth, Postfix calls

Re: Problems with SSL_shutdown() and non blocking socket

2010-03-23 Thread Dr. Stephen Henson
On Tue, Mar 23, 2010, Darryl Miles wrote: > Claus Assmann wrote: >> It should probably be >> ssl_errno = SSL_get_error(ssl, rc); > > Ah yes you could be correct on that, please consult the SSL_get_error() > documentation for correct usage. > > >> but even then I get SSL_ERROR_SYSCALL and err

Re: Problems with SSL_shutdown() and non blocking socket

2010-03-23 Thread Darryl Miles
Claus Assmann wrote: It should probably be ssl_errno = SSL_get_error(ssl, rc); Ah yes you could be correct on that, please consult the SSL_get_error() documentation for correct usage. but even then I get SSL_ERROR_SYSCALL and errno=EBADF using sendmail 8, while previously it didn'

Re: Problems with SSL_shutdown() and non blocking socket

2010-03-22 Thread Claus Assmann
On Fri, Mar 12, 2010, Darryl Miles wrote: > int rc = SSL_shutdown(ssl); > /* BEGIN - INSERT THIS CODE AFTER EVERY SSL_shutdown() > INVOCATION IN YOUR CODE */ > if(rc == -1) { > int ssl_errno; > SSL_get_error(ssl, ssl_errno); > if(ssl_errno == SSL_ERROR_WANT_READ || ssl_er

Re: Problems with SSL_shutdown() and non blocking socket

2010-03-12 Thread Darryl Miles
Victor Stinner wrote: I'm trying to fix a bug in Python which is specific to OpenSSL 0.9.8m. The problem is in a FTP test using a blocking socket (client) and a non blocking socket (server). There are different tests, some tests use a timeout of 2 seconds on the client socket. Pseudo-code of

Problems with SSL_shutdown() and non blocking socket

2010-03-11 Thread Victor Stinner
Hi, I'm trying to fix a bug in Python which is specific to OpenSSL 0.9.8m. The problem is in a FTP test using a blocking socket (client) and a non blocking socket (server). There are different tests, some tests use a timeout of 2 seconds on the client socket. Pseudo-code of Python shutdown low