aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-16 20:57:09 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-16 20:57:09 +0000
commit6f46316c319277d68ac44697221f1f9881c1d197 (patch)
tree6014ee9c0ef670d33cbede5d8814d245347faadb /src/or/connection_edge.c
parent5f9ac2bdfd43c4abe354192d0c266958c0f0bc56 (diff)
downloadtor-6f46316c319277d68ac44697221f1f9881c1d197.tar
tor-6f46316c319277d68ac44697221f1f9881c1d197.tar.gz
bugfixes and refactorings
svn:r468
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index e47983a12..cb53b8efc 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -12,6 +12,21 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char result);
static int connection_exit_begin_conn(cell_t *cell, circuit_t *circ);
+#define SOCKS4_REQUEST_GRANTED 90
+#define SOCKS4_REQUEST_REJECT 91
+#define SOCKS4_REQUEST_IDENT_FAILED 92
+#define SOCKS4_REQUEST_IDENT_CONFLICT 93
+
+/* structure of a socks client operation */
+typedef struct {
+ unsigned char version; /* socks version number */
+ unsigned char command; /* command code */
+ unsigned char destport[2]; /* destination port, network order */
+ unsigned char destip[4]; /* destination address */
+ /* userid follows, terminated by a NULL */
+ /* dest host follows, terminated by a NULL */
+} socks4_t;
+
int connection_edge_process_inbuf(connection_t *conn) {
assert(conn);
@@ -509,7 +524,7 @@ static int connection_ap_handshake_process_socks(connection_t *conn) {
}
/* find the circuit that we should use, if there is one. */
- circ = circuit_get_newest_ap();
+ circ = circuit_get_newest_open();
if(!circ) {
log_fn(LOG_INFO,"No circuit ready. Closing.");