Tcl Library Source Code

View Ticket
Login
Ticket UUID: d470bac96c9b1cd50fdfcf0dc2063202d3c72bdc
Title: httpd timeout handling (possibly related to SSL)
Type: Bug Version: 1.2.1
Submitter: anonymous Created on: 2024-06-03 09:54:15
Subsystem: httpd Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2024-06-03 09:54:15
Resolution: None Closed By: nobody
    Closed on:
Description:
It appears there is a problem with handling of timeout in a connection. 

Steps to reproduce:
Start a Tcl shell and run the minimal example from the man page (with the modifications posted in a separate ticket, so as to get it to run):

% tclsh test.tcl

Then connect using curl to SSL:
% curl -v https://127.0.0.1:8242/hello

Initially appears:
*   Trying 127.0.0.1:8242...
* Connected to 127.0.0.1 (127.0.0.1) port 8242
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none

After some time, on the Tcl side the following error occurs:
can't read "query": no such variable
    while executing
"dict getnull $query REQUEST_URI"
    (class "::httpd::server" method "Connect" line 17)
    invoked from within
"my Connect e9379a584af045199 sock7fc14c894110 127.0.0.1"
    (in namespace inscope "::oo::Obj37" script line 1)
    invoked from within
"::namespace inscope ::oo::Obj37 {my Connect e9379a584af045199 sock7fc14c894110 127.0.0.1}"
    invoked from within
"::httpd::coro::e9379a584af045199 timeout"
    ("after" script)

Connecting directly with nc and without SSL does not result in this, so there may also be an issue in SSL handling that leads to this timeout, but I believe the above error should not occur anyway.