[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] remove a conn_close_if_marked warning



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection.c 
Log Message:
remove a conn_close_if_marked warning

Nov 27 15:45:19.003 [warn] connection_write_to_buf(): write_to_buf failed. Closing connection (fd 42).
Nov 27 15:45:19.010 [warn] conn_close_if_marked(): Conn (socket 42) still wants to flush. Losing 0 bytes!


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- connection.c	29 Nov 2003 02:50:12 -0000	1.133
+++ connection.c	30 Nov 2003 09:35:26 -0000	1.134
@@ -494,19 +494,15 @@
   if(!len || conn->marked_for_close)
     return;
 
-  if( (!connection_speaks_cells(conn)) ||
-      (!connection_state_is_open(conn)) ||
-      (options.LinkPadding == 0) ) {
-    /* connection types other than or, or or not in 'open' state, should flush immediately */
-    /* also flush immediately if we're not doing LinkPadding, since otherwise it will never flush */
-    connection_start_writing(conn);
-    conn->outbuf_flushlen += len;
-  }
-
   if(write_to_buf(string, len, conn->outbuf) < 0) {
     log_fn(LOG_WARN,"write_to_buf failed. Closing connection (fd %d).", conn->s);
     conn->marked_for_close = 1;
+    return;
   }
+
+  /* XXX if linkpadding, this only applies to conns that aren't open OR connections */
+  connection_start_writing(conn);
+  conn->outbuf_flushlen += len;
 }
 
 connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port) {