]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong ->accept() error handling
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 11 Mar 2021 16:06:30 +0000 (17:06 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
Really signal the caller that ->accept() has failed if the session could not
be initialized because conn_complete_session() has failed. This is the case
if the mux could not be initialized too.
When it fails an ->accept() must returns -1 in case of resource shortage.

src/quic_sock.c

index 1a5cf69df238d891884319e1b562e7a19401076a..011b93ad6de10a6ec9568a9145301b2c472a99b7 100644 (file)
@@ -69,8 +69,6 @@ int quic_session_accept(struct connection *cli_conn)
        if (conn_complete_session(cli_conn) >= 0)
                return 1;
 
-       return 0;
-
  out_free_sess:
        /* prevent call to listener_release during session_free. It will be
        * done below, for all errors. */
@@ -83,7 +81,7 @@ int quic_session_accept(struct connection *cli_conn)
        conn_free(cli_conn);
  out:
 
-       return 0;
+       return -1;
 }
 
 /*