]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
net: Combine para_listen() and para_listen_simple().
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 7 Mar 2018 11:00:58 +0000 (12:00 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 17 Apr 2018 07:29:57 +0000 (09:29 +0200)
The only caller of para_listen() is para_listen_simple(), since
flowops are only used for active sockets.

net.c
net.h

diff --git a/net.c b/net.c
index b9176a6659d6d2628aff3f71f9d82718e0e7a802..1fece043586cddc782791d0ec18af45881797c5f 100644 (file)
--- a/net.c
+++ b/net.c
@@ -503,16 +503,15 @@ int makesock(unsigned l4type, bool passive, const char *host, uint16_t port_numb
  *
  * \param l4type The transport-layer type (\p IPPROTO_xxx).
  * \param port The decimal port number to listen on.
  *
  * \param l4type The transport-layer type (\p IPPROTO_xxx).
  * \param port The decimal port number to listen on.
- * \param fo Flowopts (if any) to set before starting to listen.
  *
  * \return Positive integer (socket descriptor) on success, negative value
  * otherwise.
  *
  * \sa \ref makesock(), ip(7), ipv6(7), bind(2), listen(2).
  */
  *
  * \return Positive integer (socket descriptor) on success, negative value
  * otherwise.
  *
  * \sa \ref makesock(), ip(7), ipv6(7), bind(2), listen(2).
  */
-int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo)
+int para_listen_simple(unsigned l4type, uint16_t port)
 {
 {
-       int ret, fd = makesock(l4type, 1, NULL, port, fo);
+       int ret, fd = makesock(l4type, 1, NULL, port, NULL);
 
        if (fd > 0) {
                ret = listen(fd, BACKLOG);
 
        if (fd > 0) {
                ret = listen(fd, BACKLOG);
diff --git a/net.h b/net.h
index f172131ef05d45c8d05f82a91ea9e72cd0160a16..c515779975343a19b3bffb4162d6dc273eb3186b 100644 (file)
--- a/net.h
+++ b/net.h
@@ -124,12 +124,8 @@ bool sockaddr_equal(const struct sockaddr *sa1, const struct sockaddr *sa2);
  */
 /** How many pending connections queue of a listening server will hold. */
 #define BACKLOG        10
  */
 /** How many pending connections queue of a listening server will hold. */
 #define BACKLOG        10
-extern int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo);
 
 
-static inline int para_listen_simple(unsigned l4type, uint16_t port)
-{
-       return para_listen(l4type, port, NULL);
-}
+int para_listen_simple(unsigned l4type, uint16_t port);
 
 /** Pretty-printing of IPv4/6 socket addresses */
 extern char *remote_name(int sockfd);
 
 /** Pretty-printing of IPv4/6 socket addresses */
 extern char *remote_name(int sockfd);