[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Tue Apr 17 14:41:17 UTC 2018


The branch master has been updated
       via  826e154481e93413a79c37cb1bf4da6175a05875 (commit)
      from  dbabc862966b9afbcc55c59cc07ab643a14ffb31 (commit)


- Log -----------------------------------------------------------------
commit 826e154481e93413a79c37cb1bf4da6175a05875
Author: Andy Polyakov <appro at openssl.org>
Date:   Sat Apr 14 21:42:21 2018 +0200

    apps/s_socket.c: print only dynamically allocated port in do_server.
    
    For formal backward compatibility print original "ACCEPT" message for
    fixed port and "ACCEPT host:port" for dynamically allocated.
    
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5956)

-----------------------------------------------------------------------

Summary of changes:
 apps/s_socket.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/s_socket.c b/apps/s_socket.c
index ae62a13..d21bfc6 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -283,7 +283,8 @@ int do_server(int *accept_sock, const char *host, const char *port,
     BIO_ADDRINFO_free(res);
     res = NULL;
 
-    {
+    if (BIO_ADDR_rawport(sock_address) == 0) {
+        /* dynamically allocated port, report which one */
         union BIO_sock_info_u info;
         char *hostname = NULL;
         char *service = NULL;
@@ -309,6 +310,9 @@ int do_server(int *accept_sock, const char *host, const char *port,
             ERR_print_errors(bio_err);
             goto end;
         }
+    } else {
+        (void)BIO_printf(bio_s_out, "ACCEPT\n");
+        (void)BIO_flush(bio_s_out);
     }
 
     if (accept_sock != NULL)


More information about the openssl-commits mailing list