diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-06-22 17:42:29 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-06-22 17:42:29 +0000 |
commit | be04210180b32320e0e150eed01dc6679b5dca3f (patch) | |
tree | 861a4212d90c2d4a9c88c5fe44d91e42c62c953a /network_io | |
parent | 4995c86425921dca3b62238a909fd24dc1f05ae2 (diff) | |
download | libapr-be04210180b32320e0e150eed01dc6679b5dca3f.tar.gz |
Implement retrieval of socket timeouts for Unix so that saferead() can
restore the original timeout on exit.
This is very similar to the Win32 implementation Bill Stoddard a week ago.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sockopt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index e0d3c9796..a24df943f 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -172,6 +172,18 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +{ + switch(opt) { + case APR_SO_TIMEOUT: + *on = sock->timeout; + break; + default: + return APR_EINVAL; + } + return APR_SUCCESS; +} + ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) { if (gethostname(buf, len) == -1) |