]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge topic branch t/net into master
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 7 Nov 2022 16:34:31 +0000 (17:34 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 7 Nov 2022 16:39:13 +0000 (17:39 +0100)
A moderately sized series which contains a bunch of simple cleanups
for net.c and net.h.

* refs/heads/t/net:
  net: De-doxify static functions.
  net: Refer to correct man page in stringify_port().
  net: Pass true/false instead of 0/1 to makesock().
  net: Demote log level of error message in makesock().
  net: Rename para_connect_simple() -> para_connect().
  net: Make is_valid_ipv{4,6}_address() local to net.c.
  net: Remove IPPROTO_DCCP define.
  net: Make single-use macros local.
  net: Combine documentation of struct flowopts.
  net: Drop extern keyword of function declarations.

1  2 
NEWS.md
client_common.c

diff --combined NEWS.md
index 5a00175c3255702b03ec86e0af1938863f53ba4d,5a00175c3255702b03ec86e0af1938863f53ba4d..c21cc858ef2c4ab5030a4f1e8996921dd9585513
+++ b/NEWS.md
@@@ -1,6 -1,6 +1,15 @@@
  NEWS
  ====
  
++------------------------------------------
++0.7.2 (to be announced) "optical friction"
++------------------------------------------
++
++- Minor cleanup of the net subsystem.
++
++Downloads:
++[tarball](./releases/paraslash-git.tar.xz)
++
  --------------------------------------
  0.7.1 (2022-10-03) "digital spindrift"
  --------------------------------------
@@@ -27,6 -27,6 +36,7 @@@ usual mix of bug fixes and minor improv
    requires support from the compiler, the oldest supported gcc version
    has been bumped to gcc-5.4 (released in 2015).
  
++Downloads:
  [tarball](./releases/paraslash-0.7.1.tar.xz),
  [signature](./releases/paraslash-0.7.1.tar.xz.asc)
  
diff --combined client_common.c
index 64f6c67612a5c665b87dcdb8d3e051bc7500b455,9bcfcb827bb867674f8363f1d114b349c2fc7f76..95e59fd29de2015fcc65443a4ffc6442387ec0f8
@@@ -255,15 -255,9 +255,15 @@@ static int send_sb_command(struct clien
        return send_sb(ct, 0, command, len, SBD_COMMAND, false);
  }
  
 +/* Find out if the given string is contained in the features vector. */
  static bool has_feature(const char *feature, struct client_task *ct)
  {
 -      return find_arg(feature, ct->features) >= 0? true : false;
 +      if (!ct->features)
 +              return false;
 +      for (int i = 0; ct->features[i]; i++)
 +              if (strcmp(feature, ct->features[i]) == 0)
 +                      return i;
 +      return false;
  }
  
  /*
@@@ -490,7 -484,7 +490,7 @@@ int client_connect(struct client_task *
  
        PARA_NOTICE_LOG("connecting %s:%u\n", host, port);
        ct->scc.fd = -1;
-       ret = para_connect_simple(IPPROTO_TCP, host, port);
+       ret = para_connect(IPPROTO_TCP, host, port);
        if (ret < 0)
                return ret;
        ct->scc.fd = ret;