mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
r17913@catbus: nickm | 2008-02-05 16:11:33 -0500
Correctly register failures in connection_add() in dnsserv_launch_request() svn:r13387
This commit is contained in:
parent
bd5bcbdc09
commit
c11c48fc78
@ -1,4 +1,8 @@
|
|||||||
Changes in version 0.2.0.19-alpha - 2008-02-??
|
Changes in version 0.2.0.19-alpha - 2008-02-??
|
||||||
|
o Minor features:
|
||||||
|
- Actually validate the options passed to AuthDirReject, AuthDirInvalid,
|
||||||
|
AuthDirBadDir, and AuthDirBadExit.
|
||||||
|
|
||||||
o Major bugfixes:
|
o Major bugfixes:
|
||||||
- If we're a relay, avoid picking ourselves as an introduction point,
|
- If we're a relay, avoid picking ourselves as an introduction point,
|
||||||
a rendezvous point, or as the final hop for internal circuits. Bug
|
a rendezvous point, or as the final hop for internal circuits. Bug
|
||||||
@ -23,6 +27,11 @@ Changes in version 0.2.0.19-alpha - 2008-02-??
|
|||||||
signature download requests. Fix for bug 593. Bugfix on 0.2.0.x.
|
signature download requests. Fix for bug 593. Bugfix on 0.2.0.x.
|
||||||
- Don't trigger an assert if we start a directory authority with a
|
- Don't trigger an assert if we start a directory authority with a
|
||||||
private IP address (like 127.0.0.1).
|
private IP address (like 127.0.0.1).
|
||||||
|
- Avoid possible failures when generating a directory with routers with
|
||||||
|
over-long versions strings, or too many flags set. Bugfix on 0.1.2.x.
|
||||||
|
- If an attempt to launch a DNS resolve request over the control
|
||||||
|
port fails because we have overrun the limit on the number of
|
||||||
|
connections, tell the controller that the request has failed.
|
||||||
|
|
||||||
|
|
||||||
Changes in version 0.2.0.18-alpha - 2008-01-25
|
Changes in version 0.2.0.18-alpha - 2008-01-25
|
||||||
|
@ -2439,7 +2439,7 @@ static int
|
|||||||
handle_control_resolve(control_connection_t *conn, uint32_t len,
|
handle_control_resolve(control_connection_t *conn, uint32_t len,
|
||||||
const char *body)
|
const char *body)
|
||||||
{
|
{
|
||||||
smartlist_t *args;
|
smartlist_t *args, *failed;
|
||||||
int is_reverse = 0;
|
int is_reverse = 0;
|
||||||
(void) len; /* body is nul-terminated; it's safe to ignore the length */
|
(void) len; /* body is nul-terminated; it's safe to ignore the length */
|
||||||
|
|
||||||
@ -2458,14 +2458,21 @@ handle_control_resolve(control_connection_t *conn, uint32_t len,
|
|||||||
tor_free(cp);
|
tor_free(cp);
|
||||||
is_reverse = 1;
|
is_reverse = 1;
|
||||||
}
|
}
|
||||||
|
failed = smartlist_create();
|
||||||
SMARTLIST_FOREACH(args, const char *, arg, {
|
SMARTLIST_FOREACH(args, const char *, arg, {
|
||||||
dnsserv_launch_request(arg, is_reverse);
|
if (dnsserv_launch_request(arg, is_reverse)<0)
|
||||||
|
smartlist_add(failed, (char*)arg);
|
||||||
|
});
|
||||||
|
|
||||||
|
send_control_done(conn);
|
||||||
|
SMARTLIST_FOREACH(failed, const char *, arg, {
|
||||||
|
control_event_address_mapped(arg, arg, time(NULL),
|
||||||
|
"Unable to launch resolve request");
|
||||||
});
|
});
|
||||||
|
|
||||||
SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
|
SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
|
||||||
smartlist_free(args);
|
smartlist_free(args);
|
||||||
|
smartlist_free(failed);
|
||||||
send_control_done(conn);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ evdns_server_callback(struct evdns_server_request *req, void *_data)
|
|||||||
(void) addrlen;
|
(void) addrlen;
|
||||||
sa = (struct sockaddr*) &addr;
|
sa = (struct sockaddr*) &addr;
|
||||||
if (sa->sa_family != AF_INET) {
|
if (sa->sa_family != AF_INET) {
|
||||||
/* XXXX020 Handle IPV6 */
|
/* XXXX_IP6 Handle IPV6 */
|
||||||
log_warn(LD_APP, "Requesting address wasn't ipv4.");
|
log_warn(LD_APP, "Requesting address wasn't ipv4.");
|
||||||
evdns_server_request_respond(req, DNS_ERR_SERVERFAILED);
|
evdns_server_request_respond(req, DNS_ERR_SERVERFAILED);
|
||||||
return;
|
return;
|
||||||
@ -155,8 +155,10 @@ evdns_server_callback(struct evdns_server_request *req, void *_data)
|
|||||||
|
|
||||||
/* Helper function: called whenever the client sends a resolve request to our
|
/* Helper function: called whenever the client sends a resolve request to our
|
||||||
* controller. We need to eventually answer the request <b>req</b>.
|
* controller. We need to eventually answer the request <b>req</b>.
|
||||||
|
* Returns 0 if the controller will be getting (or has gotten) an event in
|
||||||
|
* response; -1 if we couldn't launch the request.
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
dnsserv_launch_request(const char *name, int reverse)
|
dnsserv_launch_request(const char *name, int reverse)
|
||||||
{
|
{
|
||||||
edge_connection_t *conn;
|
edge_connection_t *conn;
|
||||||
@ -178,9 +180,8 @@ dnsserv_launch_request(const char *name, int reverse)
|
|||||||
|
|
||||||
if (connection_add(TO_CONN(conn))<0) {
|
if (connection_add(TO_CONN(conn))<0) {
|
||||||
log_warn(LD_APP, "Couldn't register dummy connection for RESOLVE request");
|
log_warn(LD_APP, "Couldn't register dummy connection for RESOLVE request");
|
||||||
/* XXXX020 Answer the controller. */
|
|
||||||
connection_free(TO_CONN(conn));
|
connection_free(TO_CONN(conn));
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now, throw the connection over to get rewritten (which will answer it
|
/* Now, throw the connection over to get rewritten (which will answer it
|
||||||
@ -195,6 +196,7 @@ dnsserv_launch_request(const char *name, int reverse)
|
|||||||
log_info(LD_APP, "Passed request for %s to rewrite_and_attach.",
|
log_info(LD_APP, "Passed request for %s to rewrite_and_attach.",
|
||||||
escaped_safe_str(q_name));
|
escaped_safe_str(q_name));
|
||||||
tor_free(q_name);
|
tor_free(q_name);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** If there is a pending request on <b>conn</b> that's waiting for an answer,
|
/** If there is a pending request on <b>conn</b> that's waiting for an answer,
|
||||||
|
@ -3221,7 +3221,7 @@ void dnsserv_resolved(edge_connection_t *conn,
|
|||||||
const char *answer,
|
const char *answer,
|
||||||
int ttl);
|
int ttl);
|
||||||
void dnsserv_reject_request(edge_connection_t *conn);
|
void dnsserv_reject_request(edge_connection_t *conn);
|
||||||
void dnsserv_launch_request(const char *name, int is_reverse);
|
int dnsserv_launch_request(const char *name, int is_reverse);
|
||||||
|
|
||||||
/********************************* geoip.c **************************/
|
/********************************* geoip.c **************************/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user