From: helge Date: Thu, 23 Sep 2004 15:33:04 +0000 (+0000) Subject: cleaned up WOPort processing X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cc25bbf1a98e5999ceb80c784bae00881e6ca98;p=sope cleaned up WOPort processing git-svn-id: http://svn.opengroupware.org/SOPE/trunk@166 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 161bd92a..19af8e53 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,5 +1,16 @@ 2004-09-23 Helge Hess + + * v4.3.43 + * WOCoreApplication.m: improved handling of WOPort default (detect + numeric ports) + + * Defaults.plist: changed default WOPort value from '"*:20000"' to + just 20000 (which is the same like *:20000' but compatible to WO) + + * WOHttpAdaptor/WOHttpAdaptor.m: for numberic WOPort's, retrieve the + port from the WOApplication object + * WOCoreApplication.m: use NGResourceLocator to determine search pathes (v4.3.42) diff --git a/sope-appserver/NGObjWeb/Defaults.plist b/sope-appserver/NGObjWeb/Defaults.plist index 9ec5f0c2..e06361c4 100644 --- a/sope-appserver/NGObjWeb/Defaults.plist +++ b/sope-appserver/NGObjWeb/Defaults.plist @@ -75,7 +75,7 @@ WOPageRequestHandlerDebugEnabled = NO; WOParsersUseUTF8 = NO; WOPermanentPageCacheSize = 30; - WOPort = "*:20000"; + WOPort = 20000; WOProfileApplication = NO; WOProfileComponents = NO; WOProfileDirectActionRequestHandler = NO; diff --git a/sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h b/sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h index 96b783a5..e27219da 100644 --- a/sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h +++ b/sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #ifndef __NGHttp_NGHttpMessage_H__ #define __NGHttp_NGHttpMessage_H__ diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index d3b8ad7c..1920b68b 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=42 +SUBMINOR_VERSION:=43 # v4.3.42 requires libNGExtensions v4.3.116 # v4.3.40 requires libNGExtensions v4.3.115 diff --git a/sope-appserver/NGObjWeb/WOCoreApplication.m b/sope-appserver/NGObjWeb/WOCoreApplication.m index 145fe2f3..7bac89fd 100644 --- a/sope-appserver/NGObjWeb/WOCoreApplication.m +++ b/sope-appserver/NGObjWeb/WOCoreApplication.m @@ -732,6 +732,10 @@ static NSMutableArray *activeApps = nil; // THREAD apath = [self findNGObjWebResource:@"Defaults" ofType:@"plist"]; if (apath == nil) NSLog(@"ERROR: cannot find Defaults.plist resource of NGObjWeb library!"); +#if HEAVY_DEBUG + else + NSLog(@"Note: loading default defaults: %@", apath); +#endif owDefaults = [NSDictionary dictionaryWithContentsOfFile:apath]; if (owDefaults) { @@ -779,13 +783,16 @@ static NSMutableArray *activeApps = nil; // THREAD woport = [[self userDefaults] objectForKey:@"WOPort"]; if ([woport isKindOfClass:[NSNumber class]]) return woport; - woport = [woport stringValue]; + if ([woport length] > 0 && isdigit([woport characterAtIndex:0])) + return [NSNumber numberWithInt:[woport intValue]]; + addr = NGSocketAddressFromString(woport); if ([addr isKindOfClass:[NGInternetSocketAddress class]]) return [NSNumber numberWithInt:[(NGInternetSocketAddress *)addr port]]; - + + NSLog(@"GOT NO PORT FOR ADDR: %@ (%@)", addr, woport); return nil; } diff --git a/sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m b/sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m index e5e3cb6e..b3ebf709 100644 --- a/sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m +++ b/sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m @@ -68,6 +68,10 @@ static BOOL HTTP_PERFLOG = NO; @end +@interface WOCoreApplication(Port) +- (NSNumber *)port; +@end + @implementation WOHttpAdaptor static BOOL WOHttpAdaptor_LogStream = NO; @@ -160,25 +164,26 @@ static BOOL debugOn = NO; #endif if ([_args count] < 1) { - NSString *arg; const char *cstr; - arg = WOPort; - self->address = nil; - if ([arg isEqualToString:@"auto"]) { + if ([WOPort isEqualToString:@"auto"]) self->address = [self autoBindAddress]; - } - if ((self->address == nil) && (cstr = [arg cString])) { + if ((self->address == nil) && ((cstr = [WOPort cString]) != NULL)) { if (isdigit(*cstr)) { + NSNumber *p; + + p = [(WOCoreApplication *)[_application class] port]; + if (p == nil) p = (id)WOPort; + self->address = - [NGInternetSocketAddress wildcardAddressWithPort:[arg intValue]]; + [NGInternetSocketAddress wildcardAddressWithPort:[p intValue]]; } } if (self->address == nil) - self->address = NGSocketAddressFromString(arg); + self->address = NGSocketAddressFromString(WOPort); } else { NSString *arg = nil; diff --git a/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m b/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m index 25471b1f..1336f2d9 100644 --- a/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m +++ b/sope-appserver/NGObjWeb/WOSimpleHTTPParser.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "WOSimpleHTTPParser.h" #include