mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Check for orconns and use connection_or_close_for_error() when appropriate in connection_handle_write_impl()
This commit is contained in:
parent
125c8e5468
commit
65a0f895c7
4
changes/bug11302
Normal file
4
changes/bug11302
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Bugfixes:
|
||||||
|
- Check for orconns and use connection_or_close_for_error() rather than
|
||||||
|
connection_mark_for_close() directly in the getsockopt() failure case
|
||||||
|
of connection_handle_write_impl(). Fixes bug #11302.
|
@ -3705,9 +3705,15 @@ connection_handle_write_impl(connection_t *conn, int force)
|
|||||||
if (connection_state_is_connecting(conn)) {
|
if (connection_state_is_connecting(conn)) {
|
||||||
if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) {
|
if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) {
|
||||||
log_warn(LD_BUG, "getsockopt() syscall failed");
|
log_warn(LD_BUG, "getsockopt() syscall failed");
|
||||||
if (CONN_IS_EDGE(conn))
|
if (conn->type == CONN_TYPE_OR) {
|
||||||
|
or_connection_t *orconn = TO_OR_CONN(conn);
|
||||||
|
connection_or_close_for_error(orconn, 0);
|
||||||
|
} else {
|
||||||
|
if (CONN_IS_EDGE(conn)) {
|
||||||
connection_edge_end_errno(TO_EDGE_CONN(conn));
|
connection_edge_end_errno(TO_EDGE_CONN(conn));
|
||||||
|
}
|
||||||
connection_mark_for_close(conn);
|
connection_mark_for_close(conn);
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user