diff --git a/TODO b/TODO index a6dbfd0..6bfe265 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,5 @@ VERY BIG TODO: right now ws specification is not final anyway. :) - handle errors after all system call...especially open, close, etc. + +- IPV6 support diff --git a/src/socket/connect.c b/src/socket/connect.c index c0d8398..eeb60d3 100644 --- a/src/socket/connect.c +++ b/src/socket/connect.c @@ -29,7 +29,7 @@ void -socketConnect(Sock this, const char * addr) +socketConnect(Sock this, const char * addr, char (*remoteAddr)[16]) { inet_pton(AF_INET, addr, &((this->addr).sin_addr)); (this->addr).sin_family = AF_INET; // Internet address family @@ -44,6 +44,11 @@ socketConnect(Sock this, const char * addr) "error connection socket: %s - service terminated", strerror(errno)); exit(EXIT_FAILURE); + } else { + strcpy(*remoteAddr, inet_ntoa((sock->addr).sin_addr)); + + loggerLog(this->log, LOGGER_INFO, + "handling connection %s\n", inet_ntoa((sock->addr).sin_addr)); } }