Mercurial > hg > nnchat
diff network.c @ 419:d015ecbd231d
Use C99 style comments, too.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 24 May 2012 07:37:36 +0300 |
parents | 8263cb88556a |
children | 6727fec3c326 |
line wrap: on
line diff
--- a/network.c Thu May 24 07:34:37 2012 +0300 +++ b/network.c Thu May 24 07:37:36 2012 +0300 @@ -167,7 +167,7 @@ nn_get_addr(&(conn->addr), conn->hst); - /* Prepare for connection */ + // Prepare for connection dest.sin_family = AF_INET; if (conn->proxy.type > NN_PROXY_NONE && conn->proxy.type < NN_PROXY_LAST) @@ -207,7 +207,7 @@ FD_ZERO(&(conn->sockfds)); FD_SET(conn->socket, &(conn->sockfds)); - /* Proxy-specific setup */ + // Proxy-specific setup if (conn->proxy.type == NN_PROXY_SOCKS4 || conn->proxy.type == NN_PROXY_SOCKS4A) { struct nn_socks_t *socksh; @@ -226,7 +226,7 @@ goto error; } - /* Create SOCKS 4/4A request */ + // Create SOCKS 4/4A request nn_conn_msg(conn, "Initializing proxy negotiation.\n"); socksh = (struct nn_socks_t *) buf; socksh->version = 4; @@ -246,7 +246,7 @@ strcpy(ptr, conn->host); } - /* Send request */ + // Send request nn_conn_reset(conn); if (!nn_conn_send_buf(conn, buf, bufsiz)) { @@ -256,7 +256,7 @@ } th_free(buf); - /* Wait for SOCKS server to reply */ + // Wait for SOCKS server to reply for (status = tries = 1; tries <= 20 && status > 0; tries++) { #ifdef __WIN32 @@ -268,7 +268,7 @@ status = nn_conn_pull(conn); } - /* Check results */ + // Check results if (status == 0) { struct nn_socks_res_t *res = (struct nn_socks_res_t *) &(conn->buf); @@ -379,7 +379,7 @@ if (conn == NULL) return -10; - /* Prod the input buffer */ + // Prod the input buffer if (conn->in_ptr > conn->buf && conn->in_ptr - conn->ptr > 0) { size_t delta = conn->in_ptr - conn->ptr; @@ -389,7 +389,7 @@ conn->total_bytes -= delta; } - /* Check for incoming data */ + // Check for incoming data socktv.tv_sec = 0; socktv.tv_usec = NN_DELAY_USEC; tmpfds = conn->sockfds; @@ -443,7 +443,7 @@ BOOL nn_network_init(void) { #ifdef __WIN32 - /* Initialize WinSock, if needed */ + // Initialize WinSock, if needed WSADATA wsaData; int err = WSAStartup(0x0101, &wsaData); if (err != 0)