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
Priority:  5 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

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.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

History

No changes have been made to this item

Back to the top

Powered by Savane 3.16-a7ba.
Corresponding source code