[or-cvs] begin cells are now address:port, not address,port

Roger Dingledine arma at seul.org
Sat Apr 5 19:04:49 UTC 2003


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

Modified Files:
	connection_ap.c connection_exit.c 
Log Message:
begin cells are now address:port, not address,port
(breaks backward compatibility)


Index: connection_ap.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_ap.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- connection_ap.c	19 Mar 2003 22:05:35 -0000	1.31
+++ connection_ap.c	5 Apr 2003 19:04:47 -0000	1.32
@@ -368,7 +368,7 @@
   /* FIXME check for collisions */
   ap_conn->topic_id = ntohs(*(uint16_t *)(cell.payload+2));
   cell.payload[0] = TOPIC_COMMAND_BEGIN;
-  snprintf(cell.payload+4, CELL_PAYLOAD_SIZE-4, "%s,%d", ap_conn->dest_addr, ap_conn->dest_port);
+  snprintf(cell.payload+4, CELL_PAYLOAD_SIZE-4, "%s:%d", ap_conn->dest_addr, ap_conn->dest_port);
   cell.length = strlen(cell.payload+TOPIC_HEADER_SIZE)+1+TOPIC_HEADER_SIZE;
   log(LOG_DEBUG,"ap_handshake_send_begin(): Sending data cell to begin topic %d.", ap_conn->topic_id);
   if(circuit_deliver_data_cell_from_edge(&cell, circ, EDGE_AP) < 0) {

Index: connection_exit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_exit.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- connection_exit.c	24 Mar 2003 03:00:20 -0000	1.27
+++ connection_exit.c	5 Apr 2003 19:04:47 -0000	1.28
@@ -135,20 +135,20 @@
 
 int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
   connection_t *n_conn;
-  char *comma;
+  char *colon;
 
   if(!memchr(cell->payload + TOPIC_HEADER_SIZE,0,cell->length - TOPIC_HEADER_SIZE)) {
     log(LOG_WARNING,"connection_exit_begin_conn(): topic begin cell has no \\0. Dropping.");
     return 0;
   }
-  comma = strchr(cell->payload + TOPIC_HEADER_SIZE, ',');
-  if(!comma) {
-    log(LOG_WARNING,"connection_exit_begin_conn(): topic begin cell has no comma. Dropping.");
+  colon = strchr(cell->payload + TOPIC_HEADER_SIZE, ':');
+  if(!colon) {
+    log(LOG_WARNING,"connection_exit_begin_conn(): topic begin cell has no colon. Dropping.");
     return 0;
   }
-  *comma = 0;
+  *colon = 0;
 
-  if(!atoi(comma+1)) { /* bad port */
+  if(!atoi(colon+1)) { /* bad port */
     log(LOG_DEBUG,"connection_exit_begin_conn(): topic begin cell has invalid port. Dropping.");
     return 0;
   }
@@ -164,7 +164,7 @@
   n_conn->topic_id = ntohs(*(uint16_t *)(cell->payload+2));
 
   n_conn->address = strdup(cell->payload + TOPIC_HEADER_SIZE);
-  n_conn->port = atoi(comma+1);
+  n_conn->port = atoi(colon+1);
   n_conn->state = EXIT_CONN_STATE_RESOLVING;
   n_conn->receiver_bucket = -1; /* edge connections don't do receiver buckets */
   n_conn->bandwidth = -1;



More information about the tor-commits mailing list