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

[or-cvs] content-type bugfixes:



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:
content-type bugfixes:
http://seppia.noreply.org/tor/dir.z was being declared text/plain
and
http://seppia.noreply.org/tor/server/fp/719BE45DE224B607C53707D0E2143E2D423E74CF
was being declared application/octet-stream


Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -d -r1.285 -r1.286
--- directory.c	18 Sep 2005 04:15:39 -0000	1.285
+++ directory.c	22 Sep 2005 00:17:41 -0000	1.286
@@ -1201,9 +1201,10 @@
     log_fn(LOG_DEBUG,"Dumping %sdirectory to client.",
            deflated?"deflated ":"");
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
              date,
              (int)dlen,
+             deflated?"application/octet-stream":"text/plain",
              deflated?"deflate":"identity");
     connection_write_to_buf(tmp, strlen(tmp), conn);
     connection_write_to_buf(cp, dlen, conn);
@@ -1224,9 +1225,10 @@
     }
 
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
                  date,
                  (int)dlen,
+                 deflated?"application/octet-stream":"text/plain",
                  deflated?"deflate":"identity");
     connection_write_to_buf(tmp, strlen(tmp), conn);
     connection_write_to_buf(cp, strlen(cp), conn);
@@ -1255,9 +1257,10 @@
     SMARTLIST_FOREACH(dir_objs, cached_dir_t *, d,
                       dlen += deflated?d->dir_z_len:d->dir_len);
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
                  date,
                  (int)dlen,
+                 deflated?"application/octet-stream":"text/plain",
                  deflated?"deflate":"identity");
     connection_write_to_buf(tmp, strlen(tmp), conn);
     SMARTLIST_FOREACH(dir_objs, cached_dir_t *, d,
@@ -1315,7 +1318,7 @@
         connection_write_to_buf(compressed, compressed_len, conn);
         tor_free(compressed);
       } else {
-        tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: application/octet-stream\r\n\r\n",
+        tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\n\r\n",
                      date,
                      (int)len);
         connection_write_to_buf(tmp, strlen(tmp), conn);