diff --git a/src/main.c b/src/main.c index 18aacfc..0f0730a 100644 --- a/src/main.c +++ b/src/main.c @@ -72,6 +72,14 @@ int main(int argc, char **argv) { printf("WARNING: accept: errno %d\n", errno); } else if (ret >= 0) { // Received connection, handle it. + printf("Peer connected: addr is "); + for (unsigned int idx = 0; idx < 16; ++idx) { + if (idx % 2 == 0 && idx > 0) { + printf(":"); + } + printf("%02x", peer_info.sin6_addr.s6_addr[idx]); + } + puts(""); int connection_fd = ret; read_ret = read(connection_fd, recv_buf, C_SIMPLE_HTTP_RECV_BUF_SIZE); // DEBUG print received buf.