Skip to content

Commit

Permalink
rm again
Browse files Browse the repository at this point in the history
  • Loading branch information
ggjulio committed Nov 2, 2021
1 parent b0f671a commit ce18e0c
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/config/ServerConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,36 +567,36 @@ Host ServerConfig::_parseListenValue(const pr::Token& t)
Host result;
unsigned long port;

std::string tmp;
// std::string tmp;

std::string::const_iterator it = t.value.begin();
std::string::const_iterator end = t.value.end();
// std::string::const_iterator it = t.value.begin();
// std::string::const_iterator end = t.value.end();

while(it != end && *it != ':')
tmp += *it++;
// while(it != end && *it != ':')
// tmp += *it++;

if (it == end)
{
it = tmp.begin();
end = tmp.end();
}
else
{
ft::lowerStringInPlace(tmp);
if (ft::isValidIpAddress(tmp.c_str()))
result.setHostname(tmp);
else
{
_throw_SyntaxError(t, std::string("context \"listen\" : invalid ip interface"));
}
it++;
tmp.clear();
while (it != end)
tmp += *it++;
}
// if (it == end)
// {
// it = tmp.begin();
// end = tmp.end();
// }
// else
// {
// ft::lowerStringInPlace(tmp);
// if (ft::isValidIpAddress(tmp.c_str()))
// result.setHostname(tmp);
// else
// {
// _throw_SyntaxError(t, std::string("context \"listen\" : invalid ip interface"));
// }
// it++;
// tmp.clear();
// while (it != end)
// tmp += *it++;
// }
char *nptr;
errno = 0;
port = strtoul(tmp.c_str(), &nptr, 10);
port = strtoul(t.value.c_str(), &nptr, 10);
if (port == ULONG_MAX && ft::make_error_code().value() == ft::errc::result_out_of_range)
_throw_SyntaxError(t, std::string("Overflow in context \"listen\"... thx bro --'"));
if (nptr[0])
Expand Down

0 comments on commit ce18e0c

Please sign in to comment.