Check-in [ad1752cdaf]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Mapped OpenSSL errors for read/write wants to EAGAIN
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ad1752cdaf451d869abbdcc76d59260dc2f11f59
User & Date: rkeene 2016-12-13 18:49:19
Context
2016-12-13
18:49
Less heavy handed rewriting of error codes in Tcl BIO check-in: d8ce3045d5 user: rkeene tags: trunk
18:49
Mapped OpenSSL errors for read/write wants to EAGAIN check-in: ad1752cdaf user: rkeene tags: trunk
18:42
Fixed help string for ssl-fastpath to correctly indicate that it is disabled by default check-in: 80d0949714 user: rkeene tags: trunk
Changes

Changes to tlsIO.c.

   463    463   
   464    464   			break;
   465    465   		case SSL_ERROR_ZERO_RETURN:
   466    466   			dprintf("Got SSL_ERROR_ZERO_RETURN, this means an EOF has been reached");
   467    467   			bytesRead = 0;
   468    468   			*errorCodePtr = 0;
   469    469   			break;
          470  +		case SSL_ERROR_WANT_READ:
          471  +			dprintf("Got SSL_ERROR_WANT_READ, mapping this to EAGAIN");
          472  +			bytesRead = -1;
          473  +			*errorCodePtr = EAGAIN;
          474  +			break;
   470    475   		default:
   471    476   			dprintf("Unknown error (err = %i), mapping to EOF", err);
   472    477   			*errorCodePtr = 0;
   473    478   			bytesRead = 0;
   474    479   			break;
   475    480   	}
   476    481   
................................................................................
   566    571   	switch (err) {
   567    572   		case SSL_ERROR_NONE:
   568    573   			if (written < 0) {
   569    574   				written = 0;
   570    575   			}
   571    576   			break;
   572    577   		case SSL_ERROR_WANT_WRITE:
   573         -			dprintf(" write W BLOCK");
          578  +			dprintf("Got SSL_ERROR_WANT_WRITE, mapping it to EAGAIN");
          579  +			*errorCodePtr = EAGAIN;
          580  +			written = -1;
   574    581   			break;
   575    582   		case SSL_ERROR_WANT_READ:
   576    583   			dprintf(" write R BLOCK");
   577    584   			break;
   578    585   		case SSL_ERROR_WANT_X509_LOOKUP:
   579    586   			dprintf(" write X BLOCK");
   580    587   			break;