[or-cvs] tweaks and bugfix on resolve/resolved code

Roger Dingledine arma at seul.org
Thu Jun 17 21:11:11 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	buffers.c connection_edge.c 
Log Message:
tweaks and bugfix on resolve/resolved code


Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- buffers.c	17 Jun 2004 18:13:09 -0000	1.96
+++ buffers.c	17 Jun 2004 21:11:09 -0000	1.97
@@ -409,9 +409,6 @@
   return 1;
 }
 
-#define SOCKS_COMMAND_CONNECT 0x01
-#define SOCKS_COMMAND_RESOLVE 0xF0
-
 /** There is a (possibly incomplete) socks handshake on <b>buf</b>, of one
  * of the forms
  *  - socks4: "socksheader username\\0"

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -d -r1.194 -r1.195
--- connection_edge.c	17 Jun 2004 18:13:09 -0000	1.194
+++ connection_edge.c	17 Jun 2004 21:11:09 -0000	1.195
@@ -372,13 +372,15 @@
   } /* else socks handshake is done, continue processing */
 
   if (socks->command == SOCKS_COMMAND_RESOLVE) {
+    uint32_t answer;
     /* Reply to resolves immediately if we can. */
     if (strlen(socks->address) > RELAY_PAYLOAD_SIZE) {
       connection_ap_handshake_socks_resolved(conn,RESOLVED_TYPE_ERROR,0,NULL);
       conn->socks_request->has_finished = 1;
       connection_mark_for_close(conn);
+      return 0;
     }
-    uint32_t answer = htonl(client_dns_lookup_entry(socks->address));
+    answer = htonl(client_dns_lookup_entry(socks->address));
     if (answer) {
       connection_ap_handshake_socks_resolved(conn,RESOLVED_TYPE_IPV4,4,
                                              (char*)&answer);



More information about the tor-commits mailing list