diff options
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, |