[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] and another byte counting error.



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv24828/src/or

Modified Files:
	relay.c 
Log Message:
and another byte counting error.

Index: relay.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- relay.c	3 Sep 2005 02:12:53 -0000	1.79
+++ relay.c	3 Sep 2005 02:14:31 -0000	1.80
@@ -779,14 +779,14 @@
       return 0;
     }
     if (rh->length >= answer_len+6)
-      ttl = (int)ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+6));
+      ttl = (int)ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+2+answer_len));
     else
       ttl = -1;
     connection_ap_handshake_socks_resolved(conn,
                    cell->payload[RELAY_HEADER_SIZE], /*answer_type*/
                    cell->payload[RELAY_HEADER_SIZE+1], /*answer_len*/
-                   cell->payload+RELAY_HEADER_SIZE+2,
-                   ttl); /* answer */
+                   cell->payload+RELAY_HEADER_SIZE+2, /*answer*/
+                   ttl);
     connection_mark_unattached_ap(conn, END_STREAM_REASON_ALREADY_SOCKS_REPLIED);
     return 0;
   }