Hopeful fix
This commit is contained in:
@ -307,11 +307,9 @@ int proxy_init(proxy_ctx_t **proxy_ptr, http_req *req, http_res *res, http_statu
|
|||||||
goto proxy;
|
goto proxy;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
if (proxy->initialized) {
|
if (proxy->initialized)
|
||||||
info(BLUE_STR "Closing proxy connection");
|
proxy_close(proxy);
|
||||||
sock_close(&proxy->proxy);
|
|
||||||
proxy->initialized = 0;
|
|
||||||
}
|
|
||||||
retry = 0;
|
retry = 0;
|
||||||
tries++;
|
tries++;
|
||||||
|
|
||||||
@ -323,7 +321,7 @@ int proxy_init(proxy_ctx_t **proxy_ptr, http_req *req, http_res *res, http_statu
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sock_set_timeout(&proxy->proxy, SERVER_TIMEOUT_INIT) != 0)
|
if (sock_set_socket_timeout(&proxy->proxy, 1) != 0 || sock_set_timeout(&proxy->proxy, SERVER_TIMEOUT_INIT) != 0)
|
||||||
goto proxy_timeout_err;
|
goto proxy_timeout_err;
|
||||||
|
|
||||||
struct hostent *host_ent = gethostbyname2(conf->proxy.hostname, AF_INET6);
|
struct hostent *host_ent = gethostbyname2(conf->proxy.hostname, AF_INET6);
|
||||||
@ -383,6 +381,7 @@ int proxy_init(proxy_ctx_t **proxy_ptr, http_req *req, http_res *res, http_statu
|
|||||||
ret = SSL_do_handshake(proxy->proxy.ssl);
|
ret = SSL_do_handshake(proxy->proxy.ssl);
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
error_ssl(SSL_get_error(proxy->proxy.ssl, (int) ret));
|
error_ssl(SSL_get_error(proxy->proxy.ssl, (int) ret));
|
||||||
|
SSL_free(proxy->proxy.ssl);
|
||||||
res->status = http_get_status(502);
|
res->status = http_get_status(502);
|
||||||
ctx->origin = SERVER_REQ;
|
ctx->origin = SERVER_REQ;
|
||||||
error("Unable to perform handshake");
|
error("Unable to perform handshake");
|
||||||
|
@ -202,7 +202,7 @@ static void terminate_gracefully(int sig) {
|
|||||||
workers_destroy();
|
workers_destroy();
|
||||||
|
|
||||||
while (list_size(clients) > 0)
|
while (list_size(clients) > 0)
|
||||||
server_free_client(clients[0]);
|
tcp_close(clients[0]);
|
||||||
|
|
||||||
proxy_close_all();
|
proxy_close_all();
|
||||||
logger_set_prefix("");
|
logger_set_prefix("");
|
||||||
|
Reference in New Issue
Block a user