int ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
int ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
int ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
-int ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r);
+apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r);
int ap_proxy_garbage_init(server_rec *, apr_pool_t *);
/* This function is called by ap_table_do() for all header lines */
int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
return host != NULL && ap_strstr_c(host, This->name) != NULL;
}
-int ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r)
+apr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r)
{
+ apr_status_t rv;
int i;
for (i = 0; host[i] != '\0'; i++)
apr_set_ipaddr(sock, APR_REMOTE, host);
host = NULL;
}
- for(;;)
+
+ do
{
- apr_status_t rv = apr_connect(sock, host);
- if (APR_STATUS_IS_EINTR(rv))
- continue;
- else if (rv == APR_SUCCESS)
- return 0;
- else {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "proxy connect to %s port %d failed", host, port);
- return -1;
- }
+ rv = apr_connect(sock, host);
+ } while (APR_STATUS_IS_EINTR(rv));
+
+ if (rv != APR_SUCCESS)
+ {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "proxy connect to %s port %d failed", host, port);
}
- return -1;
+ return rv;
}
/* This function is called by ap_table_do() for all header lines */