gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -minor code cleanup


From: gnunet
Subject: [gnunet] branch master updated: -minor code cleanup
Date: Sat, 13 Nov 2021 22:37:40 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new d06c9fa38 -minor code cleanup
d06c9fa38 is described below

commit d06c9fa38337c454e0144fccd892f7353c533eef
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sat Nov 13 22:37:15 2021 +0100

    -minor code cleanup
---
 src/include/gnunet_network_lib.h | 16 +++++------
 src/util/network.c               | 61 +++-------------------------------------
 2 files changed, 12 insertions(+), 65 deletions(-)

diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 97ab64add..ff1e853f5 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -78,7 +78,7 @@ struct GNUNET_NETWORK_FDSet
  * @param pf protocol family to test (PF_INET, PF_INET6, PF_UNIX)
  * @return #GNUNET_OK if the PF is supported
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_test_pf (int pf);
 
 
@@ -154,7 +154,7 @@ GNUNET_NETWORK_socket_set_blocking (struct 
GNUNET_NETWORK_Handle *fd,
  * @param address_len length of @a address
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
                             const struct sockaddr *address,
                             socklen_t address_len);
@@ -165,7 +165,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle 
*desc,
  * @param desc socket to close
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
 
 
@@ -186,7 +186,7 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct 
GNUNET_NETWORK_Handle *desc);
  * @param address_len of @a address
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
                                const struct sockaddr *address,
                                socklen_t address_len);
@@ -202,7 +202,7 @@ GNUNET_NETWORK_socket_connect (const struct 
GNUNET_NETWORK_Handle *desc,
  * @param optlen length of optval
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
                                   int level,
                                   int optname,
@@ -217,7 +217,7 @@ GNUNET_NETWORK_socket_getsockopt (const struct 
GNUNET_NETWORK_Handle *desc,
  * @param backlog length of the listen queue
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
                               int backlog);
 
@@ -339,7 +339,7 @@ GNUNET_NETWORK_socket_setsockopt (struct 
GNUNET_NETWORK_Handle *fd,
  * @param how type of shutdown
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
                                 int how);
 
@@ -353,7 +353,7 @@ GNUNET_NETWORK_socket_shutdown (struct 
GNUNET_NETWORK_Handle *desc,
  * @param desc socket
  * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
 
 
diff --git a/src/util/network.c b/src/util/network.c
index 014701e02..688c37665 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -75,13 +75,7 @@ struct GNUNET_NETWORK_Handle
 };
 
 
-/**
- * Test if the given protocol family is supported by this system.
- *
- * @param pf protocol family to test (PF_INET, PF_INET6, PF_UNIX)
- * @return #GNUNET_OK if the PF is supported
- */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_test_pf (int pf)
 {
   static int cache_v4 = -1;
@@ -145,15 +139,6 @@ GNUNET_NETWORK_test_pf (int pf)
 }
 
 
-/**
- * Given a unixpath that is too long (larger than UNIX_PATH_MAX),
- * shorten it to an acceptable length while keeping it unique
- * and making sure it remains a valid filename (if possible).
- *
- * @param unixpath long path, will be freed (or same pointer returned
- *        with moved 0-termination).
- * @return shortened unixpath, NULL on error
- */
 char *
 GNUNET_NETWORK_shorten_unixpath (char *unixpath)
 {
@@ -189,15 +174,6 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath)
 }
 
 
-/**
- * If services crash, they can leave a unix domain socket file on the
- * disk. This needs to be manually removed, because otherwise both
- * bind() and connect() for the respective address will fail.  In this
- * function, we test if such a left-over file exists, and if so,
- * remove it (unless there is a listening service at the address).
- *
- * @param un unix domain socket address to check
- */
 void
 GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un)
 {
@@ -244,14 +220,7 @@ GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un)
 #endif
 
 
-/**
- * Set if a socket should use blocking or non-blocking IO.
- *
- * @param fd socket
- * @param doBlock blocking mode
- * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
- */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd,
                                     int doBlock)
 {
@@ -418,14 +387,6 @@ initialize_network_handle (struct GNUNET_NETWORK_Handle *h,
 }
 
 
-/**
- * accept a new connection on a socket
- *
- * @param desc bound socket
- * @param address address of the connecting peer, may be NULL
- * @param address_len length of @a address
- * @return client socket
- */
 struct GNUNET_NETWORK_Handle *
 GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
                               struct sockaddr *address,
@@ -473,15 +434,7 @@ GNUNET_NETWORK_socket_accept (const struct 
GNUNET_NETWORK_Handle *desc,
 }
 
 
-/**
- * Bind a socket to a particular address.
- *
- * @param desc socket to bind
- * @param address address to be bound
- * @param address_len length of @a address
- * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
- */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
                             const struct sockaddr *address,
                             socklen_t address_len)
@@ -550,13 +503,7 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle 
*desc,
 }
 
 
-/**
- * Close a socket
- *
- * @param desc socket
- * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
- */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc)
 {
   int ret;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]