apr_status_t rv = APR_SUCCESS;
const char *fn = "handle_response";
int header_state = HDR_STATE_READING_HEADERS;
- int seen_end_of_headers = 0;
+ int seen_end_of_headers = 0, done = 0;
if (rspbuflen) {
orspbuflen = *rspbuflen;
ob = apr_brigade_create(r->pool, r->connection->bucket_alloc);
- while (1) { /* Keep reading FastCGI records until
- * we get AP_FCGI_END_REQUEST,
- * or an error occurs.
- */
+ while (!done && rv == APR_SUCCESS) { /* Keep reading FastCGI records until
+ * we get AP_FCGI_END_REQUEST (done)
+ * or an error occurs.
+ */
apr_size_t readbuflen;
apr_uint16_t clen;
apr_uint16_t rid;
break;
case AP_FCGI_END_REQUEST:
- /* we are done below */
+ done = 1;
break;
default:
"%d", fn, type);
break;
}
- /* Leave on above switch's inner end/error. */
- if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
+ /* Leave on above switch's inner error. */
+ if (rv != APR_SUCCESS) {
break;
}
int *bad_request, int *has_responded)
{
apr_bucket_brigade *ib, *ob;
- int seen_end_of_headers = 0, ignore_body = 0;
+ int seen_end_of_headers = 0, done = 0, ignore_body = 0;
apr_status_t rv = APR_SUCCESS;
int script_error_status = HTTP_OK;
conn_rec *c = r->connection;
ib = apr_brigade_create(r->pool, c->bucket_alloc);
ob = apr_brigade_create(r->pool, c->bucket_alloc);
- while (1) {
+ while (! done) {
apr_interval_time_t timeout;
apr_size_t len;
int n;
break;
case AP_FCGI_END_REQUEST:
- /* we are done below */
+ done = 1;
break;
default:
"Got bogus record %d", type);
break;
}
- /* Leave on above switch's inner end/error. */
- if (rv != APR_SUCCESS || type == AP_FCGI_END_REQUEST) {
+ /* Leave on above switch's inner error. */
+ if (rv != APR_SUCCESS) {
break;
}