]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
last minute fix: don't early-flush non-tls streams tor-0.0.2pre20
authorRoger Dingledine <arma@torproject.org>
Sat, 31 Jan 2004 00:36:00 +0000 (00:36 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 31 Jan 2004 00:36:00 +0000 (00:36 +0000)
e.g., this breaks directory service

svn:r1033

src/or/connection.c
src/or/directory.c

index e2993fab351386d306906b33cc17d3af76173e5a..211152a68519b515c732218aff95428927db7c16 100644 (file)
@@ -530,8 +530,8 @@ void connection_write_to_buf(const char *string, int len, connection_t *conn) {
  * push data out as soon as we know there's enough for a tls record, so
  * during periods of high load we won't read the entire megabyte from
  * input before pushing any data out. */
-/* We follow the same algorithm for non-tls streams, because hey, why not. */
-  if(conn->outbuf_flushlen < MIN_TLS_FLUSHLEN &&
+  if(connection_speaks_cells(conn) &&
+     conn->outbuf_flushlen < MIN_TLS_FLUSHLEN &&
      conn->outbuf_flushlen+len >= MIN_TLS_FLUSHLEN) {
     len -= (MIN_TLS_FLUSHLEN - conn->outbuf_flushlen);
     conn->outbuf_flushlen = MIN_TLS_FLUSHLEN;
index 6ea453a9838ce3f0839351c58ac011e4db41327d..2598520bd06c383111a8790d01d920720d6a4963 100644 (file)
@@ -261,7 +261,7 @@ int connection_dir_finished_flushing(connection_t *conn) {
       log_fn(LOG_INFO,"Finished writing server response. Closing.");
       return -1; /* kill it */
     default:
-      log_fn(LOG_WARN,"BUG: called in unexpected state.");
+      log_fn(LOG_WARN,"BUG: called in unexpected state %d.", conn->state);
       return -1;
   }
   return 0;