diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-03-26 14:38:15 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-03-26 14:38:15 +0000 |
commit | 6bb7d0cf86ba4220bc81dd475077ecb6e652a8c9 (patch) | |
tree | 14a76a5c44cd5221ed73044679098036d1902314 /usr.sbin/smtpd/asr.h | |
parent | 1486fccbeeb5a88ef9e406739f3934b8e9084b71 (diff) |
Tweak the asr API to make things a bit smoother on the user side.
Then asr_run() call now returns ASR_COND when a condition on a FD is
expected. The exact condition (readable or writeable) is specified in
the asr_result structure, along with the fd and timeout.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/asr.h')
-rw-r--r-- | usr.sbin/smtpd/asr.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/asr.h b/usr.sbin/smtpd/asr.h index 142e8124cea..d46ad7f0344 100644 --- a/usr.sbin/smtpd/asr.h +++ b/usr.sbin/smtpd/asr.h @@ -21,12 +21,14 @@ #include <netinet/in.h> enum { - ASR_NEED_READ, - ASR_NEED_WRITE, + ASR_COND, ASR_YIELD, ASR_DONE }; +#define ASR_READ 0x01 +#define ASR_WRITE 0x02 + #define ASR_NOREC 0x01 enum { @@ -41,10 +43,13 @@ enum { }; struct asr_result { - int ar_fd; - int ar_timeout; int ar_err; const char *ar_errstr; + + int ar_cond; + int ar_fd; + int ar_timeout; + int ar_count; struct addrinfo *ar_ai; char *ar_cname; |