connection-monitor: always log disconnect when enabled
authorDaniel Stenberg <daniel@haxx.se>
Wed, 11 Jul 2012 21:49:01 +0000 (23:49 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 11 Jul 2012 22:08:37 +0000 (00:08 +0200)
This makes verifying easier and makes us more sure curl closes the
connection only at the correct point in time. Adjusted test 206 and 1008
accordingly and updated the docs for it.

tests/FILEFORMAT
tests/data/test1008
tests/data/test206
tests/server/sws.c

index 950465c..d8c1345 100644 (file)
@@ -135,12 +135,7 @@ rtp: part [num] channel [num] size [num]
                with the given payload size
 
 connection-monitor When used, this will log [DISCONNECT] to the server.input
-               log if the connection is disconnected while the given request
-               is handled. Note that if the connection isn't disconnected and
-               the server loops and waits for the next request on the
-               persistent connection then the internal boolean for connection
-               monitoring will be reset to default and if then the connection
-               gets discconected nothing will be output.
+               log when the connection is disconnected.
 
 </servercmd>
 </reply>
index 5c53266..e576e71 100644 (file)
@@ -124,6 +124,7 @@ User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6
 Host: test.remote.example.com:1008\r
 Accept: */*\r
 \r
+[DISCONNECT]
 </protocol>
 </verify>
 </testcase>
index 8ca31e3..b85d7a3 100644 (file)
@@ -98,6 +98,7 @@ User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6
 Host: test.remote.haxx.se:206\r
 Accept: */*\r
 \r
+[DISCONNECT]
 </protocol>
 </verify>
 </testcase>
index e1abed6..aaacb35 100644 (file)
@@ -347,6 +347,8 @@ static int parse_servercmd(struct httprequest *req)
       return 1; /* done */
     }
 
+    req->connmon = FALSE;
+
     cmd = orgcmd;
     while(cmd && cmdsize) {
       char *check;
@@ -837,7 +839,6 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
   req->pipelining = FALSE;
   req->callcount = 0;
   req->connect_port = 0;
-  req->connmon = FALSE;
 
   /*** end of httprequest init ***/