]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Adjust straggling users of payload field
authorNick Mathewson <nickm@torproject.org>
Thu, 17 Apr 2003 17:25:32 +0000 (17:25 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 17 Apr 2003 17:25:32 +0000 (17:25 +0000)
svn:r250

src/or/connection.c
src/or/connection_edge.c
src/or/onion.c

index 7dd00cff5489c4b6054ffabc478d46be1abb6307..c82a225947daaccd0dd16862d907f251b4b4ff9d 100644 (file)
@@ -670,7 +670,7 @@ repeat_connection_package_raw_inbuf:
    *       compressing.
    *    2) 
    */
-  len = connection_compress_from_buf(cell.payload,
+  len = connection_compress_from_buf(cell.payload+TOPIC_HEADER_SIZE,
                                      CELL_PAYLOAD_SIZE - TOPIC_HEADER_SIZE,
                                      conn, Z_SYNC_FLUSH);
   if (len < 0)
@@ -684,7 +684,8 @@ repeat_connection_package_raw_inbuf:
     cell.length = amount_to_process;
   }
 
-  if(connection_fetch_from_buf(cell.payload, cell.length, conn) < 0)
+  if(connection_fetch_from_buf(cell.payload+TOPIC_HEADER_SIZE, 
+                               cell.length, conn) < 0)
     return -1;
 #endif
 
index bc3828439c58febebbd3f4348d846a907b96b0ba..ab43798dee01f3e30fc3bd0cfc0a9cff2fc2acb7 100644 (file)
@@ -153,7 +153,7 @@ int connection_edge_process_data_cell(cell_t *cell, circuit_t *circ, int edge_ty
       }
 
 #ifdef USE_ZLIB
-      if(connection_decompress_to_buf(cell->payload,
+      if(connection_decompress_to_buf(cell->payload + TOPIC_HEADER_SIZE,
                                       cell->length - TOPIC_HEADER_SIZE, 
                                       conn, Z_SYNC_FLUSH) < 0) {
         log(LOG_INFO,"connection_edge_process_data_cell(): write to buf failed. Marking for close.");
@@ -161,7 +161,7 @@ int connection_edge_process_data_cell(cell_t *cell, circuit_t *circ, int edge_ty
         return 0;
       }
 #else
-      if(connection_write_to_buf(cell->payload,
+      if(connection_write_to_buf(cell->payload + TOPIC_HEADER_SIZE,
                                  cell->length - TOPIC_HEADER_SIZE, conn) < 0) {
         conn->marked_for_close = 1;
         return 0;
index 7b288f975d88ad6ab9351aa2c277ebc51c3aca58..2f6131e7326e7483ab964cf24d679990c563fc79 100644 (file)
@@ -310,7 +310,6 @@ static int onion_process(circuit_t *circ) {
 int chooselen(double cw)
 {
   int len = 2;
-  int retval = 0;
   uint8_t coin;
   
   if ((cw < 0) || (cw >= 1)) /* invalid parameter */