From 6bb7d0cf86ba4220bc81dd475077ecb6e652a8c9 Mon Sep 17 00:00:00 2001 From: Eric Faurot Date: Sat, 26 Mar 2011 14:38:15 +0000 Subject: 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@ --- usr.sbin/smtpd/asr.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'usr.sbin/smtpd/asr.h') 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 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; -- cgit v1.2.3