mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
improve diagnostic output
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37272 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f4270e4e0f
commit
f8d4ae3dfe
1 changed files with 19 additions and 1 deletions
|
@ -232,15 +232,33 @@ debugRead(GSHTTPURLHandle *handle, NSData *data)
|
|||
{
|
||||
int len = (int)[data length];
|
||||
const char *ptr = (const char*)[data bytes];
|
||||
int pos;
|
||||
|
||||
NSLog(@"Read for %p of %d bytes -'%*.*s'", handle, len, len, len, ptr);
|
||||
for (pos = 0; pos < len; pos++)
|
||||
{
|
||||
if (0 == ptr[pos])
|
||||
{
|
||||
NSLog(@"Read for %p of %d bytes - %@", handle, len, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
NSLog(@"Read for %p of %d bytes - '%*.*s'", handle, len, len, len, ptr);
|
||||
}
|
||||
static void
|
||||
debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
||||
{
|
||||
int len = (int)[data length];
|
||||
const char *ptr = (const char*)[data bytes];
|
||||
int pos = len;
|
||||
|
||||
for (pos = 0; pos < len; pos++)
|
||||
{
|
||||
if (0 == ptr[pos])
|
||||
{
|
||||
NSLog(@"Write for %p of %d bytes - %@", handle, len, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
NSLog(@"Write for %p of %d bytes -'%*.*s'", handle, len, len, len, ptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue