Check-in [24ce678ecd]

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

Overview
Comment:Updated EOF while reading from the BIO to map to soft EOF
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:24ce678ecdb2307bda85c7aba9a9fe2d07a0b89e
User & Date: rkeene 2016-12-14 14:40:45
Context
2016-12-14
14:45
Made trunk builds identify as TclTLS 1.8.0 check-in: f625a3272a user: rkeene tags: trunk
14:42
Merged in trunk check-in: a87c836d6c user: rkeene tags: tls-1-7
14:40
Updated EOF while reading from the BIO to map to soft EOF check-in: 24ce678ecd user: rkeene tags: trunk
01:10
Minor update to the README check-in: c920627e0b user: rkeene tags: trunk
Changes

Changes to tlsBIO.c.

   125    125   	tclErrno = Tcl_GetErrno();
   126    126   
   127    127   	dprintf("[chan=%p] BioWrite(%d) -> %d [tclEof=%d; tclErrno=%d]", (void *) chan, bufLen, ret, tclEofChan, Tcl_GetErrno());
   128    128   
   129    129   	BIO_clear_flags(bio, BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY);
   130    130   
   131    131   	if (tclEofChan && ret <= 0) {
   132         -		dprintf("Got %i from Tcl_WriteRaw, and EOF is set; ret = -1", ret);
          132  +		dprintf("Got EOF while reading, returning a Connection Reset error which maps to Soft EOF");
   133    133   		Tcl_SetErrno(ECONNRESET);
   134         -		ret = -1;
          134  +		ret = 0;
   135    135   	} else if (ret == 0) {
   136    136   		dprintf("Got 0 from Tcl_WriteRaw, and EOF is not set; ret = 0");
   137    137   		dprintf("Setting retry read flag");
   138    138   		BIO_set_retry_read(bio);
   139    139   	} else if (ret < 0) {
   140    140   		dprintf("We got some kind of I/O error");
   141    141   
................................................................................
   178    178   	tclErrno = Tcl_GetErrno();
   179    179   
   180    180   	dprintf("[chan=%p] BioRead(%d) -> %d [tclEof=%d; tclErrno=%d]", (void *) chan, bufLen, ret, tclEofChan, tclErrno);
   181    181   
   182    182   	BIO_clear_flags(bio, BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY);
   183    183   
   184    184   	if (tclEofChan && ret <= 0) {
   185         -		dprintf("Got %i from Tcl_Read or Tcl_ReadRaw, and EOF is set; ret = -1", ret);
          185  +		dprintf("Got EOF while reading, returning a Connection Reset error which maps to Soft EOF");
   186    186   		Tcl_SetErrno(ECONNRESET);
   187         -		ret = -1;
          187  +		ret = 0;
   188    188   	} else if (ret == 0) {
   189    189   		dprintf("Got 0 from Tcl_Read or Tcl_ReadRaw, and EOF is not set; ret = 0");
   190    190   		dprintf("Setting retry read flag");
   191    191   		BIO_set_retry_read(bio);
   192    192   	} else if (ret < 0) {
   193    193   		dprintf("We got some kind of I/O error");
   194    194