mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-03 00:53:32 +01:00
bugfix: actually remember the answer in the cache :)
svn:r159
This commit is contained in:
parent
3cf02a88f4
commit
8c136b3a06
@ -543,6 +543,7 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
|
|||||||
|
|
||||||
assert(resolve->state == CACHE_STATE_PENDING);
|
assert(resolve->state == CACHE_STATE_PENDING);
|
||||||
|
|
||||||
|
resolve->answer = ntohl(answer);
|
||||||
if(valid)
|
if(valid)
|
||||||
resolve->state = CACHE_STATE_VALID;
|
resolve->state = CACHE_STATE_VALID;
|
||||||
else
|
else
|
||||||
@ -550,7 +551,7 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
|
|||||||
|
|
||||||
while(resolve->pending_connections) {
|
while(resolve->pending_connections) {
|
||||||
pend = resolve->pending_connections;
|
pend = resolve->pending_connections;
|
||||||
pend->conn->addr = ntohl(answer);
|
pend->conn->addr = resolve->answer;
|
||||||
if(resolve->state == CACHE_STATE_FAILED || connection_exit_connect(pend->conn) < 0) {
|
if(resolve->state == CACHE_STATE_FAILED || connection_exit_connect(pend->conn) < 0) {
|
||||||
pend->conn->marked_for_close = 1;
|
pend->conn->marked_for_close = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user