Skip to content

Commit bee1e70

Browse files
committed
Fix issue espressif#5507 "Constructor WebServer::WebServer(IPAddress addr, int port) produces an unexpected result"
"The class Webserver is declared with two explicit constructors, one with signature: WebServer::WebServer(IPAddress addr, int port) Using this results in a server listening on the port number obtained by converting the value of the IPAddress addr argument (in host byte order) to a uint32_t and then to a uint16_t, which is manifestly not the result that would be expected. ... As for a fix, we can assume from these results that this constructor is not being used and therefore could simply be deleted."
1 parent 4ada3f5 commit bee1e70

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

Diff for: libraries/WebServer/src/WebServer.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,6 @@ static const char WWW_Authenticate[] = "WWW-Authenticate";
3939
static const char Content_Length[] = "Content-Length";
4040

4141

42-
WebServer::WebServer(IPAddress addr, int port)
43-
: _corsEnabled(false)
44-
, _server(addr, port)
45-
, _currentMethod(HTTP_ANY)
46-
, _currentVersion(0)
47-
, _currentStatus(HC_NONE)
48-
, _statusChange(0)
49-
, _nullDelay(true)
50-
, _currentHandler(nullptr)
51-
, _firstHandler(nullptr)
52-
, _lastHandler(nullptr)
53-
, _currentArgCount(0)
54-
, _currentArgs(nullptr)
55-
, _postArgsLen(0)
56-
, _postArgs(nullptr)
57-
, _headerKeysCount(0)
58-
, _currentHeaders(nullptr)
59-
, _contentLength(0)
60-
, _chunked(false)
61-
{
62-
}
63-
6442
WebServer::WebServer(int port)
6543
: _corsEnabled(false)
6644
, _server(port)

Diff for: libraries/WebServer/src/WebServer.h

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class FS;
7070
class WebServer
7171
{
7272
public:
73-
WebServer(IPAddress addr, int port = 80);
7473
WebServer(int port = 80);
7574
virtual ~WebServer();
7675

0 commit comments

Comments
 (0)