summaryrefslogtreecommitdiffstats
path: root/tests/httpd
diff options
context:
space:
mode:
Diffstat (limited to 'tests/httpd')
-rw-r--r--tests/httpd6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/httpd b/tests/httpd
index 3cf2170..48e14ea 100644
--- a/tests/httpd
+++ b/tests/httpd
@@ -45,7 +45,7 @@ proc httpdAccept {newsock ipaddr port} {
fconfigure $newsock -blocking 0 -translation {auto crlf}
httpd_log $newsock Connect $ipaddr $port
set data(ipaddr) $ipaddr
- after 50 [list fileevent $newsock readable [list httpdRead $newsock]]
+ fileevent $newsock readable [list httpdRead $newsock]
}
# read data from a client request
@@ -64,6 +64,10 @@ proc httpdRead { sock } {
-> data(proto) data(url) data(query) data(httpversion)]} {
set data(state) mime
httpd_log $sock Query $line
+ if {[regexp {(?:^|[\?&])delay=([^&]+)} $data(query) {} val]} {
+ fileevent $sock readable {}
+ after $val [list fileevent $sock readable [list httpdRead $sock]]
+ }
} else {
httpdError $sock 400
httpd_log $sock Error "bad first line:$line"