diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-08-12 16:11:28 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-08-12 16:11:28 -0400 |
commit | 7f145b54afb2cb1d9390a65bf31e2dddeb5b87da (patch) | |
tree | f184f7c342e95e36a6b80e2c7fddde7f76c3aa7e /src/or/connection_edge.c | |
parent | 14d58bbb4a9f08d51a58ea0a75d5535a05bfc9e8 (diff) | |
parent | bbc9cbd95839380a45ec9ff11a7f7b99bbe923b0 (diff) | |
download | tor-7f145b54afb2cb1d9390a65bf31e2dddeb5b87da.tar.gz tor-7f145b54afb2cb1d9390a65bf31e2dddeb5b87da.zip |
Merge remote-tracking branch 'public/Fix_19450'
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 0ef5310134..dc6b0930ca 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -478,8 +478,7 @@ connection_edge_finished_connecting(edge_connection_t *edge_conn) rep_hist_note_exit_stream_opened(conn->port); conn->state = EXIT_CONN_STATE_OPEN; - IF_HAS_NO_BUFFEREVENT(conn) - connection_watch_events(conn, READ_EVENT); /* stop writing, keep reading */ + connection_watch_events(conn, READ_EVENT); /* stop writing, keep reading */ if (connection_get_outbuf_len(conn)) /* in case there are any queued relay * cells */ connection_start_writing(conn); @@ -1026,8 +1025,8 @@ connection_ap_detach_retriable(entry_connection_t *conn, pathbias_mark_use_rollback(circ); if (conn->pending_optimistic_data) { - generic_buffer_set_to_copy(&conn->sending_optimistic_data, - conn->pending_optimistic_data); + buf_set_to_copy(&conn->sending_optimistic_data, + conn->pending_optimistic_data); } if (!get_options()->LeaveStreamsUnattached || conn->use_begindir) { @@ -2008,14 +2007,8 @@ connection_ap_handshake_process_socks(entry_connection_t *conn) log_debug(LD_APP,"entered."); - IF_HAS_BUFFEREVENT(base_conn, { - struct evbuffer *input = bufferevent_get_input(base_conn->bufev); - sockshere = fetch_from_evbuffer_socks(input, socks, - options->TestSocks, options->SafeSocks); - }) ELSE_IF_NO_BUFFEREVENT { - sockshere = fetch_from_buf_socks(base_conn->inbuf, socks, - options->TestSocks, options->SafeSocks); - }; + sockshere = fetch_from_buf_socks(base_conn->inbuf, socks, + options->TestSocks, options->SafeSocks); if (socks->replylen) { had_reply = 1; @@ -2347,7 +2340,7 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn) log_info(LD_APP, "Sending up to %ld + %ld bytes of queued-up data", (long)connection_get_inbuf_len(base_conn), ap_conn->sending_optimistic_data ? - (long)generic_buffer_len(ap_conn->sending_optimistic_data) : 0); + (long)buf_datalen(ap_conn->sending_optimistic_data) : 0); if (connection_edge_package_raw_inbuf(edge_conn, 1, NULL) < 0) { connection_mark_for_close(base_conn); } @@ -3225,11 +3218,9 @@ connection_exit_connect(edge_connection_t *edge_conn) conn->state = EXIT_CONN_STATE_OPEN; if (connection_get_outbuf_len(conn)) { /* in case there are any queued data cells, from e.g. optimistic data */ - IF_HAS_NO_BUFFEREVENT(conn) - connection_watch_events(conn, READ_EVENT|WRITE_EVENT); + connection_watch_events(conn, READ_EVENT|WRITE_EVENT); } else { - IF_HAS_NO_BUFFEREVENT(conn) - connection_watch_events(conn, READ_EVENT); + connection_watch_events(conn, READ_EVENT); } /* also, deliver a 'connected' cell back through the circuit. */ |