Skip to content

Commit 4bd4e9c

Browse files
aidangarskedanielinux
authored andcommitted
Use existing wolfIP httpd for HTTPS server
1 parent 27c50d8 commit 4bd4e9c

7 files changed

Lines changed: 95 additions & 543 deletions

File tree

src/http/httpd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ int httpd_init(struct httpd *httpd, struct wolfIP *s, uint16_t port, void *ssl_c
501501
struct wolfIP_sockaddr_in addr;
502502
memset(&addr, 0, sizeof(addr));
503503
addr.sin_family = AF_INET;
504-
addr.sin_port = htons(port);
504+
addr.sin_port = ee16(port);
505505
if (!httpd) {
506506
return -1;
507507
}
508508
memset(httpd, 0, sizeof(struct httpd));
509509
httpd->ipstack = s;
510510
httpd->port = port;
511-
httpd->listen_sd = wolfIP_sock_socket(s, AF_INET, SOCK_STREAM, 0);
511+
httpd->listen_sd = wolfIP_sock_socket(s, AF_INET, IPSTACK_SOCK_STREAM, 0);
512512
if (httpd->listen_sd < 0) {
513513
return -1;
514514
}

src/port/stm32h563/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ SRCS += tls_server.c
6969
SRCS += tls_client.c
7070
SRCS += $(ROOT)/src/port/wolfssl_io.c
7171

72-
# HTTPS web server (requires TLS)
72+
# HTTPS web server (requires TLS) - uses existing wolfIP httpd
7373
ifeq ($(ENABLE_HTTPS),1)
7474
CFLAGS += -DENABLE_HTTPS
75-
SRCS += https_server.c
75+
SRCS += $(ROOT)/src/http/httpd.c
7676
endif
7777

7878
# wolfSSL source files (minimal set for TLS 1.3 server with ECC)

src/port/stm32h563/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define ETHERNET
2929
#define LINK_MTU 1536
3030

31-
#define MAX_TCPSOCKETS 6 /* Need enough for listen + accepted sockets */
31+
#define MAX_TCPSOCKETS 12 /* Need enough for listen + accepted sockets */
3232
#define MAX_UDPSOCKETS 2
3333
#define MAX_ICMPSOCKETS 1 /* Reduced from 2 */
3434
#define RXBUF_SIZE (LINK_MTU * 8) /* Reduced from 16 */

0 commit comments

Comments
 (0)