diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-08-08 18:53:24 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-27 12:31:13 -0400 |
commit | 9f8027abfd70c364edbdddb90faa0adfa5547409 (patch) | |
tree | 3be707a60ab2bbee327707bca20938b7f4e2bf02 /src/or/connection.h | |
parent | d830eb366ab037c820b138cfbb8f4bd66986bf42 (diff) | |
download | tor-9f8027abfd70c364edbdddb90faa0adfa5547409.tar.gz tor-9f8027abfd70c364edbdddb90faa0adfa5547409.zip |
Make a function to mark a connection and set hold_open_until_flushed.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r-- | src/or/connection.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/connection.h b/src/or/connection.h index 13a2831227..906f9ba874 100644 --- a/src/or/connection.h +++ b/src/or/connection.h @@ -34,6 +34,15 @@ 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) \ + do { \ + connection_t *tmp_conn_ = (c); \ + _connection_mark_for_close(tmp_conn_, __LINE__, _SHORT_FILE_); \ + tmp_conn_->hold_open_until_flushed = 1; \ + IF_HAS_BUFFEREVENT(tmp_conn_, \ + connection_start_writing(tmp_conn_)); \ + } while (0) + void connection_expire_held_open(void); int connection_connect(connection_t *conn, const char *address, |