http.client probe and 204 response

27 views
Skip to first unread message

mathias louiset

unread,
Jul 12, 2013, 4:56:03 AM7/12/13
to testerm...@googlegroups.com

Hi,

I use the ‘http.client’ probe for my tests, and I noticed that it takes about 10 sec to process a “204 No Content” response when the received message does not contain any Content-Length header and the connection remains active.

Looking at the RFC for HTTP, this seems legal to receive a 1XX, 204 or 304 responses without “Content-Length” header.

 

I did the following fix in plugins/codecs/Http.py and now it’s ok:

 

[root@testerman testerman]# diff -u plugins/codecs/Http.py.orig plugins/codecs/Http.py

--- plugins/codecs/Http.py.orig 2013-07-12 10:37:02.101955263 +0200

+++ plugins/codecs/Http.py      2013-07-12 10:38:56.366974117 +0200

@@ -480,7 +480,7 @@

                                        ret['body'] = ret['body'][:cl]

                        else:

                                # No chunk, no content-length: wait until the end of the connection if we can

-                               if not complete:

+                               if not complete and ret['status'] > 199 and ret['status'] != 204 and ret['status'] != 304:

                                        return self.needMoreData()

 

                return self.decoded(ret, self.getSummary(ret))

 

Cheers,

Mathias

Sébastien Lefèvre

unread,
Jul 16, 2013, 3:15:36 AM7/16/13
to testerm...@googlegroups.com
Hi Mathias,

I'll include your patch by the end of the week. Thank you for pointing that out and providing a solution :)

-seb


2013/7/12 mathias louiset <mathias...@actility.com>

--
You received this message because you are subscribed to the Google Groups "Testerman Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testerman-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Sebastien Lefevre
seb.l...@gmail.com
Reply all
Reply to author
Forward
0 new messages