Check-in [d8ce3045d5]
Overview
Comment:Less heavy handed rewriting of error codes in Tcl BIO
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8ce3045d5d88ceb13aca8ab8c02d55d9d62c687
User & Date: rkeene on 2016-12-13 18:49:46
Other Links: manifest | tags
Context
2016-12-13
19:22
Updated to latest remote tcl.m4 check-in: 271aa29c27 user: rkeene tags: trunk
18:54
Merged in trunk check-in: f7d1440f12 user: rkeene tags: tls-1-7
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
Changes
Modified tlsBIO.c from [e6c5524fec] to [561dcc523d].
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

155
156
157
158
159
160
161
137
138
139
140
141
142
143

144
145


146
147
148
149
150

151
152
153
154
155
156
157
158







-


-
-





-
+







		dprintf("Setting retry read flag");
		BIO_set_retry_read(bio);
	} else if (ret < 0) {
		dprintf("We got some kind of I/O error");

		if (tclErrno == EAGAIN) {
			dprintf("It's EAGAIN");
			ret = 0;
		} else {
			dprintf("It's an unepxected error: %s/%i", Tcl_ErrnoMsg(tclErrno), tclErrno);
			Tcl_SetErrno(ECONNRESET);
			ret = -1;
		}
	} else {
		dprintf("Successfully wrote some data");
	}

	if (ret != -1) {
	if (ret != -1 || (ret == -1 && tclErrno == EAGAIN)) {
		if (BIO_should_read(bio)) {
			dprintf("Setting should retry read flag");

			BIO_set_retry_read(bio);
		}
	}

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

211
212
213
214
215
216
217
190
191
192
193
194
195
196

197
198


199
200
201
202
203

204
205
206
207
208
209
210
211







-


-
-





-
+







		dprintf("Setting retry read flag");
		BIO_set_retry_read(bio);
	} else if (ret < 0) {
		dprintf("We got some kind of I/O error");

		if (tclErrno == EAGAIN) {
			dprintf("It's EAGAIN");
			ret = 0;
		} else {
			dprintf("It's an unepxected error: %s/%i", Tcl_ErrnoMsg(tclErrno), tclErrno);
			Tcl_SetErrno(ECONNRESET);
			ret = -1;
		}
	} else {
		dprintf("Successfully read some data");
	}

	if (ret != -1) {
	if (ret != -1 || (ret == -1 && tclErrno == EAGAIN)) {
		if (BIO_should_write(bio)) {
			dprintf("Setting should retry write flag");

			BIO_set_retry_write(bio);
		}
	}