bugStraw, desktop news aggregator - Bugs: bug #5010, Problems in connection closing...

 
 

bug #5010: Problems in connection closing handling.

Submitter:  None
Submitted:  Sun 31 Aug 2003 07:43:51 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 31 Aug 2003 07:43:51 PM UTC, original submission:  

Observable 'effects': Some feeds (although otherwise perfectly valid) are 'empty' (e.g. bug #4958) and some feeds make Straw hang (e.g. bug #4369). Most probably this happens when using a proxy.

(partial) Diagnosis: Described problem manifests itself when a feed data is being sent without 'Content-length' HTTP header field (happens with generated content). After receiving the full header, Straw assumes (URLFetch.py, Consumer::http_header()) there is no more data to read and calls ProxyConsumer::finished_callback(), with effect of parsing empty body data and no items to display. If we change this behaviour, (see solution below) to not to call finished_callback() when 'Content-length' is not present, the function could never be called if proxy (was present, and) decided to keep connection alive...

Solution: This is actually a quick hack to show what the problem is and how to temporally resolve it. And I have never written in Python before... ;)

File: URLFetch.py, Class: Consumer, method: http_header()
line:
        if header.getheader('content-length', '0') == '0':
changed to:
        if header.getheader('content-length', '-1') == '0':

(It's unlikely that HTTP server will return '-1' as content length, so the value will be compared against when 'Content-length' is not defined)

File: httplib_async.py, Class: HTTPConnection_async, method: request()
before the lines:
        if self.proxy and self.proxy_port:
            self.path = "http://%s%s" % (self.host, path)
added line:
            headers['Proxy-Connection'] = 'Close'

In fact, I do use proxy, and the changes work quite nicely for me, but I didn't consider every possible situation, so this is more an idea of the solution than anything else...

I'm using Debian package 0.19-2, so the part of code in question is practically identical with CVS code.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code