diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-12-28 23:12:18 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-12-28 23:12:18 +0000 |
commit | af39ed8edb53195eb3e533c0ce9ef9067d5b7737 (patch) | |
tree | c64cd0a69174b4cd2a6f4a3d44560dcd0085155c /macros | |
parent | 8f550276e15dc6ea3b682198dd0f5853e8348125 (diff) | |
download | neon-af39ed8edb53195eb3e533c0ce9ef9067d5b7737.tar.gz |
Add support for configurable socket connect timeouts:
* src/ne_socket.h (ne_sock_connect_timeout): New function.
(ne_sock_connect): Clarify timeout handling.
* src/ne_socket.c: Define USE_NONBLOCKING_CONNECT if appropriate.
Define NE_ISINPROGRESS.
(struct ne_socket_s): Add cotimeout field.
(timed_connect): New function.
(connect_socket): Renamed from raw_connect; use timed_connect; takes
socket structure and sets ->error string on failure.
(ne_sock_connect): Adapt to use connect_socket.
(ne_sock_connect_timeout): New function.
* src/ne_private.h (struct ne_session_s): Add cotimeout field.
* src/ne_session.h (ne_set_connect_timeout): New prototype...
* src/ne_session.c (ne_set_connect_timeout): ...implement it.
* src/ne_request.c (do_connect): Set socket timeout if appropriate.
* macros/neon.m4 (LIBNEON_SOURCE_CHECKS): Check for fcntl, getsockopt,
fcntl.h and socklen_t.
* test/socket.c (connect_timeout): Add test (disabled by default).
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1119 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'macros')
-rw-r--r-- | macros/neon.m4 | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/macros/neon.m4 b/macros/neon.m4 index 4436ea9..325d8a2 100644 --- a/macros/neon.m4 +++ b/macros/neon.m4 @@ -576,7 +576,7 @@ AC_REQUIRE([AC_FUNC_STRERROR_R]) AC_CHECK_HEADERS([sys/time.h limits.h sys/select.h arpa/inet.h libintl.h \ signal.h sys/socket.h netinet/in.h netinet/tcp.h netdb.h sys/poll.h \ - sys/limits.h],,, + sys/limits.h fcntl.h],,, [AC_INCLUDES_DEFAULT /* netinet/tcp.h requires netinet/in.h on some platforms. */ #ifdef HAVE_NETINET_IN_H @@ -600,7 +600,7 @@ NE_LARGEFILE AC_REPLACE_FUNCS(strcasecmp) -AC_CHECK_FUNCS(signal setvbuf setsockopt stpcpy poll) +AC_CHECK_FUNCS(signal setvbuf setsockopt stpcpy poll fcntl getsockopt) if test "x${ac_cv_func_poll}${ac_cv_header_sys_poll_h}y" = "xyesyesy"; then AC_DEFINE([NE_USE_POLL], 1, [Define if poll() should be used]) @@ -667,6 +667,15 @@ else ]) fi +AC_CHECK_TYPES(socklen_t,,,[ +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif +]) + AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,, [#include <time.h>]) |