Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-04-10
20:46 • Closed ticket [2624536fff]: newer http prevents connection plus 6 other chan... artifact: ce433481e8 user: patthoyts
00:07 • Pending ticket [2624536fff]. artifact: 105607dcec user: dgp
2009-04-03
22:26 • Ticket [2624536fff]: 4 changes artifact: efb650d0a3 user: dgp
2009-03-31
02:19 • Ticket [2624536fff]: 4 changes artifact: 1ff3dad7c9 user: andreas_kupries
2009-03-29
15:08 • Ticket [2624536fff]: 4 changes artifact: 6024576d52 user: teopetuk
2009-02-24
01:55 • Ticket [2624536fff]: 4 changes artifact: 324cf04229 user: tjikkun
2009-02-22
04:10 • Ticket [2624536fff]: 4 changes artifact: 6658c87f11 user: dgp
2009-02-21
16:48 • New ticket [2624536fff]. artifact: f966aa0b06 user: tjikkun

newer http prevents connection

Closed / Fixed2624536fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-02-21 16:48:37
I seem to be having a problem with http 2.7.2
with it, amsn doesn't connect
If i revert the change from http://tcl.cvs.sourceforge.net/viewvc/tcl/tcl/library/http/http.tcl?r1=1.71&r2=1.72&pathrev=MAIN between line 1026 and 1027 it works again.
A puts on $line gives me: 
HTTP/1.1 200 OK
HTTP/1.1 200 OK

This is with amsn 0.97.2

P.S. with amsn latest svn there is a different bug when used with http 2.7.2, if I have time I will try to investigate that one also.
dgp Ticket [2624536fff]: 4 changes [History diff]2009-02-22 04:10:11
tjikkunplain2009-02-24 01:55:35
I just found out the bug with amsn svn is not a different one, it is fixed by the same fix as above:
# cvs diff -u
cvs diff: Diffing .
Index: http.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/library/http/http.tcl,v
retrieving revision 1.72
diff -u -r1.72 http.tcl
--- http.tcl23 Oct 2008 23:17:38 -00001.72
+++ http.tcl23 Feb 2009 18:55:05 -0000
@@ -1024,6 +1024,8 @@
     }
 }
 lappend state(meta) $key [string trim $value]
+    } elseif {[string match HTTP* $line]} {
+        set state(http) $line
     }
 }
     } else {
teopetukplain2009-03-29 15:08:14
It seems to me that this bug occurs because ::http::Event procedure switches from "connecting" state too early (before the initial HTTP line is received). The following patch prevents from switching to "header" state if gets returned -1 (though I'm not sure if this patch fixes the bug completely):

--- http.tcl.orig
+++ http.tcl
@@ -943,9 +943,10 @@
        return
     }
     if {$state(state) eq "connecting"} {
-       set state(state) "header"
        if {[catch {gets $sock state(http)} n]} {
            return [Finish $token $n]
+       } elseif {$n >= 0} {
+           set state(state) "header"
        }
     } elseif {$state(state) eq "header"} {
        if {[catch {gets $sock line} n]} {
andreas_kupriesplain2009-03-31 02:19:42
Pat, we recently talked about http, and I told you that with http 2.7.2 I got an empty result for some urls  (sourceforge xml tracker export). Applying teopetuk's change to my local copy of http 2.7.2 fixed that problem.
dgpplain2009-04-03 22:26:25
any prospects for a quick fix on this one?
dgpplain2009-04-10 00:07:21
teopetuk patch committed for
http 2.7.3.  Please re-open if
the problems still show up using
http 2.7.3.
patthoytsplain2009-04-10 20:46:36
allow_comments - 1

I have made the http tests replicate this fault now by having the test server return the initial HTTP response line in two parts. This shows that the current patch is ok and fixes the fault and will not recurr.
Log in (anonymous is fine) to add a comment.