Commit e50abbcc authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Hint that the port is numeric when binding an AsyncServerSocket

Summary: Because it had better be numeric or something is very wrong.

Reviewed By: yfeldblum

Differential Revision: D4190568

fbshipit-source-id: 52a5ebfcedb545201191fc48f66a4419eee8f748
parent 9cb38044
......@@ -367,7 +367,7 @@ void AsyncServerSocket::bind(uint16_t port) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV;
snprintf(sport, sizeof(sport), "%u", port);
if (getaddrinfo(nullptr, sport, &hints, &res0)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment