bugmimms mms stream downloader - Bugs: bug #10496, get_data() recv() bug

 
 

bug #10496: get_data() recv() bug

Submitted by:  None
Submitted on:  Sat 25 Sep 2004 03:56:14 PM UTC  
 
Severity: 5 - AverageStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 22 Oct 2004 02:47:41 PM UTC, comment #2:

Patch applied in 0.0.9.

Wesley J. Landaker <wjl>
Project Administrator
Fri 22 Oct 2004 02:04:46 PM UTC, comment #1:

Thanks for the patch. I will test this out and apply it if there are no problems. (=

Wesley J. Landaker <wjl>
Project Administrator
Sat 25 Sep 2004 03:56:14 PM UTC, original submission:

mimms get_data() function is not working properly when the other end closes the socket.

Possible solution is to return the number or bytes read instead 0 or 1 where you cant know how many valid bytes are in the buffer.

Here's a patch (I still have to update the code to follow the new semantics):
--- mimms/mimms.cpp
+++ mimms/mimms.cpp
@@ -221,21 +221,23 @@

len = recv (s, &buf[total], count-total, 0);

+ if (len > 0) {
+ dprintf ("[%d/%d]", total, count);
+ fflush (stdout);
+ }
+
if (len<0) {
perror ("read error:");
- return 0;
+ return -1;
}

total += len;

- if (len != 0) {
- dprintf ("[%d/%d]", total, count);
- fflush (stdout);
- }
+ if (len == 0) return total;

}

- return 1;
+ return total;

}

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):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Fri 22 Oct 2004 02:47:41 PM UTCwjlOpen/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1