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:
wenyg 2019-05-30 17:38:49 +08:00 committed by Azat Khuzhin
parent c03dabd76a
commit 891dd1880f
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -53,7 +53,7 @@ http_request_done(struct evhttp_request *req, void *ctx)
char buffer[256];
int nread;
if (req == NULL) {
if (!req || !evhttp_request_get_response_code(req)) {
/* If req is NULL, it means an error occurred, but
* sadly we are mostly left guessing what the error
* might have been. We'll do our best... */