Index: outgoing.c =================================================================== --- outgoing.c (revision 1660) +++ outgoing.c (working copy) @@ -900,6 +900,7 @@ apr_status_t status; apr_pool_t *tmppool; int close_connection = FALSE; + int i; /* Whatever is coming in on the socket corresponds to the first request * on our chain. @@ -912,7 +913,7 @@ goto error; /* Invoke response handlers until we have no more work. */ - while (1) { + for(i = 0; ; i++) { serf_bucket_t *dummy1, *dummy2; apr_pool_clear(tmppool); @@ -1009,7 +1010,15 @@ /* If we received APR_SUCCESS, run this loop again. */ if (!status) { - continue; + if (i > 4) + { + status = APR_EAGAIN; + goto error; + } + else + { + continue; + } } close_connection = is_conn_closing(request->resp_bkt);