PATCH: kio_http [IMPORTANT]

Dawit A. adawit at kde.org
Thu Nov 21 06:09:47 GMT 2002


Hi,

The following is a patch for kio_http and it addresses the following issues.  
All of which I myself have encountered...

1st section:

Removes a meaningless do loop which was appropriate (I added it :)) when we 
were directly accessing the system ::read call.  However, since we now call 
TCPSlaveBase::read either needs to be moved there or completely 
discarded, no ?

2nd section:

Fixes a rather nasty bug where we force a resume download even when the server 
does not support it.  To compound the problem we correctly signal the calling 
job that the server does not support resumption.

3rd section:

Fixes two problems:

First is the issue of using the negation (not) operator with signed long/int 
variables in conditional statements. It is my understanding (or rather was 
mentioned to me) that doing can also cause undefined conditions and in 
general a bad idea besides making it to understand the intention of the 
coder.

The following part:

-  if (bytesReceived <= 0)
-     return -1; // Error: connection lost
+  if (bytesReceived < 0)
+     return -1; // ERROR: Connection lost...

fixes a long running problem I have had with downloading the config file off 
of my router's web interface.  I always get a "Connection broken" error 
message even though the entire file was correctly downloaded.  Why on earth 
do we consider 0 byte returns as being error conditions ????  If this is an 
issue with SSL's read, we need to find a fix for it there IMHO, becasue a 
regular read system call can return a 0 and that is a valid EOF....

Regards,
Dawit A.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kio_http.diff
Type: text/x-diff
Size: 1886 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20021121/661ce5a6/attachment.diff>


More information about the kfm-devel mailing list