mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
https-client: correction error checking
When connecting to a non-existent HTTPS service, the "req" is not null but the "evhttp_request_get_response_code(req)" is zero. Closes: #822 (cherry-picked)
This commit is contained in:
parent
c03dabd76a
commit
891dd1880f
@ -53,7 +53,7 @@ http_request_done(struct evhttp_request *req, void *ctx)
|
|||||||
char buffer[256];
|
char buffer[256];
|
||||||
int nread;
|
int nread;
|
||||||
|
|
||||||
if (req == NULL) {
|
if (!req || !evhttp_request_get_response_code(req)) {
|
||||||
/* If req is NULL, it means an error occurred, but
|
/* If req is NULL, it means an error occurred, but
|
||||||
* sadly we are mostly left guessing what the error
|
* sadly we are mostly left guessing what the error
|
||||||
* might have been. We'll do our best... */
|
* might have been. We'll do our best... */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user