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

 
 

bug #5010: Problems in connection closing handling.

Submitted by:  None
Submitted on:  Sun 31 Aug 2003 07:43:51 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: BugStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

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

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup1