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

[or-cvs] don"t warn when we receive a 503 from a dirserver/cache -- ...



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	directory.c 
Log Message:
don't warn when we receive a 503 from a dirserver/cache -- this
will pave the way for them being able to tell us to screw off
if they're busy.


Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.343
retrieving revision 1.344
diff -u -p -d -r1.343 -r1.344
--- directory.c	19 Jan 2006 11:21:28 -0000	1.343
+++ directory.c	3 Feb 2006 12:08:31 -0000	1.344
@@ -891,6 +891,14 @@ connection_dir_client_reached_eof(connec
     }
   }
 
+  if (status_code == 503) {
+    info(LD_DIR,"Received http status code %d (\"%s\") from server "
+         "'%s:%d'. I'll try again soon.",
+         status_code, reason, conn->address, conn->port);
+    tor_free(body); tor_free(headers); tor_free(reason);
+    return -1;
+  }
+
   plausible = body_is_plausible(body, body_len, conn->purpose);
   if (compression || !plausible) {
     char *new_body = NULL;
@@ -950,12 +958,6 @@ connection_dir_client_reached_eof(connec
     /* fetch/process the directory to cache it. */
     info(LD_DIR,"Received directory (size %d) from server '%s:%d'",
          (int)body_len, conn->address, conn->port);
-    if (status_code == 503 || body_len == 0) {
-      info(LD_DIR,"Empty directory; status %d (\"%s\") Ignoring.",
-           status_code, reason);
-      tor_free(body); tor_free(headers); tor_free(reason);
-      return -1;
-    }
     if (status_code != 200) {
       warn(LD_DIR,"Received http status code %d (\"%s\") from server "
            "'%s:%d'. I'll try again soon.",