[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29430 - msh/src
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29430 - msh/src |
Date: |
Fri, 20 Sep 2013 15:10:45 +0200 |
Author: harsha
Date: 2013-09-20 15:10:45 +0200 (Fri, 20 Sep 2013)
New Revision: 29430
Modified:
msh/src/mshd.c
msh/src/util.c
msh/src/util.h
Log:
- cleanup dead code; extend doc
Modified: msh/src/mshd.c
===================================================================
--- msh/src/mshd.c 2013-09-20 12:15:59 UTC (rev 29429)
+++ msh/src/mshd.c 2013-09-20 13:10:45 UTC (rev 29430)
@@ -518,7 +518,7 @@
/**
- * Schedules next round
+ * Schedules next round. If all the rounds are completed, call the next
*/
static void
schedule_next_round ()
@@ -597,7 +597,8 @@
/**
- * Callback triggered to finalise a round
+ * Finalise a round by freeing the resources used by it, cancel the accept task
+ * and schedule next round
*
* @param cls NULL
* @param tc scheduler task context
Modified: msh/src/util.c
===================================================================
--- msh/src/util.c 2013-09-20 12:15:59 UTC (rev 29429)
+++ msh/src/util.c 2013-09-20 13:10:45 UTC (rev 29430)
@@ -60,34 +60,13 @@
/**
- * Creates a new socket and connects it to the given address
+ * Return the numeric ASCII representation of the given sockaddr
*
- * @param addr the address to connect to
- * @param addrlen the length of the addr
- * @return the socket's fd; -1 on error
+ * @param addr the address to represent
+ * @param addrlen the length of the sockaddr structure
+ * @return the numeric ASCII representation
*/
-int
-open_socket (const struct sockaddr *addr, const socklen_t addrlen)
-{
- int sock;
-
- sock = socket (AF_INET, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0);
- if (-1 == sock)
- {
- LOG_STRERROR ("socket");
- return -1;
- }
- if ((-1 == connect (sock, addr, addrlen)) && (EINPROGRESS != errno) )
- {
- LOG_STRERROR ("connect");
- (void) close (sock);
- return -1;
- }
- return sock;
-}
-
-
-char *
+const char *
saddr2str (const struct sockaddr *addr, const socklen_t addrlen)
{
static char hostip[NI_MAXHOST];
Modified: msh/src/util.h
===================================================================
--- msh/src/util.h 2013-09-20 12:15:59 UTC (rev 29429)
+++ msh/src/util.h 2013-09-20 13:10:45 UTC (rev 29430)
@@ -19,16 +19,13 @@
/**
- * Creates a new socket and connects it to the given address
+ * Return the numeric ASCII representation of the given sockaddr
*
- * @param addr the address to connect to
- * @param addrlen the length of the addr
- * @return the socket's fd; -1 on error
+ * @param addr the address to represent
+ * @param addrlen the length of the sockaddr structure
+ * @return the numeric ASCII representation
*/
-int
-open_socket (const struct sockaddr *addr, const socklen_t addrlen);
-
-char *
+const char *
saddr2str (const struct sockaddr *addr, const socklen_t addrlen);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29430 - msh/src,
gnunet <=