mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* Do better checking of pollset operations in various places to avoid segfaults.
PR: 46467 Submitted by: Stefan Fritsch <sf sfritsch.de> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@804764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -268,7 +268,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
||||
if ((rv = apr_pollset_create(&pollset, 2, r->pool, 0)) != APR_SUCCESS) {
|
||||
apr_socket_close(sock);
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||
"proxy: CONNECT: error apr_pollset_create()");
|
||||
"proxy: CONNECT: error apr_pollset_create();"
|
||||
" check system or user limits");
|
||||
return HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
||||
@@ -278,11 +279,23 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
||||
pollfd.reqevents = APR_POLLIN;
|
||||
pollfd.desc.s = client_socket;
|
||||
pollfd.client_data = NULL;
|
||||
apr_pollset_add(pollset, &pollfd);
|
||||
rv = apr_pollset_add(pollset, &pollfd);
|
||||
if (rv != APR_SUCCESS) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||
"proxy: CONNECT: error apr_pollset_add();"
|
||||
" check system or user limits");
|
||||
return HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
||||
/* Add the server side to the poll */
|
||||
pollfd.desc.s = sock;
|
||||
apr_pollset_add(pollset, &pollfd);
|
||||
rv = apr_pollset_add(pollset, &pollfd);
|
||||
if (rv != APR_SUCCESS) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||
"proxy: CONNECT: error apr_pollset_add();"
|
||||
" check system or user limits");
|
||||
return HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
||||
while (1) { /* Infinite loop until error (one side closes the connection) */
|
||||
if ((rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled)) != APR_SUCCESS) {
|
||||
|
Reference in New Issue
Block a user