fix the other half of the pipe race

svn:r3111
This commit is contained in:
Roger Dingledine 2004-12-07 16:37:32 +00:00
parent bd5524bfc7
commit 012255fe60
2 changed files with 4 additions and 2 deletions

View File

@ -236,6 +236,8 @@ void connection_about_to_close_connection(connection_t *conn)
if (conn->socks_request->has_finished == 0) { if (conn->socks_request->has_finished == 0) {
log_fn(LOG_INFO,"Cleaning up AP -- sending socks reject."); log_fn(LOG_INFO,"Cleaning up AP -- sending socks reject.");
conn->hold_open_until_flushed = 1; conn->hold_open_until_flushed = 1;
/* XXX this socks_reply never gets sent, since conn
* gets removed right after this function finishes. */
connection_ap_handshake_socks_reply(conn, NULL, 0, -1); connection_ap_handshake_socks_reply(conn, NULL, 0, -1);
conn->socks_request->has_finished = 1; conn->socks_request->has_finished = 1;
} else { } else {

View File

@ -45,9 +45,9 @@ int connection_edge_reached_eof(connection_t *conn) {
/* only mark it if not already marked. it's possible to /* only mark it if not already marked. it's possible to
* get the 'end' right around when the client hangs up on us. */ * get the 'end' right around when the client hangs up on us. */
connection_mark_for_close(conn); connection_mark_for_close(conn);
conn->hold_open_until_flushed = 1; /* just because we shouldn't read
doesn't mean we shouldn't write */
} }
conn->hold_open_until_flushed = 1; /* just because we shouldn't read
doesn't mean we shouldn't write */
return 0; return 0;
#endif #endif
} }