]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Be loud when decompressing
authorNick Mathewson <nickm@torproject.org>
Wed, 19 Mar 2003 22:47:34 +0000 (22:47 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 19 Mar 2003 22:47:34 +0000 (22:47 +0000)
svn:r213

src/or/buffers.c
src/or/connection.c
src/or/connection_exit.c

index 2f6c64cc5daad7ecb4264fa576959191ce088bb4..c88fa62a11077275ea04f11828746416c0804980 100644 (file)
@@ -192,6 +192,9 @@ int decompress_buf_to_buf(char **buf_in, int *buflen_in, int *buf_datalen_in,
     {
     case Z_OK:
     case Z_STREAM_END:
+      log(LOG_DEBUG, "Uncompressed (%d/%d); filled (%d/%d)",
+         *buf_datalen_in-zstream->avail_in, *buf_datalen_in,
+         *buf_datalen_out-zstream->avail_out, *buf_datalen_out);
       memmove(*buf_in, zstream->next_in, zstream->avail_in);
       *buf_datalen_in = zstream->avail_in;
       *buf_datalen_out = *buflen_out - zstream->avail_out;
index c9d2c2dc5aa652897e54f892118038c87f10f079..41d07293fedf9babe5d77ebb26d2918f46cc3c8c 100644 (file)
@@ -744,7 +744,7 @@ repeat_connection_package_raw_inbuf:
     return -1;
   }
 
-  log(LOG_DEBUG,"connection_package_raw_inbuf(): (%d) Packaging %d bytes (%d waiting).",conn->s,cell.length, amount_to_process);
+  log(LOG_DEBUG,"connection_package_raw_inbuf(): (%d) Packaging %d bytes (%d waiting).",conn->s,cell.length, conn->inbuf_datalen);
 
   *(uint16_t *)(cell.payload+2) = htons(conn->topic_id);
   *cell.payload = TOPIC_COMMAND_DATA;
index 24b1f21b409fc6f33139a043fe32c83cf525a7bd..b797d719834be32e2a9491b309577454f566c945 100644 (file)
@@ -196,6 +196,7 @@ int connection_exit_process_data_cell(cell_t *cell, circuit_t *circ) {
   connection_t *conn;
   int topic_command;
   int topic_id;
+  int len;
   static int num_seen=0;
 
   /* an outgoing data cell has arrived */
@@ -248,16 +249,19 @@ int connection_exit_process_data_cell(cell_t *cell, circuit_t *circ) {
       if(conn->state != EXIT_CONN_STATE_OPEN) {
         log(LOG_DEBUG,"connection_exit_process_data_cell(): data received while resolving/connecting. Queueing.");
       }
-      log(LOG_DEBUG,"connection_exit_process_data_cell(): put %d bytes on outbuf.",cell->length - TOPIC_HEADER_SIZE);
 #ifdef USE_ZLIB
-      if(connection_decompress_to_buf(cell->payload + TOPIC_HEADER_SIZE,
-                                      cell->length - TOPIC_HEADER_SIZE, 
-                                      conn, Z_SYNC_FLUSH) < 0) {
+      log(LOG_DEBUG,"connection_exit_process_data_cell(): uncompressing %d bytes onto outbuf...",cell->length - TOPIC_HEADER_SIZE);
+      len = connection_decompress_to_buf(cell->payload + TOPIC_HEADER_SIZE,
+                                        cell->length - TOPIC_HEADER_SIZE, 
+                                        conn, Z_SYNC_FLUSH);
+      log(LOG_DEBUG,"%d bytes written", len);
+      if (len<0) {
         log(LOG_INFO,"connection_exit_process_data_cell(): write to buf failed. Marking for close.");
         conn->marked_for_close = 1;
         return 0;
       }
 #else
+      log(LOG_DEBUG,"connection_exit_process_data_cell(): put %d bytes on outbuf.",cell->length - TOPIC_HEADER_SIZE);
       if(connection_write_to_buf(cell->payload + TOPIC_HEADER_SIZE,
                                  cell->length - TOPIC_HEADER_SIZE, conn) < 0) {
         log(LOG_INFO,"connection_exit_process_data_cell(): write to buf failed. Marking for close.");