Author: rhuijben
Date: Wed Nov 4 01:19:55 2015
New Revision: 1712453
URL: http://svn.apache.org/viewvc?rev=1712453&view=rev
Log:
Fix several cases where we checked for APR_EAGAIN instead of
APR_STATUS_IS_EAGAIN, where this last one doesn't work for socket errors
on Windows.
This caused the MockHTTP_server to never generate WANT_READ errors on
Windows, while it did produce them on all our other buildbots.
* buckets/aggregate_buckets.c
(serf_aggregate_peek): Use proper check for EAGAIN.
* test/MockHTTPinC/MockHTTP.c
(mhRunServerLoopCompleteRequests): Use proper check for EAGAIN.
* test/MockHTTPinC/MockHTTP_server.c
(processServer,
bio_apr_socket_read): Use proper check for EAGAIN.
* test/mock_buckets.c
(serf_bucket_mock_more_data_arrived): Fix check.
Modified:
serf/trunk/buckets/aggregate_buckets.c
serf/trunk/test/MockHTTPinC/MockHTTP.c
serf/trunk/test/MockHTTPinC/MockHTTP_server.c
serf/trunk/test/mock_buckets.c
Modified: serf/trunk/buckets/aggregate_buckets.c
URL:
http://svn.apache.org/viewvc/serf/trunk/buckets/aggregate_buckets.c?rev=1712453&r1=1712452&r2=1712453&view=diff
==============================================================================
--- serf/trunk/buckets/aggregate_buckets.c (original)
+++ serf/trunk/buckets/aggregate_buckets.c Wed Nov 4 01:19:55 2015
@@ -440,7 +440,7 @@ static apr_status_t serf_aggregate_peek(
*len = 0;
if (ctx->hold_open) {
status = ctx->hold_open(ctx->hold_open_baton, bucket);
- if (status == APR_EAGAIN)
+ if (APR_STATUS_IS_EAGAIN(status))
status = APR_SUCCESS;
return status;
}
@@ -459,7 +459,7 @@ static apr_status_t serf_aggregate_peek(
} else {
if (ctx->hold_open) {
status = ctx->hold_open(ctx->hold_open_baton, bucket);
- if (status == APR_EAGAIN)
+ if (APR_STATUS_IS_EAGAIN(status))
status = APR_SUCCESS;
return status;
}
Modified: serf/trunk/test/MockHTTPinC/MockHTTP.c
URL:
http://svn.apache.org/viewvc/serf/trunk/test/MockHTTPinC/MockHTTP.c?rev=1712453&r1=1712452&r2=1712453&view=diff
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP.c (original)
+++ serf/trunk/test/MockHTTPinC/MockHTTP.c Wed Nov 4 01:19:55 2015
@@ -180,7 +180,7 @@ mhError_t mhRunServerLoopCompleteRequest
break;
};
- if (status == APR_EAGAIN)
+ if (APR_STATUS_IS_EAGAIN(status))
return MOCKHTTP_TIMEOUT;
return status;
Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c
URL:
http://svn.apache.org/viewvc/serf/trunk/test/MockHTTPinC/MockHTTP_server.c?rev=1712453&r1=1712452&r2=1712453&view=diff
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP_server.c (original)
+++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c Wed Nov 4 01:19:55 2015
@@ -1403,7 +1403,7 @@ static apr_status_t processServer(mhServ
cctx->req = NULL;
return APR_SUCCESS;
- } else if (status == APR_SUCCESS || status == APR_EAGAIN) {
+ } else if (status == APR_SUCCESS || APR_STATUS_IS_EAGAIN(status)) {
ctx->reqState = PartialReqReceived;
}
@@ -2314,11 +2314,11 @@ static int bio_apr_socket_read(BIO *bio,
status = apr_socket_recv(cctx->skt, in, &len);
ssl_ctx->bio_status = status;
- if (len || status != APR_EAGAIN)
+ if (len || APR_STATUS_IS_EAGAIN(status))
_mhLog(MH_VERBOSE, cctx->skt, "Read %d bytes from ssl socket with "
"status %d.\n", len, status);
- if (status == APR_EAGAIN) {
+ if (APR_STATUS_IS_EAGAIN(status)) {
BIO_set_retry_read(bio);
if (len == 0)
return -1;
Modified: serf/trunk/test/mock_buckets.c
URL:
http://svn.apache.org/viewvc/serf/trunk/test/mock_buckets.c?rev=1712453&r1=1712452&r2=1712453&view=diff
==============================================================================
--- serf/trunk/test/mock_buckets.c (original)
+++ serf/trunk/test/mock_buckets.c Wed Nov 4 01:19:55 2015
@@ -181,7 +181,7 @@ apr_status_t serf_bucket_mock_more_data_
return status;
action = &ctx->actions[ctx->current_action];
- if (ctx->remaining_data == 0 && action->status == APR_EAGAIN) {
+ if (ctx->remaining_data == 0 && APR_STATUS_IS_EAGAIN(action->status)) {
ctx->remaining_times--;
action->times--;
}