Ticket #373: net-tcpserver-and-client.patch
File net-tcpserver-and-client.patch, 1.0 KB (added by , 16 years ago) |
---|
-
net/tcpserver.cc
167 167 } 168 168 169 169 struct sockaddr_in addr; 170 memset(&addr, 0, sizeof(addr)); 170 171 addr.sin_family = AF_INET; 171 172 addr.sin_port = htons(port); 172 173 if (host.empty()) { … … 191 192 ); 192 193 } 193 194 194 memcpy(&addr.sin_addr, hostent->h_addr, sizeof(addr.sin_addr));195 memcpy(&addr.sin_addr, hostent->h_addr, hostent->h_length); 195 196 } 196 197 197 198 retval = bind(socketfd, -
net/tcpclient.cc
68 68 } 69 69 70 70 struct sockaddr_in remaddr; 71 memset(&remaddr, 0, sizeof(remaddr)); 71 72 remaddr.sin_family = AF_INET; 72 73 remaddr.sin_port = htons(port); 73 memcpy(&remaddr.sin_addr, host->h_addr, sizeof(remaddr.sin_addr));74 memcpy(&remaddr.sin_addr, host->h_addr, host->h_length); 74 75 75 76 #ifdef __WIN32__ 76 77 ULONG enabled = 1;