mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
Define symbolic constants to use in place of SHUT_RD etc
This commit is contained in:
parent
e0fd87085d
commit
145f221e8f
4
http.c
4
http.c
@ -976,7 +976,7 @@ evhttp_connection_free(struct evhttp_connection *evcon)
|
|||||||
bufferevent_free(evcon->bufev);
|
bufferevent_free(evcon->bufev);
|
||||||
|
|
||||||
if (evcon->fd != -1) {
|
if (evcon->fd != -1) {
|
||||||
shutdown(evcon->fd, 1);
|
shutdown(evcon->fd, EVUTIL_SHUT_WR);
|
||||||
evutil_closesocket(evcon->fd);
|
evutil_closesocket(evcon->fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1044,7 +1044,7 @@ evhttp_connection_reset(struct evhttp_connection *evcon)
|
|||||||
if (evhttp_connected(evcon) && evcon->closecb != NULL)
|
if (evhttp_connected(evcon) && evcon->closecb != NULL)
|
||||||
(*evcon->closecb)(evcon, evcon->closecb_arg);
|
(*evcon->closecb)(evcon, evcon->closecb_arg);
|
||||||
|
|
||||||
shutdown(evcon->fd, 1);
|
shutdown(evcon->fd, EVUTIL_SHUT_WR);
|
||||||
evutil_closesocket(evcon->fd);
|
evutil_closesocket(evcon->fd);
|
||||||
evcon->fd = -1;
|
evcon->fd = -1;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,23 @@ extern "C" {
|
|||||||
#define socklen_t _EVENT_socklen_t
|
#define socklen_t _EVENT_socklen_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Arguments for shutdown() */
|
||||||
|
#ifdef SHUT_RD
|
||||||
|
#define EVUTIL_SHUT_RD SHUT_RD
|
||||||
|
#else
|
||||||
|
#define EVUTIL_SHUT_RD 0
|
||||||
|
#endif
|
||||||
|
#ifdef SHUT_WR
|
||||||
|
#define EVUTIL_SHUT_WR SHUT_WR
|
||||||
|
#else
|
||||||
|
#define EVUTIL_SHUT_WR 1
|
||||||
|
#endif
|
||||||
|
#ifdef SHUT_BOTH
|
||||||
|
#define EVUTIL_SHUT_BOTH SHUT_BOTH
|
||||||
|
#else
|
||||||
|
#define EVUTIL_SHUT_BOTH 2
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Locale-independent replacements for some ctypes functions. Use these
|
/* Locale-independent replacements for some ctypes functions. Use these
|
||||||
* when you care about ASCII's notion of character types, because you are about
|
* when you care about ASCII's notion of character types, because you are about
|
||||||
* to send those types onto the wire.
|
* to send those types onto the wire.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user