mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 05:03:43 +01:00
r9307@totoro: nickm | 2006-11-13 18:25:56 -0500
Patch from tup based on patch from Zajcev Evgeny: Make TransPort work even when the server wants to talk before the client. svn:r8945
This commit is contained in:
parent
d245d413a9
commit
fa6fbbc150
@ -2,6 +2,12 @@ Changes in version 0.1.2.4-alpha - 2006-11-??
|
|||||||
o Minor features
|
o Minor features
|
||||||
- Add breakdown of public key operations to dumped statistics.
|
- Add breakdown of public key operations to dumped statistics.
|
||||||
|
|
||||||
|
o Major bugfixes
|
||||||
|
- Handle TransPort connections even when the server sends data before
|
||||||
|
the client sends data. Previously, the connection would just hang
|
||||||
|
until the client sent data. (Patch from tup based on patch from
|
||||||
|
Zajcev Evgeny.)
|
||||||
|
|
||||||
o Minor bugfixes
|
o Minor bugfixes
|
||||||
- Don't log spurious warnings when we see a circuit close reason we
|
- Don't log spurious warnings when we see a circuit close reason we
|
||||||
don't recognize; it's probably just from a newer version of Tor.
|
don't recognize; it's probably just from a newer version of Tor.
|
||||||
|
@ -96,7 +96,6 @@ conn_state_to_string(int type, int state)
|
|||||||
break;
|
break;
|
||||||
case CONN_TYPE_AP:
|
case CONN_TYPE_AP:
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case AP_CONN_STATE_ORIGDST_WAIT:
|
|
||||||
case AP_CONN_STATE_SOCKS_WAIT: return "waiting for dest info";
|
case AP_CONN_STATE_SOCKS_WAIT: return "waiting for dest info";
|
||||||
case AP_CONN_STATE_RENDDESC_WAIT: return "waiting for rendezvous desc";
|
case AP_CONN_STATE_RENDDESC_WAIT: return "waiting for rendezvous desc";
|
||||||
case AP_CONN_STATE_CONTROLLER_WAIT: return "waiting for controller";
|
case AP_CONN_STATE_CONTROLLER_WAIT: return "waiting for controller";
|
||||||
@ -808,6 +807,8 @@ connection_handle_listener_read(connection_t *conn, int new_type)
|
|||||||
|
|
||||||
/** Initialize states for newly accepted connection <b>conn</b>.
|
/** Initialize states for newly accepted connection <b>conn</b>.
|
||||||
* If conn is an OR, start the tls handshake.
|
* If conn is an OR, start the tls handshake.
|
||||||
|
* If conn is a transparent AP, get its original destination
|
||||||
|
* and place it in circuit_wait.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
connection_init_accepted_conn(connection_t *conn, uint8_t listener_type)
|
connection_init_accepted_conn(connection_t *conn, uint8_t listener_type)
|
||||||
@ -824,8 +825,8 @@ connection_init_accepted_conn(connection_t *conn, uint8_t listener_type)
|
|||||||
conn->state = AP_CONN_STATE_SOCKS_WAIT;
|
conn->state = AP_CONN_STATE_SOCKS_WAIT;
|
||||||
break;
|
break;
|
||||||
case CONN_TYPE_AP_TRANS_LISTENER:
|
case CONN_TYPE_AP_TRANS_LISTENER:
|
||||||
conn->state = AP_CONN_STATE_ORIGDST_WAIT;
|
conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
|
||||||
break;
|
return connection_ap_process_transparent(TO_EDGE_CONN(conn));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONN_TYPE_DIR:
|
case CONN_TYPE_DIR:
|
||||||
|
@ -28,7 +28,6 @@ const char connection_edge_c_id[] =
|
|||||||
static smartlist_t *redirect_exit_list = NULL;
|
static smartlist_t *redirect_exit_list = NULL;
|
||||||
|
|
||||||
static int connection_ap_handshake_process_socks(edge_connection_t *conn);
|
static int connection_ap_handshake_process_socks(edge_connection_t *conn);
|
||||||
static int connection_ap_process_transparent(edge_connection_t *conn);
|
|
||||||
static int connection_exit_connect_dir(edge_connection_t *exit_conn);
|
static int connection_exit_connect_dir(edge_connection_t *exit_conn);
|
||||||
|
|
||||||
/** An AP stream has failed/finished. If it hasn't already sent back
|
/** An AP stream has failed/finished. If it hasn't already sent back
|
||||||
@ -110,12 +109,6 @@ connection_edge_process_inbuf(edge_connection_t *conn, int package_partial)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case AP_CONN_STATE_ORIGDST_WAIT:
|
|
||||||
if (connection_ap_process_transparent(conn) < 0) {
|
|
||||||
/* already marked */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
case AP_CONN_STATE_OPEN:
|
case AP_CONN_STATE_OPEN:
|
||||||
case EXIT_CONN_STATE_OPEN:
|
case EXIT_CONN_STATE_OPEN:
|
||||||
if (connection_edge_package_raw_inbuf(conn, package_partial) < 0) {
|
if (connection_edge_package_raw_inbuf(conn, package_partial) < 0) {
|
||||||
@ -254,7 +247,6 @@ connection_edge_finished_flushing(edge_connection_t *conn)
|
|||||||
connection_edge_consider_sending_sendme(conn);
|
connection_edge_consider_sending_sendme(conn);
|
||||||
return 0;
|
return 0;
|
||||||
case AP_CONN_STATE_SOCKS_WAIT:
|
case AP_CONN_STATE_SOCKS_WAIT:
|
||||||
case AP_CONN_STATE_ORIGDST_WAIT:
|
|
||||||
case AP_CONN_STATE_RENDDESC_WAIT:
|
case AP_CONN_STATE_RENDDESC_WAIT:
|
||||||
case AP_CONN_STATE_CIRCUIT_WAIT:
|
case AP_CONN_STATE_CIRCUIT_WAIT:
|
||||||
case AP_CONN_STATE_CONNECT_WAIT:
|
case AP_CONN_STATE_CONNECT_WAIT:
|
||||||
@ -1452,14 +1444,14 @@ connection_ap_handshake_process_socks(edge_connection_t *conn)
|
|||||||
return connection_ap_handshake_rewrite_and_attach(conn, NULL);
|
return connection_ap_handshake_rewrite_and_attach(conn, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** connection_edge_process_inbuf() found a conn in state
|
/** connection_init_accepted_conn() found a new trans AP conn.
|
||||||
* origdst_wait. Get the original destination and
|
* Get the original destination and send it to
|
||||||
* send it to connection_ap_handshake_rewrite_and_attach().
|
* connection_ap_handshake_rewrite_and_attach().
|
||||||
*
|
*
|
||||||
* Return -1 if an unexpected error with conn (and it should be marked
|
* Return -1 if an unexpected error with conn (and it should be marked
|
||||||
* for close), else return 0.
|
* for close), else return 0.
|
||||||
*/
|
*/
|
||||||
static int
|
int
|
||||||
connection_ap_process_transparent(edge_connection_t *conn)
|
connection_ap_process_transparent(edge_connection_t *conn)
|
||||||
{
|
{
|
||||||
socks_request_t *socks;
|
socks_request_t *socks;
|
||||||
@ -1467,7 +1459,6 @@ connection_ap_process_transparent(edge_connection_t *conn)
|
|||||||
|
|
||||||
tor_assert(conn);
|
tor_assert(conn);
|
||||||
tor_assert(conn->_base.type == CONN_TYPE_AP);
|
tor_assert(conn->_base.type == CONN_TYPE_AP);
|
||||||
tor_assert(conn->_base.state == AP_CONN_STATE_ORIGDST_WAIT);
|
|
||||||
tor_assert(conn->socks_request);
|
tor_assert(conn->socks_request);
|
||||||
socks = conn->socks_request;
|
socks = conn->socks_request;
|
||||||
|
|
||||||
|
@ -1583,8 +1583,7 @@ handle_getinfo_helper(control_connection_t *control_conn,
|
|||||||
origin_circuit_t *origin_circ = NULL;
|
origin_circuit_t *origin_circ = NULL;
|
||||||
if (conns[i]->type != CONN_TYPE_AP ||
|
if (conns[i]->type != CONN_TYPE_AP ||
|
||||||
conns[i]->marked_for_close ||
|
conns[i]->marked_for_close ||
|
||||||
conns[i]->state == AP_CONN_STATE_SOCKS_WAIT ||
|
conns[i]->state == AP_CONN_STATE_SOCKS_WAIT)
|
||||||
conns[i]->state == AP_CONN_STATE_ORIGDST_WAIT)
|
|
||||||
continue;
|
continue;
|
||||||
conn = TO_EDGE_CONN(conns[i]);
|
conn = TO_EDGE_CONN(conns[i]);
|
||||||
switch (conn->_base.state)
|
switch (conn->_base.state)
|
||||||
|
@ -294,10 +294,7 @@ typedef enum {
|
|||||||
#define AP_CONN_STATE_RESOLVE_WAIT 10
|
#define AP_CONN_STATE_RESOLVE_WAIT 10
|
||||||
/** State for a SOCKS connection: ready to send and receive. */
|
/** State for a SOCKS connection: ready to send and receive. */
|
||||||
#define AP_CONN_STATE_OPEN 11
|
#define AP_CONN_STATE_OPEN 11
|
||||||
/** State for a transparent proxy connection: waiting for original
|
#define _AP_CONN_STATE_MAX 11
|
||||||
* destination. */
|
|
||||||
#define AP_CONN_STATE_ORIGDST_WAIT 12
|
|
||||||
#define _AP_CONN_STATE_MAX 12
|
|
||||||
|
|
||||||
#define _DIR_CONN_STATE_MIN 1
|
#define _DIR_CONN_STATE_MIN 1
|
||||||
/** State for connection to directory server: waiting for connect(). */
|
/** State for connection to directory server: waiting for connect(). */
|
||||||
@ -1993,6 +1990,7 @@ void circuit_discard_optional_exit_enclaves(extend_info_t *info);
|
|||||||
int connection_ap_detach_retriable(edge_connection_t *conn,
|
int connection_ap_detach_retriable(edge_connection_t *conn,
|
||||||
origin_circuit_t *circ,
|
origin_circuit_t *circ,
|
||||||
int reason);
|
int reason);
|
||||||
|
int connection_ap_process_transparent(edge_connection_t *conn);
|
||||||
|
|
||||||
void addressmap_init(void);
|
void addressmap_init(void);
|
||||||
void addressmap_clean(time_t now);
|
void addressmap_clean(time_t now);
|
||||||
|
Loading…
Reference in New Issue
Block a user