diff options
author | Roger Dingledine <arma@torproject.org> | 2003-11-30 09:35:26 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-11-30 09:35:26 +0000 |
commit | 3818776f62aa8f711dcf57a329c889178de5543e (patch) | |
tree | cf4560d39e45def469f71ac03a0da6ebdb5a3f56 /src | |
parent | 00de055f4313e88a1fc7a00a3c746c123b572861 (diff) | |
download | tor-3818776f62aa8f711dcf57a329c889178de5543e.tar tor-3818776f62aa8f711dcf57a329c889178de5543e.tar.gz |
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!
svn:r866
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 88d6fde15..624a387a1 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -494,19 +494,15 @@ void connection_write_to_buf(const char *string, int len, connection_t *conn) { 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) { |