"error on %s - ap_pass_brigade",
name);
}
- } else if (!APR_STATUS_IS_EAGAIN(rv)) {
+ } else if (!APR_STATUS_IS_EAGAIN(rv) && !APR_STATUS_IS_EOF(rv)) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO()
"error on %s - ap_get_brigade",
name);
return HTTP_INTERNAL_SERVER_ERROR;
}
+ apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1);
+ apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1);
+ apr_socket_opt_set(client_socket, APR_SO_NONBLOCK, 1);
+ apr_socket_opt_set(client_socket, APR_SO_KEEPALIVE, 1);
+
pollfd.p = p;
pollfd.desc_type = APR_POLL_SOCKET;
pollfd.reqevents = APR_POLLIN;
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO() "error apr_poll()");
return HTTP_INTERNAL_SERVER_ERROR;
}
-#ifdef DEBUGGING
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
"woke from poll(), i=%d", pollcnt);
-#endif
for (pi = 0; pi < pollcnt; pi++) {
const apr_pollfd_t *cur = &signalled[pi];
if (cur->desc.s == sock) {
pollevent = cur->rtnevents;
if (pollevent & APR_POLLIN) {
-#ifdef DEBUGGING
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
"sock was readable");
-#endif
rv = proxy_websocket_transfer(r, backconn, c, bb, "sock");
}
else if ((pollevent & APR_POLLERR)
else if (cur->desc.s == client_socket) {
pollevent = cur->rtnevents;
if (pollevent & APR_POLLIN) {
-#ifdef DEBUGGING
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
"client was readable");
-#endif
rv = proxy_websocket_transfer(r, c, backconn, bb, "client");
}
}
NULL, /* command apr_table_t */
ap_proxy_http_register_hook /* register hooks */
};
-