mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Minor performance tweak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21214 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1f6838a95c
commit
915a739931
2 changed files with 13 additions and 4 deletions
|
@ -101,6 +101,7 @@
|
|||
|
||||
// Maximum data in single I/O operation
|
||||
#define NETBUF_SIZE 4096
|
||||
#define READ_SIZE NETBUF_SIZE*10
|
||||
|
||||
static GSFileHandle* fh_stdin = nil;
|
||||
static GSFileHandle* fh_stdout = nil;
|
||||
|
@ -1381,7 +1382,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
- (NSData*) availableData
|
||||
{
|
||||
char buf[NETBUF_SIZE];
|
||||
char buf[READ_SIZE];
|
||||
NSMutableData* d;
|
||||
int len;
|
||||
|
||||
|
@ -1417,7 +1418,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
- (NSData*) readDataToEndOfFile
|
||||
{
|
||||
char buf[NETBUF_SIZE];
|
||||
char buf[READ_SIZE];
|
||||
NSMutableData* d;
|
||||
int len;
|
||||
|
||||
|
@ -1467,7 +1468,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
}
|
||||
else
|
||||
{
|
||||
char buf[NETBUF_SIZE];
|
||||
char buf[READ_SIZE];
|
||||
|
||||
d = [NSMutableData dataWithCapacity: 0];
|
||||
do
|
||||
|
@ -2151,7 +2152,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
NSMutableData *item;
|
||||
int length;
|
||||
int received = 0;
|
||||
char buf[NETBUF_SIZE];
|
||||
char buf[READ_SIZE];
|
||||
|
||||
item = [readInfo objectForKey: NSFileHandleNotificationDataItem];
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue