mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Merge remote-tracking branch 'origin/patches-2.0'
Conflicts: ChangeLog README evdns.c sample/dns-example.c
This commit is contained in:
commit
4b70286ef1
@ -285,3 +285,5 @@ Changes in version 2.1.1-alpha (4 Apr 2012)
|
||||
o event-read-fifo: Use EV_PERSIST appropriately (24dab0b)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,34 @@
|
||||
Changes in version 2.0.19-stable (?? ??? 2012)
|
||||
Changes in version 2.0.19-stable (0? May 2012)
|
||||
BUGFIXES (CORE):
|
||||
o Refactor event_persist_closure: raise and extract some common logic (bec22b4)
|
||||
o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c)
|
||||
o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40)
|
||||
|
||||
BUGFIXES (SSL):
|
||||
o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey)
|
||||
|
||||
BUGFIXES (DNS):
|
||||
o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel)
|
||||
o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel)
|
||||
o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a)
|
||||
|
||||
DOCUMENTATION FIXES:
|
||||
o Fix a typo in the bufferevent documentation (98e9119)
|
||||
o Add missing ) to changelog; spotted by rransom (4c7ee6b)
|
||||
o Fix the website URL in the readme (f775521)
|
||||
|
||||
COMPILATION FIXES:
|
||||
o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae)
|
||||
o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn)
|
||||
o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg)
|
||||
|
||||
FORWARD-COMPATIBILITY:
|
||||
o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2)
|
||||
|
||||
TESTING/DEBUGGING SUPPORT:
|
||||
o dns-example.c can now take a resolv.conf file on the commandline (6610fa5)
|
||||
o Make some evdns.c debug logs more verbose (d873d67)
|
||||
o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd)
|
||||
|
||||
|
||||
Changes in version 2.0.18-stable (22 Mar 2012)
|
||||
|
5
README
5
README
@ -109,6 +109,9 @@ fixing bugs:
|
||||
Sebastian Hahn
|
||||
Dave Hart
|
||||
Greg Hazel
|
||||
Michael Herf
|
||||
Sebastian Hahn
|
||||
Savg He
|
||||
Mark Heily
|
||||
Michael Herf
|
||||
Greg Hewgill
|
||||
@ -169,6 +172,7 @@ fixing bugs:
|
||||
Peter Rosin
|
||||
Maseeb Abdul Qadir
|
||||
Wang Qin
|
||||
Alex S
|
||||
Hanna Schroeter
|
||||
Ralf Schmitt
|
||||
Mike Smellie
|
||||
@ -194,4 +198,5 @@ fixing bugs:
|
||||
propanbutan
|
||||
mmadia
|
||||
|
||||
|
||||
If we have forgotten your name, please contact us.
|
||||
|
17
evdns.c
17
evdns.c
@ -2140,9 +2140,8 @@ evdns_server_request_get_requesting_addr(struct evdns_server_request *req_, stru
|
||||
static void
|
||||
evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
|
||||
struct request *const req = (struct request *) arg;
|
||||
#ifndef EVENT__DISABLE_THREAD_SUPPORT
|
||||
struct evdns_base *base = req->base;
|
||||
#endif
|
||||
|
||||
(void) fd;
|
||||
(void) events;
|
||||
|
||||
@ -2157,11 +2156,19 @@ evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
|
||||
|
||||
if (req->tx_count >= req->base->global_max_retransmits) {
|
||||
/* this request has failed */
|
||||
log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d",
|
||||
arg, req->tx_count);
|
||||
reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL);
|
||||
request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
|
||||
} else {
|
||||
/* retransmit it */
|
||||
struct nameserver *new_ns;
|
||||
log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d",
|
||||
arg, req->tx_count);
|
||||
(void) evtimer_del(&req->timeout_event);
|
||||
new_ns = nameserver_pick(base);
|
||||
if (new_ns)
|
||||
req->ns = new_ns;
|
||||
evdns_request_transmit(req);
|
||||
}
|
||||
EVDNS_UNLOCK(base);
|
||||
@ -2231,7 +2238,7 @@ evdns_request_transmit(struct request *req) {
|
||||
default:
|
||||
/* all ok */
|
||||
log(EVDNS_LOG_DEBUG,
|
||||
"Setting timeout for request %p", req);
|
||||
"Setting timeout for request %p, sent to nameserver %p", req, req->ns);
|
||||
if (evtimer_add(&req->timeout_event, &req->base->global_timeout) < 0) {
|
||||
log(EVDNS_LOG_WARN,
|
||||
"Error from libevent when adding timer for request %p",
|
||||
@ -2489,8 +2496,8 @@ evdns_nameserver_add_impl_(struct evdns_base *base, const struct sockaddr *addre
|
||||
goto out2;
|
||||
}
|
||||
|
||||
log(EVDNS_LOG_DEBUG, "Added nameserver %s",
|
||||
evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)));
|
||||
log(EVDNS_LOG_DEBUG, "Added nameserver %s as %p",
|
||||
evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)), ns);
|
||||
|
||||
/* insert this nameserver into the list of them */
|
||||
if (!base->server_head) {
|
||||
|
@ -145,8 +145,9 @@ main(int c, char **v) {
|
||||
int reverse = 0, servertest = 0, use_getaddrinfo = 0;
|
||||
struct event_base *event_base = NULL;
|
||||
struct evdns_base *evdns_base = NULL;
|
||||
const char *resolv_conf = NULL;
|
||||
if (c<2) {
|
||||
fprintf(stderr, "syntax: %s [-x] [-v] hostname\n", v[0]);
|
||||
fprintf(stderr, "syntax: %s [-x] [-v] [-c resolv.conf] hostname\n", v[0]);
|
||||
fprintf(stderr, "syntax: %s [-servertest]\n", v[0]);
|
||||
return 1;
|
||||
}
|
||||
@ -160,7 +161,12 @@ main(int c, char **v) {
|
||||
use_getaddrinfo = 1;
|
||||
else if (!strcmp(v[idx], "-servertest"))
|
||||
servertest = 1;
|
||||
else
|
||||
else if (!strcmp(v[idx], "-c")) {
|
||||
if (idx + 1 < c)
|
||||
resolv_conf = v[++idx];
|
||||
else
|
||||
fprintf(stderr, "-c needs an argument\n");
|
||||
} else
|
||||
fprintf(stderr, "Unknown option %s\n", v[idx]);
|
||||
++idx;
|
||||
}
|
||||
@ -197,11 +203,14 @@ main(int c, char **v) {
|
||||
if (idx < c) {
|
||||
int res;
|
||||
#ifdef _WIN32
|
||||
res = evdns_base_config_windows_nameservers(evdns_base);
|
||||
#else
|
||||
res = evdns_base_resolv_conf_parse(evdns_base, DNS_OPTION_NAMESERVERS,
|
||||
"/etc/resolv.conf");
|
||||
if (resolv_conf == NULL)
|
||||
res = evdns_base_config_windows_nameservers(evdns_base);
|
||||
else
|
||||
#endif
|
||||
res = evdns_base_resolv_conf_parse(evdns_base,
|
||||
DNS_OPTION_NAMESERVERS,
|
||||
resolv_conf ? resolv_conf : "/etc/resolv.conf");
|
||||
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Couldn't configure nameservers");
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user