Skip to content

Commit

Permalink
fixup! http: Report local address to server.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Jul 4, 2016
1 parent 3f0a4e6 commit 6791e9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/native/file/fd_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#else
#include <io.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#include <fcntl.h>

Expand Down Expand Up @@ -134,7 +135,7 @@ void SetNonBlocking(int sock, bool non_blocking) {
std::string GetLocalIP(int sock) {
struct sockaddr_in server_addr;
memset(&server_addr, 0, sizeof(server_addr));
int len = sizeof(server_addr);
socklen_t len = sizeof(server_addr);
if (getsockname(sock, (struct sockaddr *)&server_addr, &len) == 0) {
char *result = inet_ntoa(*(in_addr *)&server_addr.sin_addr);
if (result) {
Expand Down

0 comments on commit 6791e9f

Please sign in to comment.