httplib: incomplete read
<p>I have some python code on both the client and server side. I am getting an IncompleteRead exception thrown for what seems to be no good reason. I can navigate to the URL with Firefox without any error message and also WGET it without any odd results.</p>

<p>The server code is:</p>

<pre><code>import random
import hashlib
print "Content-Type: text/html"     
print                              

m = hashlib.md5()
m.update(str(random.random()))
print m.hexdigest()
print
</code></pre>

<p>On the client site, I use a relatively straightforward POST approach:</p>

<pre><code>    data = urllib.urlencode({"username": username,
                     "password" : password})
    #POST in the data.
    req = urllib2.Request(url, data)

    response = urllib2.urlopen(req)
    string =  response.read()
</code></pre>

<p>And the response.read() throws the error. </p>

<p>Edit: Further information -  Adding explicit CRLF emissions does not alter the change. Checking the error log</p>

<pre><code>[Wed Sep 08 10:36:43 2010] [error] [client 192.168.80.1] (104)Connection reset by peer: ap_content_length_filter: apr_bucket_read() failed
</code></pre>

<p>The SSL access log shows(mildly redacted):</p>

<pre><code>192.168.80.1 - - [08/Sep/2010:10:38:02 -0700] "POST /serverfile.py HTTP/1.1" 200 1357 "-" "Python-urllib/2.7"
</code></pre>
