diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-13 13:08:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-13 13:08:46 -0400 |
commit | a0c1c2ac012fded493c0d8c49fe57e56373b061f (patch) | |
tree | b39fcdda6348700e02ce17c18b3221c0b1f64fcd /src/or/connection.h | |
parent | 5710d99f00b3ac7cef0691fc9153993b0f4aa872 (diff) | |
download | tor-a0c1c2ac012fded493c0d8c49fe57e56373b061f.tar.gz tor-a0c1c2ac012fded493c0d8c49fe57e56373b061f.zip |
Use connection_mark_and_flush consistently.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r-- | src/or/connection.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/connection.h b/src/or/connection.h index 004ede5d04..dc8c5df812 100644 --- a/src/or/connection.h +++ b/src/or/connection.h @@ -34,15 +34,21 @@ void _connection_mark_for_close(connection_t *conn,int line, const char *file); #define connection_mark_for_close(c) \ _connection_mark_for_close((c), __LINE__, _SHORT_FILE_) -#define connection_mark_and_flush(c) \ +/** + * Mark 'c' for close, but try to hold it open until all the data is written. + */ +#define _connection_mark_and_flush(c,line,file) \ do { \ connection_t *tmp_conn_ = (c); \ - _connection_mark_for_close(tmp_conn_, __LINE__, _SHORT_FILE_); \ + _connection_mark_for_close(tmp_conn_, (line), (file)); \ tmp_conn_->hold_open_until_flushed = 1; \ IF_HAS_BUFFEREVENT(tmp_conn_, \ connection_start_writing(tmp_conn_)); \ } while (0) +#define connection_mark_and_flush(c) \ + _connection_mark_and_flush((c), __LINE__, _SHORT_FILE_) + void connection_expire_held_open(void); int connection_connect(connection_t *conn, const char *address, |