- fd = usock_inet(USOCK_TCP | USOCK_NONBLOCK, uh->uc.url->host, port, &uh->uc.remote_addr);
+ fd = usock_inet(USOCK_TCP, uh->uc.url->host, port, &uh->uc.remote_addr);
ustream_fd_init(&uh->ufd, fd);
sl = sizeof(uh->uc.local_addr);
ustream_fd_init(&uh->ufd, fd);
sl = sizeof(uh->uc.local_addr);
uclient_http_reset_state(uh);
blob_buf_init(&uh->meta, 0);
}
uclient_http_reset_state(uh);
blob_buf_init(&uh->meta, 0);
}
static void uclient_http_headers_complete(struct uclient_http *uh)
{
enum auth_type auth_type = uh->auth_type;
static void uclient_http_headers_complete(struct uclient_http *uh)
{
enum auth_type auth_type = uh->auth_type;
if (auth_type == AUTH_TYPE_UNKNOWN && uh->uc.status_code == 401 &&
(uh->req_type == REQ_HEAD || uh->req_type == REQ_GET)) {
if (auth_type == AUTH_TYPE_UNKNOWN && uh->uc.status_code == 401 &&
(uh->req_type == REQ_HEAD || uh->req_type == REQ_GET)) {
{
struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
struct blobmsg_policy location = {
{
struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
struct blobmsg_policy location = {
.connect = uclient_http_connect,
.disconnect = uclient_http_request_disconnect,
.update_url = uclient_http_free_url_state,
.connect = uclient_http_connect,
.disconnect = uclient_http_request_disconnect,
.update_url = uclient_http_free_url_state,
.read = uclient_http_read,
.write = uclient_http_send_data,
.read = uclient_http_read,
.write = uclient_http_send_data,