Loading ChangeLog +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ Changes in version 0.2.0.8-alpha - 2007-10-12 - Caches now download v3 network status documents as needed. - Send a 503 when low on bandwidth and a vote, consensus, or certificate is requested. - If-modified-since is now implemented properly for all kinds of certificate requests. o Minor features (network statuses): - Tweak the implementation of proposal 109 slightly: allow at most Loading src/or/directory.c +11 −4 Original line number Diff line number Diff line Loading @@ -2161,7 +2161,9 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, if (!strcmpstart(url,"/tor/status-vote/current/") || !strcmpstart(url,"/tor/status-vote/next/")) { /*XXXX020 implement if-modified-since */ /* XXXX If-modified-since is only the implemented for the current * consensus: that's probably fine, since it's the only vote document * people fetch much.*/ int current = 1; ssize_t body_len = 0; ssize_t estimated_len = 0; Loading Loading @@ -2321,7 +2323,6 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, } if (!strcmpstart(url,"/tor/keys/")) { /*XXXX020 implement if-modified-since */ smartlist_t *certs = smartlist_create(); ssize_t len = -1; if (!strcmp(url, "/tor/keys/all")) { Loading @@ -2331,7 +2332,6 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, if (!ds->v3_certs) continue; SMARTLIST_FOREACH(ds->v3_certs, authority_cert_t *, cert, if (cert->cache_info.published_on >= if_modified_since) smartlist_add(certs, cert)); }); } else if (!strcmp(url, "/tor/keys/authority")) { Loading Loading @@ -2368,6 +2368,13 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, smartlist_free(certs); goto keys_done; } SMARTLIST_FOREACH(certs, authority_cert_t *, c, if (cert->cache_info.published_on < if_modified_since) SMARTLIST_DEL_CURRENT(certs, c)); if (!smartlist_len(certs)) { write_status_line(conn, 304, "Not modified"); goto keys_done; } len = 0; SMARTLIST_FOREACH(certs, authority_cert_t *, c, len += c->cache_info.signed_descriptor_len); Loading Loading
ChangeLog +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ Changes in version 0.2.0.8-alpha - 2007-10-12 - Caches now download v3 network status documents as needed. - Send a 503 when low on bandwidth and a vote, consensus, or certificate is requested. - If-modified-since is now implemented properly for all kinds of certificate requests. o Minor features (network statuses): - Tweak the implementation of proposal 109 slightly: allow at most Loading
src/or/directory.c +11 −4 Original line number Diff line number Diff line Loading @@ -2161,7 +2161,9 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, if (!strcmpstart(url,"/tor/status-vote/current/") || !strcmpstart(url,"/tor/status-vote/next/")) { /*XXXX020 implement if-modified-since */ /* XXXX If-modified-since is only the implemented for the current * consensus: that's probably fine, since it's the only vote document * people fetch much.*/ int current = 1; ssize_t body_len = 0; ssize_t estimated_len = 0; Loading Loading @@ -2321,7 +2323,6 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, } if (!strcmpstart(url,"/tor/keys/")) { /*XXXX020 implement if-modified-since */ smartlist_t *certs = smartlist_create(); ssize_t len = -1; if (!strcmp(url, "/tor/keys/all")) { Loading @@ -2331,7 +2332,6 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, if (!ds->v3_certs) continue; SMARTLIST_FOREACH(ds->v3_certs, authority_cert_t *, cert, if (cert->cache_info.published_on >= if_modified_since) smartlist_add(certs, cert)); }); } else if (!strcmp(url, "/tor/keys/authority")) { Loading Loading @@ -2368,6 +2368,13 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, smartlist_free(certs); goto keys_done; } SMARTLIST_FOREACH(certs, authority_cert_t *, c, if (cert->cache_info.published_on < if_modified_since) SMARTLIST_DEL_CURRENT(certs, c)); if (!smartlist_len(certs)) { write_status_line(conn, 304, "Not modified"); goto keys_done; } len = 0; SMARTLIST_FOREACH(certs, authority_cert_t *, c, len += c->cache_info.signed_descriptor_len); Loading