diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-20 16:26:07 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-04-20 17:34:04 +0200 |
commit | 31897eaa7de865d41b46f7158c70f94debe1ec66 (patch) | |
tree | 5575e5bf60b6555d291a0bb25aa43fc35f6980e1 /src/network/core/tcp_http.cpp | |
parent | 05612d60ae0af94b9313d5a8b78ebf58a3eeab66 (diff) | |
download | openttd-31897eaa7de865d41b46f7158c70f94debe1ec66.tar.xz |
Codechange: split ParseConnectionString into two functions
One also looks for a company, the other doesn't. There were more
uses of the latter than the first, leaving very weird code all
over the place.
Diffstat (limited to 'src/network/core/tcp_http.cpp')
-rw-r--r-- | src/network/core/tcp_http.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index be5a2c39a..d88ea711d 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -203,10 +203,8 @@ int NetworkHTTPSocketHandler::HandleHeader() *url = '\0'; /* Fetch the hostname, and possible port number. */ - const char *company = nullptr; const char *port = nullptr; - ParseConnectionString(&company, &port, hname); - if (company != nullptr) return_error("[tcp/http] invalid hostname"); + ParseConnectionString(&port, hname); NetworkAddress address(hname, port == nullptr ? 80 : atoi(port)); |