mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
test/bench_httpclient: restore SO_LINGER usage after 0dda56a48e94
This commit is contained in:
parent
7bc822cad9
commit
d9118c8daa
@ -715,8 +715,7 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s
|
||||
#endif
|
||||
])
|
||||
|
||||
AC_CHECK_TYPES([struct so_linger],
|
||||
[#define HAVE_SO_LINGER], ,
|
||||
AC_CHECK_TYPES([struct linger],,,
|
||||
[
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
|
@ -113,13 +113,13 @@ errorcb(struct bufferevent *b, short what, void *arg)
|
||||
static void
|
||||
frob_socket(evutil_socket_t sock)
|
||||
{
|
||||
#ifdef HAVE_SO_LINGER
|
||||
#ifdef EVENT__HAVE_STRUCT_LINGER
|
||||
struct linger l;
|
||||
#endif
|
||||
int one = 1;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
|
||||
perror("setsockopt(SO_REUSEADDR)");
|
||||
#ifdef HAVE_SO_LINGER
|
||||
#ifdef EVENT__HAVE_STRUCT_LINGER
|
||||
l.l_onoff = 1;
|
||||
l.l_linger = 0;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user