[trivial] use err from socket layer
@@ -363,7 +363,6 @@ static void on_handshake_complete(h2o_socket_t *sock, const char *err)
static void on_connect(h2o_socket_t *sock, const char *err)
{
h2o_socketpool_connect_request_t *req = sock->data;
- const char *errstr = NULL;
assert(req->sock == sock);
@@ -376,7 +375,6 @@ static void on_connect(h2o_socket_t *sock, const char *err)
}
__sync_sub_and_fetch(&req->pool->_shared.count, 1);
req->sock = NULL;
- errstr = "connection failed"; /* shouldn't we return err? */
} else {
h2o_url_t *target_url = &req->pool->targets.entries[req->selected_target]->url;
if (target_url->scheme->is_ssl) {
@@ -386,7 +384,7 @@ static void on_connect(h2o_socket_t *sock, const char *err)
}
}
- call_connect_cb(req, errstr);
+ call_connect_cb(req, err);
}
static void on_close(void *data)
@@ -410,7 +408,7 @@ static void start_connect(h2o_socketpool_connect_request_t *req, struct sockaddr
return;
}
__sync_sub_and_fetch(&req->pool->_shared.count, 1);
- call_connect_cb(req, "failed to connect to host");
+ call_connect_cb(req, h2o_socket_error_conn_fail);
return;
}
close_data = h2o_mem_alloc(sizeof(*close_data));
