Monotone-Parent: bca01c4b6bca68557777af637fd2dfc8b775df37
Monotone-Revision: ee4ff9bf4febdfd103bba6fa3403eb4d6bf3023b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T13:42:57 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
a2ca7e48d7
commit
a6e5d5340b
|
@ -1,3 +1,10 @@
|
||||||
|
2011-03-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* Main/SOGo.m (+initialize): moved most initialization code from
|
||||||
|
-init and -run here since this method is invoked before forking
|
||||||
|
and data memory is in "copy-on-write" mode, slightly reducing
|
||||||
|
memory usage of combined SOGo processes.
|
||||||
|
|
||||||
2011-03-29 Francis Lachapelle <flachapelle@inverse.ca>
|
2011-03-29 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/Appointments/iCalEvent+SOGo.m
|
* SoObjects/Appointments/iCalEvent+SOGo.m
|
||||||
|
|
58
Main/SOGo.m
58
Main/SOGo.m
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2005-2010 Inverse inc.
|
Copyright (C) 2005-2011 Inverse inc.
|
||||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||||
|
|
||||||
This file is part of SOGo
|
This file is part of SOGo
|
||||||
|
@ -40,6 +40,8 @@
|
||||||
#import <NGObjWeb/WOResponse.h>
|
#import <NGObjWeb/WOResponse.h>
|
||||||
|
|
||||||
#import <NGExtensions/NGBundleManager.h>
|
#import <NGExtensions/NGBundleManager.h>
|
||||||
|
#import <NGExtensions/NGLogger.h>
|
||||||
|
#import <NGExtensions/NGLoggerManager.h>
|
||||||
#import <NGExtensions/NSNull+misc.h>
|
#import <NGExtensions/NSNull+misc.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||||
|
@ -82,26 +84,49 @@ static BOOL trustProxyAuthentication;
|
||||||
static BOOL debugLeaks;
|
static BOOL debugLeaks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
+ (void) logWithFormat: (NSString *) format, ...
|
||||||
|
{
|
||||||
|
static NGLogger *sogoLogger = nil;
|
||||||
|
NGLoggerManager *lmgr;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
if (!sogoLogger)
|
||||||
|
{
|
||||||
|
lmgr = [NGLoggerManager defaultLoggerManager];
|
||||||
|
sogoLogger = [lmgr loggerForClass: [self class]];
|
||||||
|
}
|
||||||
|
va_start (ap, format);
|
||||||
|
[sogoLogger logWithFormat: format arguments:ap];
|
||||||
|
va_end (ap);
|
||||||
|
}
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
SOGoSystemDefaults *defaults;
|
SOGoSystemDefaults *defaults;
|
||||||
SoClassSecurityInfo *sInfo;
|
SoClassSecurityInfo *sInfo;
|
||||||
NSArray *basicRoles;
|
NSArray *basicRoles;
|
||||||
|
|
||||||
|
[self logWithFormat: @"version %d.%d.%d (build %@) -- starting",
|
||||||
|
SOGO_MAJOR_VERSION, SOGO_MINOR_VERSION, SOGO_SUBMINOR_VERSION,
|
||||||
|
SOGoBuildDate];
|
||||||
|
|
||||||
defaults = [SOGoSystemDefaults sharedSystemDefaults];
|
defaults = [SOGoSystemDefaults sharedSystemDefaults];
|
||||||
doCrashOnSessionCreate = [defaults crashOnSessionCreate];
|
doCrashOnSessionCreate = [defaults crashOnSessionCreate];
|
||||||
debugRequests = [defaults debugRequests];
|
debugRequests = [defaults debugRequests];
|
||||||
#ifdef GNUSTEP_BASE_LIBRARY
|
#ifdef GNUSTEP_BASE_LIBRARY
|
||||||
debugLeaks = [defaults debugLeaks];
|
debugLeaks = [defaults debugLeaks];
|
||||||
|
if (debugLeaks)
|
||||||
|
[self logWithFormat: @"activating leak debugging"];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* vMem size check - default is 384MB */
|
/* vMem size check - default is 384MB */
|
||||||
vMemSizeLimit = [defaults vmemLimit];
|
vMemSizeLimit = [defaults vmemLimit];
|
||||||
|
if (vMemSizeLimit > 0)
|
||||||
|
[self logWithFormat: @"vmem size check enabled: shutting down app when "
|
||||||
|
@"vmem > %d MB", vMemSizeLimit];
|
||||||
|
|
||||||
/* SoClass security declarations */
|
/* SoClass security declarations */
|
||||||
sInfo = [self soClassSecurityInfo];
|
sInfo = [self soClassSecurityInfo];
|
||||||
/* require View permission to access the root (bound to authenticated ...) */
|
|
||||||
// [sInfo declareObjectProtected: SoPerm_View];
|
|
||||||
|
|
||||||
/* to allow public access to all contained objects (subkeys) */
|
/* to allow public access to all contained objects (subkeys) */
|
||||||
[sInfo setDefaultAccess: @"allow"];
|
[sInfo setDefaultAccess: @"allow"];
|
||||||
|
@ -113,6 +138,14 @@ static BOOL debugLeaks;
|
||||||
|
|
||||||
trustProxyAuthentication = [defaults trustProxyAuthentication];
|
trustProxyAuthentication = [defaults trustProxyAuthentication];
|
||||||
useRelativeURLs = [defaults useRelativeURLs];
|
useRelativeURLs = [defaults useRelativeURLs];
|
||||||
|
|
||||||
|
/* ensure core SoClass'es are setup */
|
||||||
|
[$(@"SOGoObject") soClass];
|
||||||
|
[$(@"SOGoContentObject") soClass];
|
||||||
|
[$(@"SOGoFolder") soClass];
|
||||||
|
|
||||||
|
/* load products */
|
||||||
|
[[SOGoProductLoader productLoader] loadAllProducts];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
|
@ -121,14 +154,6 @@ static BOOL debugLeaks;
|
||||||
{
|
{
|
||||||
WOResourceManager *rm;
|
WOResourceManager *rm;
|
||||||
|
|
||||||
/* ensure core SoClass'es are setup */
|
|
||||||
[$(@"SOGoObject") soClass];
|
|
||||||
[$(@"SOGoContentObject") soClass];
|
|
||||||
[$(@"SOGoFolder") soClass];
|
|
||||||
|
|
||||||
/* load products */
|
|
||||||
[[SOGoProductLoader productLoader] loadAllProducts];
|
|
||||||
|
|
||||||
/* setup resource manager */
|
/* setup resource manager */
|
||||||
rm = [[WEResourceManager alloc] init];
|
rm = [[WEResourceManager alloc] init];
|
||||||
[self setResourceManager:rm];
|
[self setResourceManager:rm];
|
||||||
|
@ -243,15 +268,6 @@ static BOOL debugLeaks;
|
||||||
|
|
||||||
- (void) run
|
- (void) run
|
||||||
{
|
{
|
||||||
[self logWithFormat: @"version %d.%d.%d (build %@) -- starting",
|
|
||||||
SOGO_MAJOR_VERSION, SOGO_MINOR_VERSION, SOGO_SUBMINOR_VERSION,
|
|
||||||
SOGoBuildDate];
|
|
||||||
if (debugLeaks)
|
|
||||||
[self logWithFormat: @"activating leak debugging"];
|
|
||||||
if (vMemSizeLimit > 0)
|
|
||||||
[self logWithFormat: @"vmem size check enabled: shutting down app when "
|
|
||||||
@"vmem > %d MB", vMemSizeLimit];
|
|
||||||
|
|
||||||
if (!hasCheckedTables)
|
if (!hasCheckedTables)
|
||||||
{
|
{
|
||||||
hasCheckedTables = YES;
|
hasCheckedTables = YES;
|
||||||
|
|
Loading…
Reference in New Issue