On the fix-authn-errors branch:
* outgoing.c
(handle_response): Improve the code comments.
git-svn-id: https://svn.apache.org/repos/asf/serf/branches/fix-authn-errors@1700007 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/outgoing.c b/outgoing.c
index 419e273..65c992a 100644
--- a/outgoing.c
+++ b/outgoing.c
@@ -1025,9 +1025,11 @@
if (SERF_BUCKET_READ_ERROR(status)) {
/* There was an error while checking the authentication headers of
- the response. Depending on the cause of the error, we need to
- inform the application in a different way.
+ the response. We need to inform the application - which
+ hasn't seen this response yet - of the error.
+ These are the possible causes of the error:
+
1. A communication error while reading the response status line,
headers or while discarding the response body: pass the
response unchanged to the application, it will see the same
@@ -1054,9 +1056,9 @@
body, so we can handle this case the same as 2.
In summary, all these cases can be handled in the same way: call
- the application's response handler with the response, but return
- error code STATUS instead of APR_EOF after reading the response
- body.
+ the application's response handler with the response bucket, but
+ make sure that the application sees error code STATUS instead of
+ APR_EOF after reading the response body.
*/
serf__bucket_response_set_error_on_eof(request->resp_bkt, status);