Skip to content

Commit

Permalink
net: lib: http_server: Remove POSIX_API dependency
Browse files Browse the repository at this point in the history
There is no need to depend on CONFIG_POSIX_API because the
HTTP server is an network internal library.
Cleanup remaining POSIX configs left from earlier commits.

Signed-off-by: Jukka Rissanen <[email protected]>
  • Loading branch information
jukkar authored and rlubos committed Apr 17, 2024
1 parent 839d8bb commit 74f9f1d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion subsys/net/lib/http/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ config HTTP_SERVER
select HTTP_PARSER
select HTTP_PARSER_URL
select EXPERIMENTAL
select POSIX_API
help
HTTP1 and HTTP2 server support.

Expand Down
2 changes: 1 addition & 1 deletion subsys/net/lib/http/http_server_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int accept_new_client(int server_fd)

static int close_all_sockets(struct http_server_ctx *ctx)
{
close(ctx->fds[0].fd); /* close eventfd */
zsock_close(ctx->fds[0].fd); /* close eventfd */
ctx->fds[0].fd = -1;

for (int i = 1; i < ARRAY_SIZE(ctx->fds); i++) {
Expand Down
1 change: 0 additions & 1 deletion tests/net/lib/http_server/common/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ CONFIG_HTTP_SERVER=y

# Networking config
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
2 changes: 1 addition & 1 deletion tests/net/lib/http_server/tls/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void test_tls(void)
ptr = (char *)zsock_inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf));
zassert_not_equal(ptr, NULL, "inet_ntop() failed (%d)", errno);

ret = connect(client_fd, (struct sockaddr *)&sa, sizeof(sa));
ret = zsock_connect(client_fd, (struct sockaddr *)&sa, sizeof(sa));
zassert_not_equal(ret, -1, "failed to connect (%d)", errno);

ret = zsock_send(client_fd, http1_request, sizeof(http1_request) - 1, 0);
Expand Down

0 comments on commit 74f9f1d

Please sign in to comment.