worker->s->status |= PROXY_WORKER_IN_ERROR;
}
}
- else if (access_status == PROXY_BACKEND_BROKEN) {
- /*
- * If the backend broke after the headers had been sent do not
- * try another worker, but leave. Do not mark the worker as
- * unsuable as this problem may not reoccur on the next request.
- *
- * TODO: Currently we abort the connection and notify all parties
- * on the upstream that something went wrong by setting c->aborted
- * to 1. This idea is currently vetoed and should be replaced with
- * other methods
- */
- r->connection->aborted = 1;
- break;
- }
else {
/* Unrecoverable error.
* Return the origin status code to the client.
proxy_conn_rec *conn; /* Single connection for prefork mpm's */
};
-/*
- * Return code that scheme handlers should return if the backend connection
- * broke after they have sent the headers
- */
-#define PROXY_BACKEND_BROKEN -10
-
/* woker status flags */
#define PROXY_WORKER_INITIALIZED 0x0001
#define PROXY_WORKER_IGNORE_ERRORS 0x0002
int havebody = 1;
int isok = 1;
apr_off_t bb_len;
- int data_sent = 0;
#ifdef FLUSHING_BANDAID
apr_int32_t conn_poll_fd;
apr_pollfd_t *conn_poll;
"proxy: error processing body");
isok = 0;
}
- /* memorize that we sent data */
- data_sent = 1;
apr_brigade_cleanup(output_brigade);
}
else {
"proxy: error processing body");
isok = 0;
}
- /* memorize that we sent data */
- data_sent = 1;
break;
default:
isok = 0;
"proxy: send body failed to %pI (%s)",
conn->worker->cp->addr,
conn->worker->hostname);
- /*
- * If we have sent data (and thus the headers) we must let the
- * others know.
- */
- if (data_sent) {
- return PROXY_BACKEND_BROKEN;
- } else {
- return HTTP_SERVICE_UNAVAILABLE;
- }
+ return HTTP_SERVICE_UNAVAILABLE;
}
/* Nice we have answer to send to the client */
* are being read. */
int pread_len = 0;
apr_table_t *save_table;
- int backend_broken = 0;
bb = apr_brigade_create(p, c->bucket_alloc);
*/
ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c,
"proxy: error reading response");
- backend_broken = 1;
+ c->aborted = 1;
break;
}
/* next time try a non-blocking read */
}
} while (interim_response);
- /* Signal back that the backend broke after we sent the headers. */
- if (backend_broken) {
- return PROXY_BACKEND_BROKEN;
+ /* If our connection with the client is to be aborted, return DONE. */
+ if (c->aborted) {
+ return DONE;
}
if (conf->error_override) {