From 4c28420c08c7ff8bfc0dd3c6faf08277f12dbb8e Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 16 Nov 2004 12:49:42 +0000 Subject: [PATCH] define some default defaults for the simple http parser (when the Defaults.plist could not be found) git-svn-id: http://svn.opengroupware.org/SOPE/trunk@372 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 6 ++++++ sope-appserver/NGObjWeb/Version | 2 +- sope-appserver/NGObjWeb/WOSimpleHTTPParser.m | 19 +++++++++++++------ sope-appserver/NGXmlRpc/NGXmlRpcClient.m | 1 - xmlrpc_call/README | 7 +++++++ 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 xmlrpc_call/README diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 9b2429f1..0d307ca8 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,9 @@ +2004-11-05 Helge Hess + + * WOSimpleHTTPParser.m: set a default file boundary size and max upload + size if the Defaults.plist was not loaded (eg in xmlrpc_call with + WOHTTPConnectionUseSimpleParser) (v4.5.88) + 2004-11-15 Marcus Mueller * v4.5.87 diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 3a6ac51c..cec1772e 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=87 +SUBMINOR_VERSION:=88 # v4.5.84 required libNGExtensions v4.5.127 # v4.3.42 requires libNGExtensions v4.3.116 diff --git a/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m b/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m index 1336f2d9..595a8ecd 100644 --- a/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m +++ b/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m @@ -29,8 +29,8 @@ static Class NSStringClass = Nil; static BOOL debugOn = NO; static BOOL heavyDebugOn = NO; -static int fileIOBoundary = 16384; -static int maxUploadSize = 256 * 1024; /* 256MB */ +static int fileIOBoundary = 0; +static int maxUploadSize = 0; + (int)version { return 1; @@ -42,7 +42,12 @@ static int maxUploadSize = 256 * 1024; /* 256MB */ heavyDebugOn = [ud boolForKey:@"WOSimpleHTTPParserHeavyDebugEnabled"]; fileIOBoundary = [ud integerForKey:@"WOSimpleHTTPParserFileIOBoundary"]; maxUploadSize = [ud integerForKey:@"WOSimpleHTTPParserMaxUploadSizeInKB"]; - + + if (maxUploadSize == 0) + maxUploadSize = 256 * 1024; /* 256MB */ + if (fileIOBoundary == 0) + fileIOBoundary = 16384; + if (debugOn) { NSLog(@"WOSimpleHTTPParser: max-upload-size: %dKB", maxUploadSize); NSLog(@"WOSimpleHTTPParser: file-IO boundary: %d", fileIOBoundary); @@ -544,10 +549,12 @@ static NSString *stringForHeaderName(unsigned char *p) { } else if (self->clen > maxUploadSize*1024) { /* entity is too large */ + NSString *s; + + s = [NSString stringWithFormat:@"The maximum HTTP transaction size was " + @"exceeded (%d vs %d)", self->clen, maxUploadSize * 1024]; return [NSException exceptionWithName:@"LimitException" - reason: - @"the maximum HTTP transaction size was exceeded" - userInfo:nil]; + reason:s userInfo:nil]; } else if (self->clen > fileIOBoundary) { /* we are streaming the content to a file and use a memory mapped data */ diff --git a/sope-appserver/NGXmlRpc/NGXmlRpcClient.m b/sope-appserver/NGXmlRpc/NGXmlRpcClient.m index cade9f3f..01a8d5e0 100644 --- a/sope-appserver/NGXmlRpc/NGXmlRpcClient.m +++ b/sope-appserver/NGXmlRpc/NGXmlRpcClient.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "NGXmlRpcClient.h" #include "common.h" diff --git a/xmlrpc_call/README b/xmlrpc_call/README new file mode 100644 index 00000000..cce6a55f --- /dev/null +++ b/xmlrpc_call/README @@ -0,0 +1,7 @@ +xmlrpc_client +============= + +A shell tool to call XML-RPC web services. + +Note: you should set the WOHTTPConnectionUseSimpleParser default to YES to + ensure proper HTTP parsing. -- 2.39.2