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

[or-cvs] r13268: We were computing the wrong Content-Length: header for direc (in tor/trunk: . src/or)



Author: arma
Date: 2008-01-24 20:45:06 -0500 (Thu, 24 Jan 2008)
New Revision: 13268

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/directory.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-01-25 01:34:20 UTC (rev 13267)
+++ tor/trunk/ChangeLog	2008-01-25 01:45:06 UTC (rev 13268)
@@ -8,7 +8,11 @@
       code, which is causing log entries like "TLS error while
       renegotiating handshake". Disable it again. Resolves bug 590.
     - 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:
     - Avoid going directly to the directory authorities even if you're a

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2008-01-25 01:34:20 UTC (rev 13267)
+++ tor/trunk/src/or/directory.c	2008-01-25 01:45:06 UTC (rev 13268)
@@ -2387,9 +2387,9 @@
     SMARTLIST_FOREACH(items, const char *, item, {
         size_t ln = strlen(item);
         if (deflated) {
+          estimated_len += ln/2;
+        } else {
           body_len += ln; estimated_len += ln;
-        } else {
-          estimated_len += ln/2;
         }
       });