[or-cvs] r13643: If we're trying to flush the last bytes on a connection (for (in tor/trunk: . src/or)
arma at seul.org
arma at seul.org
Thu Feb 21 05:51:10 UTC 2008
Author: arma
Date: 2008-02-21 00:51:09 -0500 (Thu, 21 Feb 2008)
New Revision: 13643
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/main.c
Log:
If we're trying to flush the last bytes on a connection (for
example, when answering a directory request), reset the
time-to-give-up timeout every time we manage to write something
on the socket. Bugfix on 0.1.2.x.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2008-02-21 05:42:12 UTC (rev 13642)
+++ tor/trunk/ChangeLog 2008-02-21 05:51:09 UTC (rev 13643)
@@ -61,6 +61,10 @@
cached from other authorities. Bugfix on 0.2.0.x. Fixes bug 606.
- Recover from bad tracked-since value in MTBF-history file.
Should fix bug 537.
+ - If we're trying to flush the last bytes on a connection (for
+ example, when answering a directory request), reset the
+ time-to-give-up timeout every time we manage to write something
+ on the socket. Bugfix on 0.1.2.x.
o Code simplifications and refactoring:
- Remove the tor_strpartition function: its logic was confused,
Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c 2008-02-21 05:42:12 UTC (rev 13642)
+++ tor/trunk/src/or/main.c 2008-02-21 05:51:09 UTC (rev 13643)
@@ -573,11 +573,12 @@
if (retval >= 0 && /* Technically, we could survive things like
TLS_WANT_WRITE here. But don't bother for now. */
conn->hold_open_until_flushed && connection_wants_to_flush(conn)) {
- if (retval > 0)
+ if (retval > 0) {
LOG_FN_CONN(conn, (LOG_INFO,LD_NET,
"Holding conn (fd %d) open for more flushing.",
conn->s));
- /* XXX020rc should we reset timestamp_lastwritten here? */
+ conn->timestamp_lastwritten = now; /* reset so we can flush more */
+ }
return 0;
}
if (connection_wants_to_flush(conn)) {
More information about the tor-commits
mailing list