2002-03-06 23:13:23 +00:00
|
|
|
/** GSWDefaultAdaptor.m - <title>GSWeb: Class GSWDefaultAdaptor</title>
|
2003-02-01 19:07:25 +00:00
|
|
|
|
2004-09-01 13:53:24 +00:00
|
|
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
2000-01-22 12:49:49 +00:00
|
|
|
Date: Jan 1999
|
2002-03-06 23:13:23 +00:00
|
|
|
|
|
|
|
$Revision$
|
|
|
|
$Date$
|
2003-02-01 19:07:25 +00:00
|
|
|
$Id$
|
2002-03-06 23:13:23 +00:00
|
|
|
|
|
|
|
<abstract></abstract>
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
This file is part of the GNUstep Web Library.
|
2002-03-06 23:13:23 +00:00
|
|
|
|
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-03-06 23:13:23 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-03-21 14:32:57 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
RCS_ID("$Id$")
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-01-22 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/Makefile.postamble:
o use $(LN_S) -f in install-WO-headers
o added $(MKDIRS) $(GNUSTEP_HEADERS)/$(GSWExtensions_wo_HEADER_FILES_INSTALL_DIR);
* GSWExtensionsGSW.framework/Makefile.postamble: use $(LN_S) -f in install-WO-headers
2003-01-20 David Ayers <d.ayers@inode.at>
* Makefile.postamble
o added support for make gswnames=(gsw,wo,all) (corrected
typo)
o reinserted support for $(INSTALL_ROOT_DIR)
* config.h.in
o added HAVE_GDL2
* configure
o added support for --with-gswnames=(gsw,wo,all)
o set LIBWRAP during configure
o added config.mak.in as configurable file
* configure.ac
o (see configure)
* config.mak: removed (replaced by config.mak.in)
* config.mak.in: new file
o added support for make gswnames=(gsw,wo,all)
* gsweb.make.in
o add GSANTLR as auxiliary lib
o add gsweb libs to AUXILIARY_GSW_LIBS
o include correct extensions for GSW/WO-libs
* gsweb_wo.make: new file
* GSWeb/GSWConfig.h
o changed support for GSWEB_WONAMES
o conditionally import file GSWWOCompatiblity
here instead of in GSWeb.h
* GSWeb/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o removed reference to unused files:
GSWeb.m, GSWWOCompatibility.m
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWeb/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
o remove Makefile.preamble during distclean
* GSWeb/Makefile.preamble.in
o fixed typo
* GSWeb/GSWeb.h
o moved GSW/WO-Name-mapping to GSWWOCompatibility.h
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWeb.m: removed
* GSWeb/GSWWOCompatibility.h
o changed GSWEB_WONAMES handling
o removed hybrid namespace WO subclasses
o moved & reorganized GSW/WO-Name-mapping from GSWeb.h
o inlucluded missing GSW/WO-Name-mappings
* GSWeb/GSWWOCompatibility.m: removed
* GSWeb/*.m
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWApplication.m
o remove special GSW/WO handling of WOApp
* GSWeb/WebObject/WO*: removed
* GSWeb/WebObject/WebObjects
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWExtensions/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWExtensions/Makefile.preamble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
* GSWExtensions/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
* GSWExtensions/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtWOCompatibility.h"
o replaces inclusions of
<GSWExtensions/file.h> with "file.h"
* GSWExtensions/GSWExtensions.h: new file
* GSWExtensions/WOExtensions.h: new file
* GSWExtensions/GSWExtWOCompatibility.h: new file
* GSWExtensionsGSW/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new file GSWExtGSWWOCompatibility.h
o added support to create WO header files
* GSWExtensionsGSW/Makefile.pramble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
o removed GSWExtensions from ADDITIONAL_LIB_DIRS
* GSWExtensionsGSW/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtGSWWOCompatibility.h"
* GSWExtensions/GSWExtGSWWOCompatibility.h: new file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@15675 72102866-910b-0410-8b05-ffd578937521
2003-01-22 12:24:26 +00:00
|
|
|
#include "GSWeb.h"
|
2003-10-21 11:15:56 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
#if HAVE_LIBWRAP
|
|
|
|
#include <tcpd.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_LIBWRAP
|
|
|
|
int deny_severity = LOG_WARNING;
|
|
|
|
int allow_severity = LOG_INFO;
|
|
|
|
/*static*/ void twist_option(char *value,struct request_info *request)
|
|
|
|
{
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWDefaultAdaptor
|
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
-(id)initWithName:(NSString*)name
|
|
|
|
arguments:(NSDictionary*)arguments
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
NSDebugMLog(@"Init");
|
2002-03-06 23:13:23 +00:00
|
|
|
if ((self=[super initWithName:name
|
|
|
|
arguments:arguments]))
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
_fileHandle=nil;
|
|
|
|
_threads=[NSMutableArray new];
|
|
|
|
_waitingThreads=[NSMutableArray new];
|
|
|
|
_selfLock=[NSLock new];
|
|
|
|
_port=[[arguments objectForKey:GSWOPT_Port[GSWebNamingConv]] intValue];
|
|
|
|
ASSIGN(_host,[arguments objectForKey:GSWOPT_Host[GSWebNamingConv]]);
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
// [self setInstance:_instance];
|
2002-03-06 23:13:23 +00:00
|
|
|
_queueSize=[[arguments objectForKey:GSWOPT_ListenQueueSize[GSWebNamingConv]] intValue];
|
|
|
|
_workerThreadCount=[[arguments objectForKey:GSWOPT_WorkerThreadCount[GSWebNamingConv]] intValue];
|
2003-11-24 10:11:57 +00:00
|
|
|
_workerThreadCountMin=[[arguments objectForKey:GSWOPT_WorkerThreadCountMin[GSWebNamingConv]] intValue];
|
|
|
|
_workerThreadCountMax=[[arguments objectForKey:GSWOPT_WorkerThreadCountMax[GSWebNamingConv]] intValue];
|
2002-03-06 23:13:23 +00:00
|
|
|
_isMultiThreadEnabled=[[arguments objectForKey:GSWOPT_MultiThreadEnabled] boolValue];
|
|
|
|
ASSIGN(_adaptorHost,[arguments objectForKey:GSWOPT_AdaptorHost[GSWebNamingConv]]);
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor");
|
2000-01-22 12:49:49 +00:00
|
|
|
//TODO? DESTROY(listenPortObject);
|
2002-03-06 23:13:23 +00:00
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: host");
|
|
|
|
DESTROY(_host);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: adaptorHost");
|
|
|
|
DESTROY(_adaptorHost);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: fileHandle");
|
|
|
|
DESTROY(_fileHandle);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: threads");
|
|
|
|
DESTROY(_threads);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: waitingThreads");
|
|
|
|
DESTROY(_waitingThreads);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor: selfLock");
|
|
|
|
DESTROY(_selfLock);
|
|
|
|
GSWLogMemC("Dealloc GSWDefaultAdaptor Super");
|
2000-01-22 12:49:49 +00:00
|
|
|
[super dealloc];
|
2002-03-06 23:13:23 +00:00
|
|
|
GSWLogMemC("End Dealloc GSWDefaultAdaptor");
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)registerForEvents
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"START registerForEvents - %@",
|
|
|
|
GSCurrentThread());
|
2002-03-06 23:13:23 +00:00
|
|
|
NSAssert(!_fileHandle,@"fileHandle already exists");
|
|
|
|
NSDebugDeepMLLog(@"info",@"registerForEvents port=%d",_port);
|
|
|
|
NSDebugDeepMLLog(@"info",@"registerForEvents host=%@",_host);
|
|
|
|
if (!_host)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
ASSIGN(_host,[[NSHost currentHost] name]);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
_fileHandle=[[NSFileHandle fileHandleAsServerAtAddress:_host
|
2004-09-01 13:53:24 +00:00
|
|
|
service:GSWIntToNSString(_port)
|
2000-01-22 12:49:49 +00:00
|
|
|
protocol:@"tcp"] retain];
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLLog(@"info",@"fileHandle=%p",(void*)_fileHandle);
|
2000-01-22 12:49:49 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
|
|
selector: @selector(announceNewConnection:)
|
|
|
|
name: NSFileHandleConnectionAcceptedNotification
|
2002-03-06 23:13:23 +00:00
|
|
|
object:_fileHandle];
|
2000-01-22 12:49:49 +00:00
|
|
|
/* [NotificationDispatcher addObserver:self
|
|
|
|
selector: @selector(announceNewConnection:)
|
|
|
|
name: NSFileHandleConnectionAcceptedNotification
|
|
|
|
object:fileHandle];
|
|
|
|
*/
|
2002-03-06 23:13:23 +00:00
|
|
|
[_fileHandle acceptConnectionInBackgroundAndNotify];
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"%@ - B readInProgress=%d",
|
|
|
|
GSCurrentThread(),(int)[_fileHandle readInProgress]);
|
|
|
|
[GSWApplication statusLogWithFormat:
|
|
|
|
@"Thread %@: Waiting for connections on %@:%d.",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
_host,
|
|
|
|
_port];
|
|
|
|
NSDebugDeepMLog(@"STOP registerForEvents");
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)unregisterForEvents
|
|
|
|
{
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self
|
2002-03-06 23:13:23 +00:00
|
|
|
name:NSFileHandleConnectionAcceptedNotification
|
|
|
|
object:_fileHandle];
|
2000-01-22 12:49:49 +00:00
|
|
|
/* [NotificationDispatcher removeObserver:self
|
|
|
|
name: NSFileHandleConnectionAcceptedNotification
|
|
|
|
object:fileHandle];
|
|
|
|
*/
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(_fileHandle);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-03-06 23:13:23 +00:00
|
|
|
-(void)logWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-03-06 23:13:23 +00:00
|
|
|
+(void)logWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)runOnce
|
|
|
|
{
|
|
|
|
//call doesBusyRunOnce
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)doesBusyRunOnce
|
|
|
|
{
|
|
|
|
//call _runOnce
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return NO;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)dispatchesRequestsConcurrently
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)port
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
return _port;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)host
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
return _host;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:11:57 +00:00
|
|
|
-(void)setWorkerThreadCountMin:(id)workerThreadCount
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
if ([self tryLock])
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
{
|
2003-11-24 10:11:57 +00:00
|
|
|
_workerThreadCountMin=[workerThreadCount intValue];
|
|
|
|
if (_workerThreadCountMin<1)
|
|
|
|
_workerThreadCountMin=1;
|
2002-03-06 23:13:23 +00:00
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:11:57 +00:00
|
|
|
-(id)workerThreadCountMin
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-11-24 10:11:57 +00:00
|
|
|
return [NSNumber numberWithInt:_workerThreadCountMin];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)setWorkerThreadCountMax:(id)workerThreadCount
|
|
|
|
{
|
|
|
|
if ([self tryLock])
|
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
_workerThreadCountMax=[workerThreadCount intValue];
|
|
|
|
if (_workerThreadCountMax<1)
|
|
|
|
_workerThreadCountMax=1;
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)workerThreadCountMax
|
|
|
|
{
|
|
|
|
return [NSNumber numberWithInt:_workerThreadCountMax];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)isMultiThreadEnabled
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
return _isMultiThreadEnabled;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2002-03-06 23:13:23 +00:00
|
|
|
-(void)setListenQueueSize:(id)listenQueueSize
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
if ([self tryLock])
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
_queueSize=[listenQueueSize intValue];
|
|
|
|
if (_queueSize<1)
|
|
|
|
_queueSize=1;
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2003-03-21 14:32:57 +00:00
|
|
|
-(id)announceNewConnection:(NSNotification*)notification
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
GSWDefaultAdaptorThread* newThread=nil;
|
|
|
|
NSFileHandle* listenHandle=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
NSFileHandle* inStream = nil;
|
2000-03-16 16:16:49 +00:00
|
|
|
NSCalendarDate* requestDate=nil;
|
|
|
|
NSString* requestDateString=nil;
|
2002-03-06 23:13:23 +00:00
|
|
|
NSString* connRefusedMessage=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-03-06 23:13:23 +00:00
|
|
|
listenHandle=[notification object];
|
2000-03-16 16:16:49 +00:00
|
|
|
requestDate=[NSCalendarDate calendarDate];
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
requestDateString=[NSString stringWithFormat:@"%@: New Request %@",
|
|
|
|
GSCurrentThread(),requestDate];
|
2000-03-20 15:50:51 +00:00
|
|
|
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugDeepMLLog(@"info",@"listenHandle=%p",(void*)listenHandle);
|
2000-01-22 12:49:49 +00:00
|
|
|
inStream = [[notification userInfo]objectForKey:@"NSFileHandleNotificationFileHandleItem"];
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"%@ announceNewConnection notification=%@ "
|
|
|
|
@"socketAddress=%@ [notification userInfo]=%p",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
notification,
|
|
|
|
[inStream socketAddress],
|
|
|
|
[notification userInfo]);
|
|
|
|
if (![self isConnectionAllowedWithHandle:inStream
|
|
|
|
returnedMessage:&connRefusedMessage])
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"DESTROY the connection: conn refused - "
|
|
|
|
@"%@ - A1 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
(int)[_fileHandle readInProgress]);
|
|
|
|
[GSWDefaultAdaptorThread sendConnectionRefusedResponseToStream:inStream
|
|
|
|
withMessage:connRefusedMessage];
|
|
|
|
inStream=nil;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLLog(@"info",@"notification userInfo=%@",
|
2002-03-06 23:13:23 +00:00
|
|
|
[notification userInfo]);
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"%@ - A1 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
(int)[_fileHandle readInProgress]);
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLLog(@"%@ - A1 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
(int)[_fileHandle readInProgress]);
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"NEW CONN APP _selfLockn=%d _selfLock_thread_id=%@ "
|
|
|
|
@"_globalLockn=%d _globalLock_thread_id=%@ "
|
|
|
|
@"threads count=%d waitingThreads count=%d blocked=%d",
|
|
|
|
(int)([GSWApplication application]->_selfLockn),
|
|
|
|
([GSWApplication application]->_selfLock_thread_id),
|
|
|
|
(int)([GSWApplication application]->_globalLockn),
|
|
|
|
([GSWApplication application]->_globalLock_thread_id),
|
|
|
|
[_threads count],
|
|
|
|
[_waitingThreads count],
|
|
|
|
_blocked);
|
|
|
|
NSDebugDeepMLog(@"[waitingThreads count]=%d queueSize=%d",
|
|
|
|
[_waitingThreads count],_queueSize);
|
2002-03-06 23:13:23 +00:00
|
|
|
if ([_waitingThreads count]>=_queueSize)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-10-28 10:29:17 +00:00
|
|
|
//remove expired thread
|
|
|
|
if ([self tryLock])
|
|
|
|
{
|
|
|
|
NSDebugMLog0(@"locked !");
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
int i=0;
|
|
|
|
GSWDefaultAdaptorThread* thread=nil;
|
2002-03-06 23:13:23 +00:00
|
|
|
for(i=0;i<[_waitingThreads count];)
|
2001-10-28 10:29:17 +00:00
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
thread=[_waitingThreads objectAtIndex:i];
|
2001-10-28 10:29:17 +00:00
|
|
|
if ([thread isExpired])
|
|
|
|
{
|
|
|
|
// [GSWDefaultAdaptorThread sendRetryLasterResponseToStream:[thread stream]];
|
2002-03-06 23:13:23 +00:00
|
|
|
[_waitingThreads removeObjectAtIndex:i];
|
2001-10-28 10:29:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
};
|
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
if ([_waitingThreads count]>=_queueSize)
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"DESTROY the connection: too many conn - "
|
|
|
|
@"%@ - A1 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
(int)[_fileHandle readInProgress]);
|
|
|
|
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:inStream];
|
|
|
|
inStream=nil;
|
|
|
|
}
|
|
|
|
else
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//release done after lock !
|
2002-03-06 23:13:23 +00:00
|
|
|
newThread=[[GSWDefaultAdaptorThread alloc] initWithApp:[GSWApplication application]
|
|
|
|
withAdaptor:self
|
|
|
|
withStream:inStream];
|
|
|
|
if (newThread)
|
|
|
|
{
|
|
|
|
NSDebugLockMLog0(@"_newThread !");
|
|
|
|
if ([self tryLock])
|
|
|
|
{
|
|
|
|
NSDebugLockMLog0(@"locked !");
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
NSDebugLockMLLog(@"low",
|
|
|
|
@"[waitingThreads count]=%d [threads count]=%d",
|
|
|
|
[_waitingThreads count],
|
|
|
|
[_threads count]);
|
2004-04-02 11:06:46 +00:00
|
|
|
if ([_threads count]<_workerThreadCount
|
|
|
|
|| _isMultiThreadEnabled == NO)
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
[_threads addObject:newThread];
|
|
|
|
NSDebugLockMLLog(@"trace",@"isMultiThreadEnabled=%d",
|
|
|
|
_isMultiThreadEnabled);
|
|
|
|
if (_isMultiThreadEnabled)
|
|
|
|
{
|
|
|
|
requestDate=[NSCalendarDate calendarDate];
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
requestDateString
|
|
|
|
=[NSString stringWithFormat:@"%@ : "
|
|
|
|
@"Lauch Thread (Multi) %@",
|
|
|
|
GSCurrentThread(),
|
|
|
|
requestDate];
|
|
|
|
[GSWApplication statusLogWithFormat:@"%@",
|
|
|
|
requestDateString];
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugLockMLLog(@"info",
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
@"%@ : "
|
|
|
|
@"Lauch Thread (Multi) %p",
|
|
|
|
GSCurrentThread(),
|
2002-03-06 23:13:23 +00:00
|
|
|
(void*)newThread);
|
|
|
|
[NSThread detachNewThreadSelector:@selector(run:)
|
|
|
|
toTarget:newThread
|
|
|
|
withObject:nil];
|
|
|
|
DESTROY(newThread);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Runit after
|
|
|
|
/*
|
|
|
|
[GSWApplication statusLogWithFormat:@"Lauch Thread (Mono)"];
|
|
|
|
NSDebugMLLog(@"info",
|
|
|
|
@"Lauch Thread (Mono) %p",
|
|
|
|
(void*)_newThread);
|
|
|
|
[_newThread run:nil];
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[GSWApplication statusLogWithFormat:@"Set Thread to wait"];
|
|
|
|
NSDebugLockMLLog(@"info",
|
|
|
|
@"Set Thread to wait %p",
|
|
|
|
(void*)newThread);
|
|
|
|
[_waitingThreads addObject:newThread];
|
|
|
|
DESTROY(newThread);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DESTROY(newThread);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (!_isMultiThreadEnabled && newThread)
|
|
|
|
{
|
|
|
|
requestDate=[NSCalendarDate calendarDate];
|
|
|
|
requestDateString=[NSString stringWithFormat:@"Lauch Thread (Mono) %@",requestDate];
|
|
|
|
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
|
|
|
NSDebugLockMLLog(@"info",
|
|
|
|
@"%@ %p",
|
|
|
|
requestDateString,
|
|
|
|
(void*)newThread);
|
|
|
|
[newThread run:nil];
|
|
|
|
DESTROY(newThread);
|
|
|
|
requestDate=[NSCalendarDate calendarDate];
|
|
|
|
requestDateString=[NSString stringWithFormat:@"Stop Thread (Mono) %@",requestDate];
|
|
|
|
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
|
|
|
NSDebugLockMLLog0(@"info",
|
|
|
|
requestDateString);
|
|
|
|
};
|
2001-10-28 10:29:17 +00:00
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
};
|
|
|
|
NSDebugLockMLLog(@"trace",@"Try Lock");
|
2001-10-28 10:29:17 +00:00
|
|
|
if ([self tryLock])
|
|
|
|
{
|
|
|
|
BOOL accept=YES;//NEW[waitingThreads count]<queueSize;
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugLockMLLog(@"trace",@"Accept=%d",accept);
|
2001-10-28 10:29:17 +00:00
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
if (accept)
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
[listenHandle acceptConnectionInBackgroundAndNotify];
|
|
|
|
_blocked=NO;
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"ACCEPT %@ A2 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
|
|
|
(int)[_fileHandle readInProgress]);
|
2001-10-28 10:29:17 +00:00
|
|
|
}
|
|
|
|
else
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"NOT ACCEPT %@ A2 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
|
|
|
(int)[_fileHandle readInProgress]);
|
2002-03-06 23:13:23 +00:00
|
|
|
};
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"%@ A2 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
|
|
|
(int)[_fileHandle readInProgress]);
|
2001-10-28 10:29:17 +00:00
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
2002-03-06 23:13:23 +00:00
|
|
|
_blocked=!accept;
|
2001-10-28 10:29:17 +00:00
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
2002-03-06 23:13:23 +00:00
|
|
|
_blocked=!accept;
|
|
|
|
printf("blocked=%d",_blocked);
|
2001-10-28 10:29:17 +00:00
|
|
|
[self unlock];
|
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugLockMLLog(@"trace",@"end announceNewConnection");
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"END NEWCONN APP _selfLockn=%d _selfLock_thread_id=%@ "
|
|
|
|
@"_globalLockn=%d _globalLock_thread_id=%@ "
|
|
|
|
@"threads count=%d waitingThreads count=%d "
|
|
|
|
@"blocked=%d acceptOK",
|
|
|
|
(int)([GSWApplication application]->_selfLockn),
|
|
|
|
([GSWApplication application]->_selfLock_thread_id),
|
|
|
|
(int)([GSWApplication application]->_globalLockn),
|
|
|
|
([GSWApplication application]->_globalLock_thread_id),
|
|
|
|
[_threads count],
|
|
|
|
[_waitingThreads count],
|
|
|
|
_blocked);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-03-06 23:13:23 +00:00
|
|
|
-(void)adaptorThreadExited:(GSWDefaultAdaptorThread*)adaptorThread
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2001-10-28 10:29:17 +00:00
|
|
|
// NSDebugMLLog(@"trace",@"adaptorThreadExited");
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog0(@"adaptorThreadExited");
|
|
|
|
NSDebugDeepMLog(@"EXIT APP _selfLockn=%d _selfLock_thread_id=%@ "
|
|
|
|
@"_globalLockn=%d _globalLock_thread_id=%@ "
|
|
|
|
@"threads count=%d waitingThreads count=%d blocked=%d",
|
|
|
|
(int)([GSWApplication application]->_selfLockn),
|
|
|
|
([GSWApplication application]->_selfLock_thread_id),
|
|
|
|
(int)([GSWApplication application]->_globalLockn),
|
|
|
|
([GSWApplication application]->_globalLock_thread_id),
|
|
|
|
[_threads count],
|
|
|
|
[_waitingThreads count],
|
|
|
|
_blocked);
|
2002-03-06 23:13:23 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
if ([self tryLock])
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
|
|
|
NSAutoreleasePool* pool=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-03-06 23:13:23 +00:00
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugLockMLLog(@"low",
|
|
|
|
@"remove thread %p",
|
|
|
|
(void*)adaptorThread);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-03-06 23:13:23 +00:00
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
[adaptorThread retain];
|
|
|
|
[adaptorThread autorelease];
|
|
|
|
[_threads removeObject:adaptorThread];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
|
|
|
//TODO
|
|
|
|
// [self unlock];
|
|
|
|
// [localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-03-06 23:13:23 +00:00
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
NSDebugLockMLLog(@"low",
|
|
|
|
@"[waitingThreads count]=%d [threads count]=%d",
|
|
|
|
[_waitingThreads count],
|
|
|
|
[_threads count]);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-03-06 23:13:23 +00:00
|
|
|
if ([_threads count]==0)
|
|
|
|
{
|
|
|
|
BOOL isApplicationRequestHandlingLocked=[[GSWApplication application] isRequestHandlingLocked];
|
|
|
|
if (isApplicationRequestHandlingLocked)
|
|
|
|
{
|
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGSeriousError0(@"Application RequestHandling is LOCKED !!!");
|
|
|
|
NSAssert(NO,@"Application RequestHandling is LOCKED !!!");//TODO-NOW
|
|
|
|
[[GSWApplication application] terminate];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if ([_waitingThreads count]>0 && [_threads count]<_workerThreadCount)
|
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
GSWDefaultAdaptorThread* thread=nil;
|
|
|
|
while(!thread && [_waitingThreads count]>0)
|
|
|
|
{
|
|
|
|
thread=[_waitingThreads objectAtIndex:0];
|
|
|
|
if ([thread isExpired])
|
|
|
|
{
|
|
|
|
//[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:[_thread stream]];
|
|
|
|
thread=nil;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
[_threads addObject:thread];
|
|
|
|
[_waitingThreads removeObjectAtIndex:0];
|
|
|
|
};
|
|
|
|
if (thread)
|
|
|
|
{
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-03-06 23:13:23 +00:00
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
[GSWApplication statusLogWithFormat:@"Lauch waiting Thread"];
|
|
|
|
NSDebugLockMLLog(@"info",
|
|
|
|
@"Lauch waiting Thread %p",
|
|
|
|
(void*)thread);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-03-06 23:13:23 +00:00
|
|
|
if (_isMultiThreadEnabled)
|
|
|
|
[NSThread detachNewThreadSelector:@selector(run:)
|
|
|
|
toTarget:thread
|
|
|
|
withObject:nil];
|
|
|
|
else
|
|
|
|
[thread run:nil];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
|
|
|
//TODO
|
|
|
|
// [self unlock];
|
|
|
|
// [localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
BOOL accept=[_waitingThreads count]<_queueSize;
|
|
|
|
if (_blocked && accept)
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"ACCEPT AGAIN %@ A2 readInProgress=%d",
|
|
|
|
GSCurrentThread(),
|
|
|
|
(int)[_fileHandle readInProgress]);
|
2002-03-06 23:13:23 +00:00
|
|
|
[_fileHandle acceptConnectionInBackgroundAndNotify];
|
|
|
|
_blocked=NO;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
pool=[NSAutoreleasePool new];
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("New NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGException(@"%@ (%@)",
|
|
|
|
localException,
|
|
|
|
[localException reason]);
|
2003-02-01 19:07:25 +00:00
|
|
|
GSWLogMemCF("Destroy NSAutoreleasePool: %p",pool);
|
2002-03-06 23:13:23 +00:00
|
|
|
DESTROY(pool);
|
|
|
|
//TODO
|
|
|
|
// [self unlock];
|
|
|
|
// [localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
|
|
|
|
[self unlock];
|
|
|
|
};
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugDeepMLog(@"END EXIT APP _selfLockn=%d _selfLock_thread_id=%@ "
|
|
|
|
@"_globalLockn=%d _globalLock_thread_id=%@ "
|
|
|
|
@"threads count=%d waitingThreads count=%d blocked=%d",
|
|
|
|
(int)([GSWApplication application]->_selfLockn),
|
|
|
|
([GSWApplication application]->_selfLock_thread_id),
|
|
|
|
([GSWApplication application]->_globalLockn),
|
|
|
|
([GSWApplication application]->_globalLock_thread_id),
|
|
|
|
[_threads count],
|
|
|
|
[_waitingThreads count],
|
|
|
|
_blocked);
|
2002-03-06 23:13:23 +00:00
|
|
|
// (int)(((UnixFileHandle*)fileHandle)->acceptOK));
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"%@ B2 readInProgress=%d",
|
|
|
|
GSCurrentThread(),(int)[_fileHandle readInProgress]);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
2001-10-28 10:29:17 +00:00
|
|
|
|
|
|
|
-(NSFileHandle*)fileHandle
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
return _fileHandle;
|
2001-10-28 10:29:17 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(id)announceBrokenConnection:(id)notification
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
2001-10-28 10:29:17 +00:00
|
|
|
NSDebugMLLog(@"trace",@"announceBrokenConnection");
|
2000-01-22 12:49:49 +00:00
|
|
|
// [self shutDownConnectionWithSocket:[in_port _port_socket]];
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// lock
|
|
|
|
-(BOOL)tryLock
|
|
|
|
{
|
2002-03-06 23:13:23 +00:00
|
|
|
BOOL locked=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"self=%p %@ TRYLOCK",
|
|
|
|
self, GSCurrentThread());
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
locked=LoggedTryLockBeforeDate(_selfLock,
|
|
|
|
[NSDate dateWithTimeIntervalSinceNow:90]);
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"self=%p %@ TRYLOCK LOCKED ?",
|
|
|
|
self, GSCurrentThread());
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-03-06 23:13:23 +00:00
|
|
|
return locked;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// unlock
|
|
|
|
-(void)unlock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"self=%p %@ UNLOCK",
|
|
|
|
self, GSCurrentThread());
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
LoggedUnlock(_selfLock);
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugLockMLog(@"self=%p %@ UNLOCK UNLOCKED ?",
|
|
|
|
self, GSCurrentThread());
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
-(BOOL)isConnectionAllowedWithHandle:(NSFileHandle*)handle
|
|
|
|
returnedMessage:(NSString**)retMessage
|
|
|
|
{
|
|
|
|
BOOL allowed=YES;
|
|
|
|
if ([_adaptorHost length]>0)
|
|
|
|
{
|
|
|
|
NSString* connAddress=[handle socketAddress];
|
2004-05-06 12:53:22 +00:00
|
|
|
NSDebugMLog(@"HANDLE connAddress: %@ _adaptorHost=%@",
|
|
|
|
connAddress,_adaptorHost);
|
2002-03-06 23:13:23 +00:00
|
|
|
if ([connAddress isEqualToString:_adaptorHost])
|
|
|
|
{
|
2004-05-06 12:53:22 +00:00
|
|
|
[GSWApplication statusDebugWithFormat:
|
|
|
|
@"ACCEPTED connection from: %@ (Allowed: %@)",
|
2002-03-06 23:13:23 +00:00
|
|
|
connAddress,_adaptorHost];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-06 12:53:22 +00:00
|
|
|
[GSWApplication statusLogErrorWithFormat:
|
|
|
|
@"REFUSED connection from: %@ (Allowed: %@)",
|
2002-03-06 23:13:23 +00:00
|
|
|
connAddress,_adaptorHost];
|
|
|
|
allowed=NO;
|
|
|
|
if (retMessage)
|
|
|
|
*retMessage=@"host denied";//TODO
|
|
|
|
//TODO
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#if HAVE_LIBWRAP
|
|
|
|
NSString* appName=nil;
|
|
|
|
struct request_info libwrapRequestInfo;
|
2004-05-06 12:53:22 +00:00
|
|
|
memset(&libwrapRequestInfo, 0, sizeof(libwrapRequestInfo));
|
2002-03-06 23:13:23 +00:00
|
|
|
|
2004-05-06 12:53:22 +00:00
|
|
|
appName = [[GSWApplication application] name];
|
|
|
|
request_init(&libwrapRequestInfo, RQ_DAEMON,
|
|
|
|
[appName cString], RQ_FILE, [handle fileDescriptor], 0);
|
2002-03-06 23:13:23 +00:00
|
|
|
|
|
|
|
fromhost(&libwrapRequestInfo);
|
2004-05-06 12:53:22 +00:00
|
|
|
if (STR_EQ(eval_hostname(libwrapRequestInfo.client), paranoid)
|
|
|
|
|| !hosts_access(&libwrapRequestInfo))
|
2002-03-06 23:13:23 +00:00
|
|
|
{
|
2004-05-06 12:53:22 +00:00
|
|
|
allowed = NO;
|
2002-03-06 23:13:23 +00:00
|
|
|
if (retMessage)
|
2004-05-06 12:53:22 +00:00
|
|
|
{
|
|
|
|
*retMessage = @"libwrap denied";//TODO
|
|
|
|
}
|
|
|
|
[GSWApplication statusDebugWithFormat:
|
|
|
|
@"libwrap: %@ REFUSED connection from: %s (%s)",
|
2002-03-06 23:13:23 +00:00
|
|
|
appName,
|
|
|
|
libwrapRequestInfo.client[0].name,
|
|
|
|
libwrapRequestInfo.client[0].addr];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-06 12:53:22 +00:00
|
|
|
[GSWApplication statusDebugWithFormat:
|
|
|
|
@"libwrap: %@ ACCEPTED connection from: %s (%s)",
|
2002-03-06 23:13:23 +00:00
|
|
|
appName,
|
|
|
|
libwrapRequestInfo.client[0].name,
|
|
|
|
libwrapRequestInfo.client[0].addr];
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
return allowed;
|
|
|
|
};
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWDefaultAdaptor (GSWDefaultAdaptorA)
|
|
|
|
-(void)stop
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
-(void)run
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
-(void)_runOnce
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
@end
|