summaryrefslogtreecommitdiff
path: root/bufferevent-internal.h
diff options
context:
space:
mode:
authorAzat Khuzhin <a3at.mail@gmail.com>2016-03-21 17:09:17 +0300
committerAzat Khuzhin <a3at.mail@gmail.com>2016-03-23 12:51:44 +0300
commit86dfd2ced1985ba7b2a2d4f48f2dc5d7a07ce0ab (patch)
tree2cb5ee33dc0e19db0f3ad769e8604a7f5b0b7d02 /bufferevent-internal.h
parent8cbe65d5f44246ad3f7ab408d22e797e5b9e5b81 (diff)
downloadlibevent-86dfd2ced1985ba7b2a2d4f48f2dc5d7a07ce0ab.tar.gz
be_sock: cancel in-progress dns requests
Before this patch we didn't have such functionality and this can cause some issues when we are cancelling HTTP request while after this we will get a response/timeout from the NS and in this case error_cb will be called and can damage newly started HTTP request. We could also have problems with connect, but we don't have them since we closes the fd in HTTP layer. This is not so good that this is done in be_sock, but it is internal, so we can change without pain. Plus I don't like that callback-via-evutil, but since we have event_extra we need do like that. And after this patch the following tests doesn't report leaks: $ valgrind --leak-check=full --show-reachable=yes --track-fds=yes --error-exitcode=1 regress --no-fork http/cancel.. ... ==10469== FILE DESCRIPTORS: 2309 open at exit. ... ==10469== HEAP SUMMARY: ==10469== in use at exit: 0 bytes in 0 blocks ==10469== total heap usage: 33,846 allocs, 33,846 frees, 4,617,651 bytes allocated ==10469== ==10469== All heap blocks were freed -- no leaks are possible v2: do under lock v3: reset dns request v4: ignore EVUTIL_EAI_CANCEL in regular callback
Diffstat (limited to 'bufferevent-internal.h')
-rw-r--r--bufferevent-internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/bufferevent-internal.h b/bufferevent-internal.h
index d9d9e666..9960aefa 100644
--- a/bufferevent-internal.h
+++ b/bufferevent-internal.h
@@ -228,6 +228,8 @@ struct bufferevent_private {
struct sockaddr_in6 in6;
struct sockaddr_in in;
} conn_address;
+
+ struct evdns_getaddrinfo_request *dns_request;
};
/** Possible operations for a control callback. */