Skip to content

Commit

Permalink
esp_http_server: fix default control port for HTTPS configuration
Browse files Browse the repository at this point in the history
For simultaneous HTTP and HTTPS server use-case, default configurations
set same control socket port and hence one of the server initialization
fails with an error "error in creating control socket".

This commit modifies default initializers to use different control
socket port in HTTP vs HTTPS server case.

Closes #10160
Closes IDFGH-8719
  • Loading branch information
mahavirj committed Nov 15, 2022
1 parent 73724b0 commit 34f3287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion components/esp_http_server/include/esp_http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
extern "C" {
#endif

#define ESP_HTTPD_DEF_CTRL_PORT (32768) /*!< HTTP Server control socket port*/

/*
note: esp_https_server.h includes a customized copy of this
initializer that should be kept in sync
Expand All @@ -28,7 +30,7 @@ initializer that should be kept in sync
.stack_size = 4096, \
.core_id = tskNO_AFFINITY, \
.server_port = 80, \
.ctrl_port = 32768, \
.ctrl_port = ESP_HTTPD_DEF_CTRL_PORT, \
.max_open_sockets = 7, \
.max_uri_handlers = 8, \
.max_resp_headers = 8, \
Expand Down
2 changes: 1 addition & 1 deletion components/esp_https_server/include/esp_https_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ typedef struct httpd_ssl_config httpd_ssl_config_t;
.stack_size = 10240, \
.core_id = tskNO_AFFINITY, \
.server_port = 0, \
.ctrl_port = 32768, \
.ctrl_port = ESP_HTTPD_DEF_CTRL_PORT+1, \
.max_open_sockets = 4, \
.max_uri_handlers = 8, \
.max_resp_headers = 8, \
Expand Down

0 comments on commit 34f3287

Please sign in to comment.