mirror of
https://github.com/curl/curl.git
synced 2024-12-27 06:59:43 +08:00
parent
06e2fa2b51
commit
850f6c79e8
@ -416,14 +416,26 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
|
||||
size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf));
|
||||
hyper_code code = hyper_error_code(hypererr);
|
||||
failf(data, "Hyper: [%d] %.*s", (int)code, (int)errlen, errbuf);
|
||||
if(code == HYPERE_ABORTED_BY_CALLBACK)
|
||||
switch(code) {
|
||||
case HYPERE_ABORTED_BY_CALLBACK:
|
||||
result = CURLE_OK;
|
||||
else if((code == HYPERE_UNEXPECTED_EOF) && !data->req.bytecount)
|
||||
result = CURLE_GOT_NOTHING;
|
||||
else if(code == HYPERE_INVALID_PEER_MESSAGE)
|
||||
break;
|
||||
case HYPERE_UNEXPECTED_EOF:
|
||||
if(!data->req.bytecount)
|
||||
result = CURLE_GOT_NOTHING;
|
||||
else
|
||||
result = CURLE_RECV_ERROR;
|
||||
break;
|
||||
case HYPERE_INVALID_PEER_MESSAGE:
|
||||
/* bump headerbytecount to avoid the count remaining at zero and
|
||||
appearing to not having read anything from the peer at all */
|
||||
data->req.headerbytecount++;
|
||||
result = CURLE_UNSUPPORTED_PROTOCOL; /* maybe */
|
||||
else
|
||||
break;
|
||||
default:
|
||||
result = CURLE_RECV_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*done = TRUE;
|
||||
hyper_error_free(hypererr);
|
||||
|
Loading…
Reference in New Issue
Block a user