From: Jim Jagielski Date: Fri, 4 May 2007 19:12:38 +0000 (+0000) Subject: Abstract out (kinda) MSG_PEEK. This way when we X-Git-Tag: 2.3.0~1818 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c8f89ea65904faa74cda76115ac1923ecd96685;p=apache Abstract out (kinda) MSG_PEEK. This way when we actually update APR and apr_socket_recvfrom() to know about APR_MSG_OOB, APR_MSG_PEEK, etc... this code won't need to be adjusted. Also, make nicer for 2.2 backport. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535354 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index fa29e8b15b..6fe94ea770 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2089,7 +2089,11 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, #define USE_ALTERNATE_IS_CONNECTED 1 -#if USE_ALTERNATE_IS_CONNECTED +#if !defined(APR_MSG_PEEK) && defined(MSG_PEEK) +#define APR_MSG_PEEK MSG_PEEK +#endif + +#if USE_ALTERNATE_IS_CONNECTED && defined(APR_MSG_PEEK) static int is_socket_connected(apr_socket_t *socket) { apr_pollfd_t pfds[1]; @@ -2114,7 +2118,7 @@ static int is_socket_connected(apr_socket_t *socket) * If there is no data available the socket * is closed. */ - status = apr_socket_recvfrom(&unused, socket, MSG_PEEK, + status = apr_socket_recvfrom(&unused, socket, APR_MSG_PEEK, &buf[0], &len); if (status == APR_SUCCESS && len) return 1;