mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-12 05:48:51 -04:00
evdns: fix a bug in circular-queue implementation
found by Wang Qin
This commit is contained in:
parent
9f9e259fda
commit
d6094b160f
5
evdns.c
5
evdns.c
@ -167,6 +167,7 @@ struct request {
|
|||||||
struct nameserver *ns; /* the server which we last sent it */
|
struct nameserver *ns; /* the server which we last sent it */
|
||||||
|
|
||||||
/* these objects are kept in a circular list */
|
/* these objects are kept in a circular list */
|
||||||
|
/* XXX We could turn this into a CIRCLEQ. */
|
||||||
struct request *next, *prev;
|
struct request *next, *prev;
|
||||||
|
|
||||||
struct event timeout_event;
|
struct event timeout_event;
|
||||||
@ -2472,9 +2473,7 @@ _evdns_nameserver_add_impl(struct evdns_base *base, const struct sockaddr *addre
|
|||||||
ns->next = base->server_head->next;
|
ns->next = base->server_head->next;
|
||||||
ns->prev = base->server_head;
|
ns->prev = base->server_head;
|
||||||
base->server_head->next = ns;
|
base->server_head->next = ns;
|
||||||
if (base->server_head->prev == base->server_head) {
|
ns->next->prev = ns;
|
||||||
base->server_head->prev = ns;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base->global_good_nameservers++;
|
base->global_good_nameservers++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user