When executing this code: errno = 0; r = SSL_read(ssl,leftbuf,sizeof leftbuf); ssl_errno = SSL_get_error(ssl,r); sprintf(buf, "[1] SSL_read=%d errno=%d ssl_errno=%d leftstatus=%d rightstatus=%d", r, errno, ssl_errno, leftstatus, rightstatus); write(666, buf, strlen(buf));
strace shows:
10013 17:57:26.571066 poll([{fd=4, events=POLLIN, revents=POLLIN}, {fd=6,
events=POLLIN}], 2, 600020) = 1 <0.106151>
10013 17:57:26.677324 read(4, "\27\3\1\20 ", 5) = 5 <0.000021>
10013 17:57:26.677408 read(4, "\232\300..., 4128) = 1415 <0.000018>
1001r 17:57:26.677845 read(4, 0x68849bf, 2713) = -1 EAGAIN (Resource
temporarily unavailable) <0.000015>
10013 17:57:26.677923 write(666, "[1] SSL_read=-1 errno=11 ssl_errno=1
leftstatus=0 rightstatus=0", 63) = -1 EBADF (Bad file descriptor) <0.000013>
SSL_ERROR_SSL is 1,
SSL_ERROR_SYSCALL is 5.
http://www.openssl.org/docs/ssl/SSL_get_error.html
SSL_ERROR_SSL "A failure in the SSL library occurred, usually a protocol error.
The
OpenSSL error queue contains more information on the error."
In my opinion, EINTR return from read() is not "protocol error"
or somehow related to "SSL library".
SSL_get_error should report SSL_ERROR_SYSCALL in this case.
I have x86_64 arch, openssl version says "OpenSSL 0.9.9-dev XX xxx XXXX".
(Latest CVS.)
--
Do what you love because life is too short for anything else.
pgpyj1fwAKCfz.pgp
Description: PGP signature
