Zoran!  Why do you hate my test suite?    :-)

RCS file: /cvsroot/naviserver/naviserver/tcl/http.tcl,v
date: 2006/03/09 11:25:55;  author: vasiljevic;  state: Exp;  lines: +356 -312

...The http.tcl and sendmail.tcl are rewritten to take advantage of
automatic end-of-line handling of Tcl channels...


 proc _ns_http_gets {timeout sock} {
-    set line ""
-    set done 0
-    while {!$done} {
-       set nline [_ns_http_readable $timeout $sock]
-       if {!$nline} {set done 1}
-       while {!$done && $nline > 0} {
-           set char [read $sock 1]
-           if {$char eq "\n"} {set done 1}
-           append line $char
-           incr nline -1
-       }
+
+    while {[gets $sock line] == -1} {
+        if {[eof $sock]} {
+            return -code error "_hs_http_gets: premature end of data"
+        }
+        _ns_http_readable $timeout $sock
     }
-    string trimright $line
+
+    return $line
 }


On 3/9/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote:
> Setting this removed all errors:
>
> set line [string trim [_ns_http_gets $timeout $rfd]]
>
> Before that _ns_http_gets returned \r in the string
>
> Vlad Seryakov wrote:
> > It should close only when post limit exceeds, other requests should not
> > be affected. It looks like broke something
> >
> > Stephen Deasey wrote:
> >> On 3/9/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote:
> >>> Stephen Deasey wrote:
> >>>> I'm getting a lot (123) of what looks like bogus test failures on a
> >>>> fresh checkout.  Are the recent changes to the nstest_http proc OK?
> >>> Yes, i noticed this as well, this is because server now can close
> >>> connection during client sending the body and i tried to put catch
> >>> around close in all places but still it complains on close.
> >>
> >>
> >> This is new behaviour?  Why would the server close the connection
> >> while the client is sending data?
> >>
> >> I'm getting in failures in e.g. test/url2file.test:url2file-2.1 which
> >> looks like:
> >>
> >>
> >> test url2file-2.1 {ns_url2file} -setup {
> >>     ns_register_proc GET /url2file {ns_return 200 text/plain
> >> [ns_url2file /foo] ;#}
> >> } -body {
> >>     nstest_http -getbody 1 GET /url2file
> >> } -cleanup {
> >>     ns_unregister_proc GET /url2file
> >> } -result [list 200 [ns_pagepath foo]]
> >>
> >>
> >> This is just a simple GET request, no body.  Test error is:
> >>
> >>
> >> ---- Test generated error; Return code was: 1
> >> ---- Return code should have been one of: 0 2
> >> ---- errorInfo: can not find channel named "sock24"
> >>     while executing
> >> "close $wfd"
> >>     invoked from within
> >> "nstest_http -getbody 1 GET /url2file"
> >>     ("uplevel" body line 2)
> >>     invoked from within
> >> "uplevel 1 $script"
> >> ---- errorCode: NONE
> >> ==== url2file-2.1 FAILED

Reply via email to