Commit d02ffcd15482a7feaed11d9109ae578eda3734dd
Fixed bug in sslh-select: if socket dropped while defered_data was present, sslh-select would crash.
Yves Rutschle committed on 7/19/2013, 10:45:33 PMParent: f842e2e081c25dfa73c48f8359b388e2530c9f8a
Files changed
ChangeLog | changed |
sslh-select.c | changed |
ChangeLog | ||
---|---|---|
@@ -1,4 +1,8 @@ | ||
1 | +vNEXT: | |
2 | + Fixed bug in sslh-select: if socket dropped while | |
3 | + defered_data was present, sslh-select would crash. | |
4 | + | |
1 | 5 | v1.14: 21DEC2012 |
2 | 6 | Corrected OpenVPN probe to support pre-shared secret |
3 | 7 | mode (OpenVPN port-sharing code is... wrong). Thanks |
4 | 8 | to Kai Ellinger for help in investigating and |
sslh-select.c | ||
---|---|---|
@@ -260,15 +260,16 @@ | ||
260 | 260 | if (cnx[i].state == ST_PROBING) num_probing--; |
261 | 261 | tidy_connection(&cnx[i], &fds_r, &fds_w); |
262 | 262 | if (verbose) |
263 | 263 | fprintf(stderr, "closed slot %d\n", i); |
264 | + } else { | |
265 | + /* If no defered data is left, stop monitoring the fd | |
266 | + * for write, and restart monitoring the other one for reads*/ | |
267 | + if (!cnx[i].q[j].defered_data_size) { | |
268 | + FD_CLR(cnx[i].q[j].fd, &fds_w); | |
269 | + FD_SET(cnx[i].q[1-j].fd, &fds_r); | |
270 | + } | |
264 | 271 | } |
265 | - /* If no defered data is left, stop monitoring the fd | |
266 | - * for write, and restart monitoring the other one for reads*/ | |
267 | - if (!cnx[i].q[j].defered_data_size) { | |
268 | - FD_CLR(cnx[i].q[j].fd, &fds_w); | |
269 | - FD_SET(cnx[i].q[1-j].fd, &fds_r); | |
270 | - } | |
271 | 272 | } |
272 | 273 | } |
273 | 274 | } |
274 | 275 | } |
Built with git-ssb-web