Fix a crash encountered by jcs@; patch from upstream.

See https://gitweb.torproject.org/tor.git/commit/77a193533966c5c2f81e6a85b3c2a7446076508f

ok jcs@
This commit is contained in:
pascal 2013-06-15 15:43:22 +00:00
parent 223efcfcc4
commit ae093edee2
2 changed files with 27 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.62 2013/03/11 11:35:57 espie Exp $
# $OpenBSD: Makefile,v 1.63 2013/06/15 15:43:22 pascal Exp $
COMMENT= anonymity service using onion routing
DISTNAME= tor-0.2.3.25
REVISION= 0
CATEGORIES= net
HOMEPAGE= http://www.torproject.org/

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_or_connection_edge_c,v 1.1 2013/06/15 15:43:22 pascal Exp $
https://gitweb.torproject.org/tor.git/commit/77a193533966c5c2f81e6a85b3c2a7446076508f
--- src/or/connection_edge.c.orig Mon Nov 19 22:24:54 2012
+++ src/or/connection_edge.c Sat Jun 15 16:43:58 2013
@@ -3302,12 +3302,13 @@ 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 */
- log_warn(LD_BUG,"newly connected conn had data waiting!");
-// connection_start_writing(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);
+ } else {
+ IF_HAS_NO_BUFFEREVENT(conn)
+ connection_watch_events(conn, READ_EVENT);
}
- IF_HAS_NO_BUFFEREVENT(conn)
- connection_watch_events(conn, READ_EVENT);
/* also, deliver a 'connected' cell back through the circuit. */
if (connection_edge_is_rendezvous_stream(edge_conn)) {