Check-in [ad1752cdaf]
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 on 2016-12-13 18:49:19
Other Links: manifest | tags
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

Modified tlsIO.c from [0aa31db5a9] to [f8a8e7a642].

463
464
465
466
467
468
469





470
471
472
473
474
475
476
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481







+
+
+
+
+








			break;
		case SSL_ERROR_ZERO_RETURN:
			dprintf("Got SSL_ERROR_ZERO_RETURN, this means an EOF has been reached");
			bytesRead = 0;
			*errorCodePtr = 0;
			break;
		case SSL_ERROR_WANT_READ:
			dprintf("Got SSL_ERROR_WANT_READ, mapping this to EAGAIN");
			bytesRead = -1;
			*errorCodePtr = EAGAIN;
			break;
		default:
			dprintf("Unknown error (err = %i), mapping to EOF", err);
			*errorCodePtr = 0;
			bytesRead = 0;
			break;
	}

566
567
568
569
570
571
572
573



574
575
576
577
578
579
580
571
572
573
574
575
576
577

578
579
580
581
582
583
584
585
586
587







-
+
+
+







	switch (err) {
		case SSL_ERROR_NONE:
			if (written < 0) {
				written = 0;
			}
			break;
		case SSL_ERROR_WANT_WRITE:
			dprintf(" write W BLOCK");
			dprintf("Got SSL_ERROR_WANT_WRITE, mapping it to EAGAIN");
			*errorCodePtr = EAGAIN;
			written = -1;
			break;
		case SSL_ERROR_WANT_READ:
			dprintf(" write R BLOCK");
			break;
		case SSL_ERROR_WANT_X509_LOOKUP:
			dprintf(" write X BLOCK");
			break;