krb5 commit: Drop extra listen() call in gss-server

Greg Hudson ghudson at mit.edu
Tue Mar 16 16:43:10 EDT 2021


https://github.com/krb5/krb5/commit/926ab71da02b5b44f1ebd83977b31c653a556a92
commit 926ab71da02b5b44f1ebd83977b31c653a556a92
Author: Ivan A. Melnikov <iv at altlinux.org>
Date:   Tue Mar 16 14:18:01 2021 +0400

    Drop extra listen() call in gss-server
    
    There is already call to listen in create_socket(), and there is no
    need to tie the backlog to the number of threads.  Also, here listen()
    was sometimes called with zero backlog, making gss-server execution
    (and tests) racy on slower and busy systems.

 src/appl/gss-sample/gss-server.c   |    2 --
 src/tests/gss-threads/gss-server.c |    3 ---
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c
index a0e19fc..9b6ce9f 100644
--- a/src/appl/gss-sample/gss-server.c
+++ b/src/appl/gss-sample/gss-server.c
@@ -766,8 +766,6 @@ main(int argc, char **argv)
         int     stmp;
 
         if ((stmp = create_socket(port)) >= 0) {
-            if (listen(stmp, max_threads == 1 ? 0 : max_threads) < 0)
-                perror("listening on socket");
             fprintf(stderr, "starting...\n");
 
             do {
diff --git a/src/tests/gss-threads/gss-server.c b/src/tests/gss-threads/gss-server.c
index 42136a8..a9f980e 100644
--- a/src/tests/gss-threads/gss-server.c
+++ b/src/tests/gss-threads/gss-server.c
@@ -782,9 +782,6 @@ main(int argc, char **argv)
 
         stmp = create_socket(port);
         if (stmp >= 0) {
-            if (listen(stmp, max_threads == 1 ? 0 : max_threads) < 0)
-                perror("listening on socket");
-
             do {
                 struct _work_plan * work = malloc(sizeof(struct _work_plan));
 


More information about the cvs-krb5 mailing list