summaryrefslogtreecommitdiff
blob: 81131dc6bc64ffce5dd6d5e97489eca479c9231c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
https://github.com/curl/curl/commit/f1d09231adfc695d15995b9ef2c8c6e568c28091
Author: Stefan Eissing <stefan@eissing.org>
Date:   Tue Feb 14 14:29:13 2023 +0100

    tests: make the telnet server shut down a socket gracefully
    
    - test 1452 failed occasionally with ECONNRESET errnos in curl when the
      server closed the connection in an unclean state.
    
    Closes #10509

--- a/tests/negtelnetserver.py
+++ b/tests/negtelnetserver.py
@@ -29,7 +29,9 @@ from __future__ import (absolute_import, division, print_function,
 import argparse
 import logging
 import os
+import socket
 import sys
+import time
 
 from util import ClosingFileHandler
 
@@ -90,7 +92,7 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
             neg.send_wont("NAWS")
 
             # Get the data passed through the negotiator
-            data = neg.recv(1024)
+            data = neg.recv(4*1024)
             log.debug("Incoming data: %r", data)
 
             if VERIFIED_REQ.encode('utf-8') in data:
@@ -109,6 +111,12 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
                 log.debug("Sending %r", response_data)
                 self.request.sendall(response_data)
 
+            # put some effort into making a clean socket shutdown
+            # that does not give the client ECONNRESET
+            self.request.settimeout(0.1)
+            self.request.recv(4*1024)
+            self.request.shutdown(socket.SHUT_RDWR)
+
         except IOError:
             log.exception("IOError hit during request")
 

https://github.com/curl/curl/commit/2fdc1d816ebf3c77f43068103bec1b3a3767881a
Author: Daniel Stenberg <daniel@haxx.se>
Date:   Wed Feb 15 15:04:07 2023 +0100

    tests: make sure gnuserv-tls has SRP support before using it
    
    Reported-by: fundawang on github
    Fixes #10522
    Closes #10524

--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -5382,7 +5382,7 @@ sub startservers {
         elsif($what eq "httptls") {
             if(!$httptlssrv) {
                 # for now, we can't run http TLS-EXT tests without gnutls-serv
-                return "no gnutls-serv";
+                return "no gnutls-serv (with SRP support)";
             }
             if($torture && $run{'httptls'} &&
                !responsive_httptls_server($verbose, "IPv4")) {
--- a/tests/sshhelp.pm
+++ b/tests/sshhelp.pm
@@ -408,7 +408,16 @@ sub find_sshkeygen {
 # Find httptlssrv (gnutls-serv) and return canonical filename
 #
 sub find_httptlssrv {
-    return find_exe_file_hpath($httptlssrvexe);
+    my $p = find_exe_file_hpath($httptlssrvexe);
+    my @o = `$p -l`;
+    my $found;
+    for(@o) {
+        if(/Key exchange: SRP/) {
+            $found = 1;
+            last;
+        }
+    }
+    return $p if($found);
 }
 
 

https://github.com/curl/curl/commit/79d0b3c0c0bb00829f10ec139dbf3823c249ae72
Author: Daniel Stenberg <daniel@haxx.se>
Date:   Wed Feb 15 13:03:21 2023 +0100

    runtests: fix "uninitialized value $port"
    
    by using a more appropriate variable
    
    Reported-by: fundawang on github
    Fixes #10518
    Closes #10520

--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -1740,7 +1740,7 @@ sub runhttpserver {
     }
 
     # where is it?
-    my $port;
+    my $port = 0;
     if(!$port_or_path) {
         $port = $port_or_path = pidfromfile($portfile);
     }
@@ -1758,7 +1758,7 @@ sub runhttpserver {
     $pid2 = $pid3;
 
     if($verbose) {
-        logmsg "RUN: $srvrname server is on PID $httppid port $port\n";
+        logmsg "RUN: $srvrname server is on PID $httppid port $port_or_path\n";
     }
 
     return ($httppid, $pid2, $port);