]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
serv: fix detection of early data reception
authorDaiki Ueno <ueno@gnu.org>
Sun, 16 Feb 2025 00:02:46 +0000 (09:02 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 24 Mar 2025 21:43:11 +0000 (06:43 +0900)
Upon success, gnutls_record_recv_early_data returns the amount of data
received, so the application should treat positive numbers as an
indication of early data reception.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
src/serv.c

index 17db12c5caa7bd5bf0dcc22905a589eeb5319270..86008c95231ea1afefbfb1043f723b8573178349 100644 (file)
@@ -1690,7 +1690,7 @@ static void tcp_server(const char *name, int port, int timeout)
                                                    GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
                                                        j->earlydata_eof = 1;
                                                }
-                                               if (r == 0) {
+                                               if (r >= 0) {
                                                        earlydata_read = 1;
                                                }
                                        }