Explorar el Código

We were computing the wrong Content-Length: header for directory
responses that need to be compressed on the fly, causing clients
asking for those items to always fail. Bugfix on 0.2.0.x; fixes
bug 593.


svn:r13268

Roger Dingledine hace 17 años
padre
commit
1445e17a21
Se han modificado 2 ficheros con 7 adiciones y 3 borrados
  1. 5 1
      ChangeLog
  2. 2 2
      src/or/directory.c

+ 5 - 1
ChangeLog

@@ -8,7 +8,11 @@ Changes in version 0.2.0.18-alpha - 2008-01-??
       code, which is causing log entries like "TLS error while
       code, which is causing log entries like "TLS error while
       renegotiating handshake". Disable it again. Resolves bug 590.
       renegotiating handshake". Disable it again. Resolves bug 590.
     - Fix a major memory leak when attempting to use the v2 TLS
     - Fix a major memory leak when attempting to use the v2 TLS
-      handshake code.
+      handshake code. Bugfix on 0.2.0.x; fixes bug 589.
+    - We were computing the wrong Content-Length: header for directory
+      responses that need to be compressed on the fly, causing clients
+      asking for those items to always fail. Bugfix on 0.2.0.x; fixes
+      bug 593.
 
 
   o Major features:
   o Major features:
     - Avoid going directly to the directory authorities even if you're a
     - Avoid going directly to the directory authorities even if you're a

+ 2 - 2
src/or/directory.c

@@ -2387,9 +2387,9 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
     SMARTLIST_FOREACH(items, const char *, item, {
     SMARTLIST_FOREACH(items, const char *, item, {
         size_t ln = strlen(item);
         size_t ln = strlen(item);
         if (deflated) {
         if (deflated) {
-          body_len += ln; estimated_len += ln;
-        } else {
           estimated_len += ln/2;
           estimated_len += ln/2;
+        } else {
+          body_len += ln; estimated_len += ln;
         }
         }
       });
       });