TO_EDGE_CONN(conn)->isolation_flags = listener->isolation_flags;
TO_EDGE_CONN(conn)->session_group = listener->session_group;
TO_EDGE_CONN(conn)->nym_epoch = get_signewnym_epoch();
+ TO_EDGE_CONN(conn)->socks_request->listener_type = listener->_base.type;
switch (TO_CONN(listener)->type) {
case CONN_TYPE_AP_LISTENER:
conn->state = AP_CONN_STATE_SOCKS_WAIT;
}
/* Populate isolation fields. */
+ conn->socks_request->listener_type = CONN_TYPE_DIR_LISTENER;
conn->original_dest_address = tor_strdup(address);
conn->session_group = session_group;
conn->isolation_flags = isolation_flags;
strcmp_opt(a->socks_request->password, b->socks_request->password)))
return 0;
if ((iso & ISO_CLIENTPROTO) &&
- (TO_CONN(a)->type != TO_CONN(b)->type ||
+ (a->socks_request->listener_type != b->socks_request->listener_type ||
a->socks_request->socks_version != b->socks_request->socks_version))
return 0;
if ((iso & ISO_CLIENTADDR) &&
strcmp_opt(conn->socks_request->password, circ->socks_password)))
return 0;
if ((iso & ISO_CLIENTPROTO) &&
- (TO_CONN(conn)->type != circ->client_proto_type ||
+ (conn->socks_request->listener_type != circ->client_proto_type ||
conn->socks_request->socks_version != circ->client_proto_socksver))
return 0;
if ((iso & ISO_CLIENTADDR) &&
return -1;
circ->dest_port = conn->socks_request->port;
circ->dest_address = tor_strdup(conn->original_dest_address);
- circ->client_proto_type = TO_CONN(conn)->type;
+ circ->client_proto_type = conn->socks_request->listener_type;
circ->client_proto_socksver = conn->socks_request->socks_version;
tor_addr_copy(&circ->client_addr, &TO_CONN(conn)->addr);
circ->session_group = conn->session_group;
if (strcmp_opt(conn->socks_request->username, circ->socks_username) ||
strcmp_opt(conn->socks_request->password, circ->socks_password))
mixed |= ISO_SOCKSAUTH;
- if ((TO_CONN(conn)->type != circ->client_proto_type ||
+ if ((conn->socks_request->listener_type != circ->client_proto_type ||
conn->socks_request->socks_version != circ->client_proto_socksver))
mixed |= ISO_CLIENTPROTO;
if (!tor_addr_eq(&TO_CONN(conn)->addr, &circ->client_addr))
strlcpy(conn->socks_request->address, q->name,
sizeof(conn->socks_request->address));
+ conn->socks_request->listener_type = listener->_base.type;
conn->dns_server_request = req;
conn->isolation_flags = listener->isolation_flags;
conn->session_group = listener->session_group;
strlcpy(conn->socks_request->address, name,
sizeof(conn->socks_request->address));
+ conn->socks_request->listener_type = CONN_TYPE_CONTROL_LISTENER;
conn->original_dest_address = tor_strdup(name);
conn->session_group = SESSION_GROUP_CONTROL_RESOLVE;
conn->nym_epoch = get_signewnym_epoch();
uint8_t auth_type;
/** What is this stream's goal? One of the SOCKS_COMMAND_* values */
uint8_t command;
+ /** Which kind of listener created this stream? */
+ uint8_t listener_type;
size_t replylen; /**< Length of <b>reply</b>. */
uint8_t reply[MAX_SOCKS_REPLY_LEN]; /**< Write an entry into this string if
* we want to specify our own socks reply,