chiark
/
gitweb
/
~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove __checkqueues; improve some comments.
[adns]
/
src
/
event.c
diff --git
a/src/event.c
b/src/event.c
index b2da291e0856ee77669393638b8dd1c409ca6573..e3f72a409c731e37b192007f60afe2cc868a29b4 100644
(file)
--- a/
src/event.c
+++ b/
src/event.c
@@
-183,7
+183,12
@@
void adns__timeouts(adns_state ads, int act,
if (!tv_io) continue;
inter_maxtoabs(tv_io,tvbuf,now,qu->timeout);
} else {
if (!tv_io) continue;
inter_maxtoabs(tv_io,tvbuf,now,qu->timeout);
} else {
- if (!act) continue;
+ if (!act) {
+ tvbuf->tv_sec= 0;
+ tvbuf->tv_usec= 0;
+ *tv_io= tvbuf;
+ return;
+ }
LIST_UNLINK(ads->timew,qu);
if (qu->state != query_tosend) {
adns__query_fail(qu,adns_s_timeout);
LIST_UNLINK(ads->timew,qu);
if (qu->state != query_tosend) {
adns__query_fail(qu,adns_s_timeout);
@@
-565,8
+570,13
@@
int adns__internal_check(adns_state ads,
qu= *query_io;
if (!qu) {
qu= *query_io;
if (!qu) {
- if (!ads->output.head) return EAGAIN;
- qu= ads->output.head;
+ if (ads->output.head) {
+ qu= ads->output.head;
+ } else if (ads->timew.head) {
+ return EAGAIN;
+ } else {
+ return ESRCH;
+ }
} else {
if (qu->id>=0) return EAGAIN;
}
} else {
if (qu->id>=0) return EAGAIN;
}