[or-cvs] On our dirport return a robots.txt so maybe google doesn"t ...
Peter Palfrader
weasel at seul.org
Mon Mar 27 07:33:15 UTC 2006
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv1133
Modified Files:
directory.c
Log Message:
On our dirport return a robots.txt so maybe google doesn't index all those server descriptors anymore
Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.365
retrieving revision 1.366
diff -u -p -d -r1.365 -r1.366
--- directory.c 27 Mar 2006 02:25:34 -0000 1.365
+++ directory.c 27 Mar 2006 07:33:13 -0000 1.366
@@ -1613,6 +1613,22 @@ directory_handle_command_get(connection_
return 0;
}
+ if (!strcmp(url,"/tor/robots.txt")) { /* /robots.txt will have been
+ rewritten to /tor/robots.txt */
+ char robots[] = "User-agent: *\r\nDisallow: /\r\n";
+ size_t len = strlen(robots);
+ format_rfc1123_time(date, time(NULL));
+ tor_snprintf(tmp, sizeof(tmp),
+ "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+ "Content-Type: text/plain\r\n\r\n",
+ date,
+ (int)len);
+ connection_write_to_buf(tmp, strlen(tmp), conn);
+ connection_write_to_buf(robots, len, conn);
+ tor_free(url);
+ return 0;
+ }
+
/* we didn't recognize the url */
write_http_status_line(conn, 404, "Not found");
tor_free(url);
More information about the tor-commits
mailing list