mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
fix bug handling eof in read
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24088 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5b06ca2b78
commit
27d3458cb4
2 changed files with 88 additions and 1 deletions
|
@ -516,6 +516,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
NSDictionary *dict = [not userInfo];
|
||||
NSData *d;
|
||||
NSRange r;
|
||||
unsigned readCount;
|
||||
BOOL complete = NO;
|
||||
|
||||
RETAIN(self);
|
||||
|
@ -523,6 +524,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
if (debug) NSLog(@"%@ %s", NSStringFromSelector(_cmd), keepalive?"K":"");
|
||||
d = [dict objectForKey: NSFileHandleNotificationDataItem];
|
||||
if (debug == YES) debugRead(self, d);
|
||||
readCount = [d length];
|
||||
|
||||
if (connectionState == idle)
|
||||
{
|
||||
|
@ -717,7 +719,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
}
|
||||
}
|
||||
|
||||
if (complete == NO && [d length] == 0)
|
||||
if (complete == NO && readCount == 0)
|
||||
{
|
||||
/* The read failed ... dropped, but parsing is not complete.
|
||||
* The request was sent, so we can't know whether it was
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue