Skip to content

Commit a8b7caa

Browse files
benediktibkcfriedt
authored andcommitted
net: http: switch to zsock_ for http_client
Using zsock_ in http_client instead of the POSIX API versions of the functions allows the usage of http_client in combination with CONFIG_POSIX_API. Signed-off-by: Benedikt Schmidt <[email protected]>
1 parent 23c0e16 commit a8b7caa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subsys/net/lib/http/http_client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(net_http, CONFIG_NET_HTTP_LOG_LEVEL);
3232
static ssize_t sendall(int sock, const void *buf, size_t len)
3333
{
3434
while (len) {
35-
ssize_t out_len = send(sock, buf, len, 0);
35+
ssize_t out_len = zsock_send(sock, buf, len, 0);
3636

3737
if (out_len < 0) {
3838
return -errno;
@@ -415,7 +415,7 @@ static int http_wait_data(int sock, struct http_request *req)
415415
int received, ret;
416416

417417
do {
418-
received = recv(sock, req->internal.response.recv_buf + offset,
418+
received = zsock_recv(sock, req->internal.response.recv_buf + offset,
419419
req->internal.response.recv_buf_len - offset,
420420
0);
421421
if (received == 0) {
@@ -460,7 +460,7 @@ static void http_timeout(struct k_work *work)
460460
struct http_client_internal_data *data =
461461
CONTAINER_OF(work, struct http_client_internal_data, work);
462462

463-
(void)close(data->sock);
463+
(void)zsock_close(data->sock);
464464
}
465465

466466
int http_client_req(int sock, struct http_request *req,

0 commit comments

Comments
 (0)