mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
backport minor fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@25054 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
10845eb655
commit
fd948b2128
4 changed files with 28 additions and 17 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-04-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSBundle.m:
|
||||||
|
* Source/GSHTTPURLHandle.m:
|
||||||
|
* Source/NSSortDescriptor.m:
|
||||||
|
Backport minor fixes from trunk.
|
||||||
|
|
||||||
2007-04-13 Richard Frith-Macdonald <rfm@gnu.org>
|
2007-04-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSFileHandle.m: ([-readDataOfLength:]) backport of fix of
|
* Source/GSFileHandle.m: ([-readDataOfLength:]) backport of fix of
|
||||||
|
|
|
@ -1237,23 +1237,23 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
||||||
port = @"80";
|
port = @"80";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* An existing socket with keepalive may have been closed by the other
|
||||||
|
* end. The portable way to detect it is to run the runloop once to
|
||||||
|
* allow us to be sent a notification about end-of-file.
|
||||||
|
* On unix systems (google told me it is not reliable on windows) we can
|
||||||
|
* simply peek on the file descriptor for a much more efficient check.
|
||||||
|
*/
|
||||||
if (sock != nil)
|
if (sock != nil)
|
||||||
{
|
{
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd));
|
|
||||||
}
|
|
||||||
/* An existing socket with keepalive may have been closed by the other
|
|
||||||
* end. The portable way to detect it is to run the runloop once to
|
|
||||||
* allow us to be sent a notification about end-of-file.
|
|
||||||
* On unix systems (google told me it is not reliable on windows) we can
|
|
||||||
* simply peek on the file descriptor for a much more efficient check.
|
|
||||||
*/
|
|
||||||
#if defined(__MINGW__)
|
#if defined(__MINGW__)
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||||
NSFileHandle *test = RETAIN(sock);
|
NSFileHandle *test = RETAIN(sock);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd));
|
||||||
|
}
|
||||||
[nc addObserver: self
|
[nc addObserver: self
|
||||||
selector: @selector(bgdRead:)
|
selector: @selector(bgdRead:)
|
||||||
name: NSFileHandleReadCompletionNotification
|
name: NSFileHandleReadCompletionNotification
|
||||||
|
@ -1269,8 +1269,12 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
||||||
object: test];
|
object: test];
|
||||||
RELEASE(test);
|
RELEASE(test);
|
||||||
#else
|
#else
|
||||||
int fd = [sock fileDescriptor];
|
int fd = [sock fileDescriptor];
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
NSLog(@"%@ check for reusable socket", NSStringFromSelector(_cmd));
|
||||||
|
}
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
{
|
{
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
|
@ -1595,11 +1595,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
NSString *path, *fullpath;
|
NSString *path, *fullpath;
|
||||||
NSEnumerator* pathlist;
|
NSEnumerator* pathlist;
|
||||||
|
|
||||||
if (!name || [name length] == 0)
|
if (name == nil)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
name = @"";
|
||||||
format: @"No resource name specified."];
|
|
||||||
/* NOT REACHED */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pathlist = [[self _bundleResourcePathsWithRootPath: rootPath
|
pathlist = [[self _bundleResourcePathsWithRootPath: rootPath
|
||||||
|
@ -1627,7 +1625,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fullpath = nil;
|
{
|
||||||
|
fullpath = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -308,8 +308,8 @@ SortRange(id *objects, NSRange range, id *descriptors,
|
||||||
if (count > 1 && numDescriptors > 0)
|
if (count > 1 && numDescriptors > 0)
|
||||||
{
|
{
|
||||||
id descriptors[numDescriptors];
|
id descriptors[numDescriptors];
|
||||||
GS_BEGINIDBUF(objects, count);
|
|
||||||
NSArray *a;
|
NSArray *a;
|
||||||
|
GS_BEGINIDBUF(objects, count);
|
||||||
|
|
||||||
[self getObjects: objects];
|
[self getObjects: objects];
|
||||||
[sortDescriptors getObjects: descriptors];
|
[sortDescriptors getObjects: descriptors];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue