[__PREFIX_MAX] = NULL
};
+static int uclient_http_connect(struct uclient *cl);
+
static int uclient_do_connect(struct uclient_http *uh, const char *port)
{
socklen_t sl;
if (auth_type == AUTH_TYPE_UNKNOWN && uh->uc.status_code == 401 &&
(uh->req_type == REQ_HEAD || uh->req_type == REQ_GET)) {
- uclient_http_init_request(uh);
+ uclient_http_connect(&uh->uc);
uclient_http_send_headers(uh);
uh->state = HTTP_STATE_REQUEST_DONE;
return;
struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
int ret;
- if (!cl->eof || uh->disconnect)
+ if (!cl->eof || uh->disconnect || uh->connection_close)
uclient_http_disconnect(uh);
uclient_http_init_request(uh);