Fixed an issue with network endian

This commit is contained in:
Pierre Pronchery 2012-09-22 23:26:50 +00:00
parent 9bf7fc9af9
commit 4681eed3da

View File

@ -248,7 +248,8 @@ static int _appserver_accept(int fd, AppServer * appserver)
fprintf(stderr, "%s%d%s%d %s:%u\n", "DEBUG: accept(", fd, ") => ",
newfd, inet_ntoa(sa.sin_addr), sa.sin_port);
#endif
if((asc = _appserverclient_new(newfd, sa.sin_addr.s_addr, sa.sin_port
if((asc = _appserverclient_new(newfd, htonl(sa.sin_addr.s_addr),
htons(sa.sin_port)
#ifdef WITH_SSL
, appserver->ssl_ctx
#endif