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.
This commit is contained in:
committed by
Patric Stout
parent
05612d60ae
commit
31897eaa7d
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user