mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 03:01:27 +00:00
GSWeb.framework/GSWApplication.m
* added _setHostAddress:, hostAddress GSWeb.framework/GSWRequest.h * added _originatingAddress, _originatingPort GSWeb.framework/GSWDisplayGroup.h * changed undoManager to be id as compile fix for TCSDB. GSWeb.framework/GSWApplication+Defaults.m * added hostAddress GSWeb.framework/GSWHTTPIO.h * added _setAlwaysAppendContentLength GSWeb.framework/GSWHTTPIO.m * added _alwaysAppendContentLength * added + (void) _getConnectionInfoFromHandle:remoteAddress:remotePort: * set originatingAddress and port to request now. GSWeb.framework/GSWApplication.h * added _hostAddress, hostAddress, _setHostAddress * removed lots of @interface lines. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@29321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c348aec6a2
commit
b9f96bd1d9
9 changed files with 242 additions and 147 deletions
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
|||
2010-01-20 David Wetzel <dave@turbocat.de>
|
||||
GSWeb.framework/GSWApplication.m
|
||||
* added _setHostAddress:, hostAddress
|
||||
|
||||
GSWeb.framework/GSWRequest.h
|
||||
* added _originatingAddress, _originatingPort
|
||||
|
||||
GSWeb.framework/GSWDisplayGroup.h
|
||||
* changed undoManager to be id as compile fix for TCSDB.
|
||||
|
||||
GSWeb.framework/GSWApplication+Defaults.m
|
||||
* added hostAddress
|
||||
|
||||
GSWeb.framework/GSWHTTPIO.h
|
||||
* added _setAlwaysAppendContentLength
|
||||
|
||||
GSWeb.framework/GSWHTTPIO.m
|
||||
* added _alwaysAppendContentLength
|
||||
* added + (void) _getConnectionInfoFromHandle:remoteAddress:remotePort:
|
||||
* set originatingAddress and port to request now.
|
||||
|
||||
GSWeb.framework/GSWApplication.h
|
||||
* added _hostAddress, hostAddress, _setHostAddress
|
||||
* removed lots of @interface lines.
|
||||
|
||||
2009-06-12 David Wetzel <dave@turbocat.de>
|
||||
GSWAdaptors/Apache2/GNUmakefile.in
|
||||
* added -g to include debug info as default
|
||||
|
|
|
@ -1311,7 +1311,10 @@ static NSString *_dflt_host = nil;
|
|||
/*
|
||||
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setHost:)
|
||||
withObject:host_];
|
||||
- (NSString*) hostAddress;
|
||||
|
||||
*/
|
||||
[GSWApp _setHostAddress:[[NSHost hostWithName:host] address]];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
@ -90,6 +90,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
NSString* _instanceNumber;
|
||||
NSMutableDictionary* _requestHandlers;
|
||||
GSWRequestHandler* _defaultRequestHandler;
|
||||
NSString* _hostAddress;
|
||||
@public //TODO-NOW REMOVE
|
||||
NSRecursiveLock* _selfLock;
|
||||
#ifndef NDEBUG
|
||||
|
@ -133,6 +134,9 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
id _recorder;
|
||||
}
|
||||
|
||||
- (NSString*) hostAddress;
|
||||
-(void) _setHostAddress:(NSString *) hostAdr;
|
||||
|
||||
-(void)dealloc;
|
||||
-(id)init;
|
||||
|
||||
|
@ -164,52 +168,47 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
-(void)lockRequestHandling;
|
||||
|
||||
-(NSString*)defaultRequestHandlerClassName;
|
||||
|
||||
-(Class)defaultRequestHandlerClass;
|
||||
|
||||
- (NSString*) sessionIdKey;
|
||||
|
||||
- (NSString*) instanceIdKey;
|
||||
@end
|
||||
//
|
||||
////====================================================================
|
||||
@interface GSWApplication (GSWApplicationA)
|
||||
|
||||
-(void)becomesMultiThreaded;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationB)
|
||||
-(NSString*)_webserverConnectURL;
|
||||
|
||||
-(NSString*)_directConnectURL;
|
||||
|
||||
-(NSString*)_applicationExtension;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationC)
|
||||
-(void)_resetCacheForGeneration;
|
||||
-(void)_resetCache;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationD)
|
||||
-(void)_resetCache;
|
||||
|
||||
-(GSWComponentDefinition*) _componentDefinitionWithName:(NSString*)aName
|
||||
languages:(NSArray*)languages;
|
||||
|
||||
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)aName
|
||||
languages:(NSArray*)languages;
|
||||
|
||||
-(GSWComponentDefinition*)lockedLoadComponentDefinitionWithName:(NSString*)aName
|
||||
language:(NSString*)language;
|
||||
-(NSArray*)lockedComponentBearingFrameworks;
|
||||
|
||||
-(NSArray*)lockedInitComponentBearingFrameworksFromBundleArray:(NSArray*)bundles;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationE)
|
||||
-(Class)contextClass;
|
||||
|
||||
-(GSWContext*)createContextForRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(Class)responseClass;
|
||||
|
||||
-(GSWResponse*)createResponseInContext:(GSWContext*)aContext;
|
||||
|
||||
-(Class)requestClass;
|
||||
|
||||
-(GSWRequest*)createRequestWithMethod:(NSString*)aMethod
|
||||
uri:(NSString*)anURL
|
||||
httpVersion:(NSString*)aVersion
|
||||
|
@ -218,174 +217,182 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
userInfo:(NSDictionary*)userInfo;
|
||||
|
||||
-(GSWResourceManager*)createResourceManager;
|
||||
|
||||
-(GSWStatisticsStore*)createStatisticsStore;
|
||||
|
||||
-(GSWSessionStore*)createSessionStore;
|
||||
|
||||
-(void)_discountTerminatedSession;
|
||||
|
||||
-(void)_finishInitializingSession:(GSWSession*)aSession;
|
||||
|
||||
-(GSWSession*)_initializeSessionInContext:(GSWContext*)aContext;
|
||||
|
||||
-(int)lockedDecrementActiveSessionCount;
|
||||
|
||||
-(int)lockedIncrementActiveSessionCount;
|
||||
|
||||
-(int)_activeSessionsCount;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationF)
|
||||
-(void)_setContext:(GSWContext*)aContext;
|
||||
// Internal Use only
|
||||
-(GSWContext*)_context;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationG)
|
||||
|
||||
-(BOOL)_isDynamicLoadingEnabled;
|
||||
|
||||
-(void)_disableDynamicLoading;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationI)
|
||||
|
||||
-(BOOL)_isPageRecreationEnabled;
|
||||
|
||||
-(void)_touchPrincipalClasses;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationJ)
|
||||
|
||||
-(NSString*)_newLocationForRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(void)_connectionDidDie:(id)unknown;
|
||||
|
||||
-(BOOL)_shouldKill;
|
||||
|
||||
-(void)_setShouldKill:(BOOL)flag;
|
||||
|
||||
-(void)_synchronizeInstanceSettingsWithMonitor:(id)aMonitor;
|
||||
|
||||
-(BOOL)_setupForMonitoring;
|
||||
|
||||
-(id)_remoteMonitor;
|
||||
|
||||
-(NSString*)_monitorHost;
|
||||
|
||||
-(NSString*)_monitorApplicationName;
|
||||
|
||||
-(void)_terminateFromMonitor;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationK)
|
||||
-(void)_validateAPI;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWAdaptorManagement)
|
||||
|
||||
-(NSArray*)adaptors;
|
||||
|
||||
-(GSWAdaptor*)adaptorWithName:(NSString*)aName
|
||||
arguments:(NSDictionary*)someArguments;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWCacheManagement)
|
||||
|
||||
-(BOOL)isCachingEnabled;
|
||||
-(void)setCachingEnabled:(BOOL)flag;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWSessionManagement)
|
||||
-(void)setCachingEnabled:(BOOL)flag;
|
||||
|
||||
-(GSWSessionStore*)sessionStore;
|
||||
|
||||
-(void)setSessionStore:(GSWSessionStore*)sessionStore;
|
||||
|
||||
-(GSWSession*)createSessionForRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(GSWSession*)_createSessionForRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(Class)_sessionClass;
|
||||
|
||||
-(Class)sessionClass;//NDFN
|
||||
|
||||
-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWSession*)_restoreSessionWithID:(NSString*)aSessionID
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)saveSessionForContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWPageManagement)
|
||||
-(void)saveSessionForContext:(GSWContext*)aContext;
|
||||
|
||||
-(unsigned int)pageCacheSize;
|
||||
|
||||
-(void)setPageCacheSize:(unsigned int)aSize;
|
||||
|
||||
-(unsigned)permanentPageCacheSize;
|
||||
|
||||
-(void)setPermanentPageCacheSize:(unsigned)aSize;
|
||||
|
||||
-(BOOL)isPageRefreshOnBacktrackEnabled;
|
||||
|
||||
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
|
||||
|
||||
-(GSWComponent*)pageWithName:(NSString*)aName
|
||||
forRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(GSWComponent*)pageWithName:(NSString*)aName
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(NSString*)defaultPageName;//NDFN
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWElementCreation)
|
||||
-(NSString*)defaultPageName;//NDFN
|
||||
|
||||
-(GSWElement*)dynamicElementWithName:(NSString *)aName
|
||||
associations:(NSDictionary*)someAssociations
|
||||
template:(GSWElement*)templateElement
|
||||
languages:(NSArray*)languages;
|
||||
|
||||
-(GSWElement*)lockedDynamicElementWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)someAssociations
|
||||
template:(GSWElement*)templateElement
|
||||
languages:(NSArray*)languages;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWRunning)
|
||||
-(NSRunLoop*)runLoop;
|
||||
|
||||
-(void)threadWillExit;//NDFN
|
||||
|
||||
-(void)run;
|
||||
|
||||
-(BOOL)runOnce;
|
||||
|
||||
-(void)setTimeOut:(NSTimeInterval)aTimeInterval;
|
||||
|
||||
-(NSTimeInterval)timeOut;
|
||||
|
||||
-(void)terminate;
|
||||
|
||||
-(BOOL)isTerminating;
|
||||
|
||||
-(void)_scheduleApplicationTimerForTimeInterval:(NSTimeInterval)aTimeInterval;
|
||||
|
||||
-(NSDate*)lastAccessDate;//NDFN
|
||||
|
||||
-(NSDate*)startDate;//NDFN
|
||||
|
||||
-(void)lockedAddTimer:(NSTimer*)aTimer;//NDFN
|
||||
-(void)addTimer:(NSTimer*)aTimer;//NDFN
|
||||
-(void)_setNextCollectionCount:(int)_count;
|
||||
-(void)_sessionDidTimeOutNotification:(NSNotification*)notification_;
|
||||
-(void)_openInitialURL;
|
||||
-(void)_openURL:(NSString*)_url;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWRequestHandling)
|
||||
-(void)addTimer:(NSTimer*)aTimer;//NDFN
|
||||
|
||||
-(void)_setNextCollectionCount:(int)_count;
|
||||
|
||||
-(void)_sessionDidTimeOutNotification:(NSNotification*)notification_;
|
||||
|
||||
-(void)_openInitialURL;
|
||||
|
||||
-(void)_openURL:(NSString*)_url;
|
||||
|
||||
-(GSWResponse*)dispatchRequest:(GSWRequest*)aRequest;
|
||||
|
||||
-(void)awake;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)_setRecordingHeadersToResponse:(GSWResponse*)aResponse
|
||||
forRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)sleep;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWErrorHandling)
|
||||
-(GSWResponse*)handleException:(NSException*)exception
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)handlePageRestorationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)_handlePageRestorationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)handleSessionCreationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)_handleSessionCreationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)handleSessionRestorationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)_handleSessionRestorationErrorInContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWResponse*)handleActionRequestErrorWithRequest:(GSWRequest*)aRequest
|
||||
exception:(NSException*)exception
|
||||
reason:(NSString*)reason
|
||||
|
@ -394,57 +401,50 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
actionName:(NSString*)actionName
|
||||
actionClass:(Class)actionClass
|
||||
actionObject:(GSWAction*)actionObject;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWConveniences)
|
||||
+(void)_setApplication:(GSWApplication*)application;
|
||||
+(GSWApplication*)application;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWHTMLTemplateParsingDebugging)
|
||||
-(BOOL)printsHTMLParserDiagnostics;
|
||||
-(void)setPrintsHTMLParserDiagnostics:(BOOL)flag;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWScriptedObjectSupport)
|
||||
-(Class)scriptedClassWithPath:(NSString*)path;
|
||||
-(Class)scriptedClassWithPath:(NSString*)path
|
||||
encoding:(NSStringEncoding)encoding;
|
||||
-(Class)_classWithScriptedClassName:(NSString*)aName
|
||||
languages:(NSArray*)languages;
|
||||
-(void)_setClassFromNameResolutionEnabled:(BOOL)flag;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWLibrarySupport)
|
||||
-(Class)libraryClassWithPath:(NSString*)path;//NDFN
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWDebugging)
|
||||
-(void)debugWithString:(NSString*)string;
|
||||
|
||||
-(void)debugWithFormat:(NSString*)format
|
||||
arguments:(va_list)someArgumentsu;
|
||||
|
||||
-(void)debugWithFormat:(NSString*)formatString,...;
|
||||
|
||||
+(void)debugWithFormat:(NSString*)formatString,...;
|
||||
|
||||
-(void)logString:(NSString*)string;
|
||||
|
||||
+(void)logString:(NSString*)string;
|
||||
|
||||
-(void)logWithFormat:(NSString*)aFormat,...;
|
||||
|
||||
+(void)logWithFormat:(NSString*)aFormat,...;
|
||||
|
||||
-(void)logWithFormat:(NSString*)formatString
|
||||
arguments:(va_list)arguments;
|
||||
|
||||
-(void)logErrorString:(NSString*)string;
|
||||
|
||||
+(void)logErrorString:(NSString*)string;
|
||||
|
||||
-(void)logErrorWithFormat:(NSString*)aFormat,...;
|
||||
|
||||
+(void)logErrorWithFormat:(NSString*)aFormat,...;
|
||||
|
||||
-(void)logErrorWithFormat:(NSString*)formatString
|
||||
arguments:(va_list)arguments;
|
||||
|
||||
|
@ -485,13 +485,9 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
-(void)_setTracingAspect:(id)unknwon
|
||||
enabled:(BOOL)enabled;
|
||||
-(void)debugAdaptorThreadExited;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
//NDFN
|
||||
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
|
||||
@interface GSWApplication (GSWDebuggingStatus)
|
||||
|
||||
-(void)statusDebugWithString:(NSString*)aString;
|
||||
-(void)statusDebugWithFormat:(NSString*)aFormat
|
||||
arguments:(va_list)arguments;
|
||||
|
@ -516,17 +512,11 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
|
||||
-(void)statusLogErrorWithFormat:(NSString*)aFormat
|
||||
arguments:(va_list)arguments;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWStatisticsSupport)
|
||||
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore;
|
||||
-(NSDictionary*)statistics;//bycopy
|
||||
-(GSWStatisticsStore*)statisticsStore;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (MonitorableApplication)
|
||||
-(BOOL)monitoringEnabled;
|
||||
-(int)activeSessionsCount;
|
||||
-(int)minimumActiveSessionsCount;
|
||||
|
@ -536,16 +526,10 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
-(NSTimeInterval)_refuseNewSessionsTimeInterval;
|
||||
-(void)logToMonitorWithFormat:(NSString*)aFormat;
|
||||
-(void)terminateAfterTimeInterval:(NSTimeInterval)aTimeInterval;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWResourceManagerSupport)
|
||||
-(void)setResourceManager:(GSWResourceManager*)resourceManager;
|
||||
-(GSWResourceManager*)resourceManager;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (RequestDispatching)
|
||||
-(GSWRequestHandler*)defaultRequestHandler;
|
||||
|
||||
-(void)setDefaultRequestHandler:(GSWRequestHandler*)handler;
|
||||
|
@ -560,10 +544,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
-(GSWRequestHandler*)requestHandlerForKey:(NSString*)aKey;
|
||||
|
||||
-(GSWRequestHandler*)handlerForRequest:(GSWRequest*)aRequest;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationDefaults)
|
||||
+(void)_initRegistrationDomainDefaults;
|
||||
+(void)_initUserDefaultsKeys;
|
||||
|
||||
|
@ -576,10 +557,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
-(NSString*)responseClassName;
|
||||
-(void)setRequestClassName:(NSString*)className;
|
||||
-(NSString*)requestClassName;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (UserDefaults)
|
||||
+(NSArray*)loadFrameworks;
|
||||
+(void)setLoadFrameworks:(NSArray*)frameworks;
|
||||
+(BOOL)isDebuggingEnabled;
|
||||
|
@ -628,10 +606,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
+(void)setStatisticsStoreClassName:(NSString*)name;
|
||||
+(void)setSessionTimeOut:(NSNumber*)aTimeOut;
|
||||
+(NSNumber*)sessionTimeOut;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWUserDefaults)
|
||||
+(BOOL)isStatusDebuggingEnabled;//NDFN
|
||||
+(void)setStatusDebuggingEnabled:(BOOL)flag;//NDFN
|
||||
+(BOOL)isStatusLoggingEnabled;//NDFN
|
||||
|
@ -684,53 +659,35 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
+(void)setDefaultDisplayExceptionPages:(BOOL)flag;//NDFN
|
||||
+(void)_setAllowsCacheControlHeader:(BOOL)flag;
|
||||
+(BOOL)_allowsCacheControlHeader;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationInternals)
|
||||
+(NSDictionary*)_webServerConfigDictionary;
|
||||
+(Class)_applicationClass;
|
||||
+(Class)_compiledApplicationClass;
|
||||
+(GSWRequestHandler*)_componentRequestHandler;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationClassB)
|
||||
+(id)defaultModelGroup;
|
||||
+(id)_modelGroupFromBundles:(id)_bundles;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationClassC)
|
||||
-(NSDictionary*)mainBundleInfoDictionary;
|
||||
+(NSDictionary*)mainBundleInfoDictionary;
|
||||
-(NSDictionary*)bundleInfo;
|
||||
+(NSDictionary*)bundleInfo;
|
||||
-(NSBundle*)mainBundle;
|
||||
+(NSBundle*)mainBundle;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationClassD)
|
||||
+(int)_garbageCollectionRepeatCount;
|
||||
+(BOOL)_lockDefaultEditingContext;
|
||||
+(void)_setLockDefaultEditingContext:(BOOL)flag;
|
||||
+(id)_allowsConcurrentRequestHandling;
|
||||
+(void)_setAllowsConcurrentRequestHandling:(id)unknown;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWApplicationClassE)
|
||||
+(int)_requestLimit;
|
||||
+(int)_requestWindow;
|
||||
+(BOOL)_multipleThreads;
|
||||
+(BOOL)_multipleInstances;
|
||||
+(void)_readLicenseParameters;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (NDFN)
|
||||
//NDFN
|
||||
-(id)propListWithResourceNamed:(NSString*)aName
|
||||
ofType:(NSString*)aType
|
||||
|
|
|
@ -430,6 +430,23 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
GSWLogMemC("End Dealloc GSWApplication");
|
||||
};
|
||||
|
||||
|
||||
-(void) _setHostAddress:(NSString *) hostAdr
|
||||
{
|
||||
[_hostAddress release];
|
||||
_hostAddress = [hostAdr retain];
|
||||
}
|
||||
|
||||
- (NSString*) hostAddress
|
||||
{
|
||||
if(_hostAddress == nil)
|
||||
{
|
||||
_hostAddress = [[[NSHost currentHost] address] retain];
|
||||
}
|
||||
return _hostAddress;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
{
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
};
|
||||
|
||||
+ (GSWDisplayGroup* )displayGroup;
|
||||
- (EOUndoManager*)undoManager;
|
||||
- (id)undoManager;
|
||||
- (NSArray *)allObjects;
|
||||
- (NSArray *)allQualifierOperators;
|
||||
- (unsigned)batchCount;
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
|
||||
}
|
||||
|
||||
+ _setAlwaysAppendContentLength:(BOOL) yn;
|
||||
|
||||
+ (BOOL) _alwaysAppendContentLength;
|
||||
|
||||
+ (GSWRequest*) readRequestFromFromHandle:(NSFileHandle*) fh;
|
||||
|
||||
+ (void) sendResponse:(GSWResponse*) response
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "GSWMessage.h"
|
||||
#include "GSWResponse.h"
|
||||
#include "GSWRequest.h"
|
||||
#include <netinet/in.h>
|
||||
|
||||
#define READ_SIZE 2048
|
||||
|
||||
|
@ -56,6 +57,8 @@ static NSString *NEWLINE2 = @"\r\n";
|
|||
static NSString *HTTP11 = @"HTTP/1.1";
|
||||
static NSString *CONNECTION = @"connection";
|
||||
static NSString *KEEP_ALIVE = @"keep-alive";
|
||||
static BOOL _alwaysAppendContentLength = YES;
|
||||
|
||||
//static NSString *CLOSE = @"close";
|
||||
|
||||
|
||||
|
@ -103,11 +106,22 @@ static NSString *KEEP_ALIVE = @"keep-alive";
|
|||
return d;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation GSWHTTPIO
|
||||
|
||||
/* Apple is accessing this in Application.java in wotaskd example code -- dw */
|
||||
+ _setAlwaysAppendContentLength:(BOOL) yn
|
||||
{
|
||||
_alwaysAppendContentLength = yn;
|
||||
}
|
||||
|
||||
+ (BOOL) _alwaysAppendContentLength
|
||||
{
|
||||
return _alwaysAppendContentLength;
|
||||
}
|
||||
|
||||
// PRIVATE
|
||||
void _unpackHeaderLineAddToDict(NSString *line, NSMutableDictionary* headers)
|
||||
|
@ -222,7 +236,7 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
|
|||
}
|
||||
}
|
||||
|
||||
if (contentLength > 0) {
|
||||
if ((contentLength > 0) || _alwaysAppendContentLength) {
|
||||
[headers appendString:CONTENT_LENGTHCOLON];
|
||||
[headers appendString:[NSString stringWithFormat:@"%d\r\n", contentLength]];
|
||||
}
|
||||
|
@ -237,6 +251,28 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
|
|||
}
|
||||
|
||||
|
||||
//PRIVATE
|
||||
+ (void) _getConnectionInfoFromHandle:(NSFileHandle*) fh
|
||||
remoteAddress:(NSString**) rAddress
|
||||
remotePort:(uint16_t*) rPort
|
||||
{
|
||||
int fileDescriptor = [(GSFileHandle*) fh fileDescriptor];
|
||||
struct sockaddr_in sockAddress;
|
||||
socklen_t address_len = sizeof(sockAddress);
|
||||
struct sockaddr_in sockaddrIn;
|
||||
char str[INET_ADDRSTRLEN];
|
||||
|
||||
if (getpeername(fileDescriptor, (struct sockaddr *) &sockAddress, &address_len) == 0) {
|
||||
|
||||
inet_ntop(AF_INET, &sockAddress.sin_addr, str, sizeof(str));
|
||||
|
||||
*rAddress = [NSString stringWithUTF8String:str];
|
||||
|
||||
*rPort = ntohs(sockAddress.sin_port);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+ (NSDictionary*) readHeadersFromHandle:(NSFileHandle*) fh
|
||||
{
|
||||
NSData *currentLineData = nil;
|
||||
|
@ -327,9 +363,17 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
|
|||
NSString * method = nil;
|
||||
NSData * contentData = nil;
|
||||
GSWRequest * request = nil;
|
||||
uint16_t rPort = 0;
|
||||
NSString * rAddress = nil;
|
||||
|
||||
[(GSFileHandle*) fh setNonBlocking: NO];
|
||||
|
||||
// get info about who talks to us
|
||||
|
||||
[self _getConnectionInfoFromHandle: fh
|
||||
remoteAddress: &rAddress
|
||||
remotePort: &rPort];
|
||||
|
||||
requestArray = [self readRequestLineFromHandle:fh];
|
||||
if ((!requestArray) || ([requestArray count] <3)) {
|
||||
return nil;
|
||||
|
@ -341,6 +385,7 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
|
|||
}
|
||||
|
||||
method = [requestArray objectAtIndex:0];
|
||||
|
||||
|
||||
if ((tmpValue = [headers objectForKey:CONTENT_LENGTH]) && ([tmpValue count])) {
|
||||
NSString * tmpString = [tmpValue objectAtIndex:0];
|
||||
|
@ -358,6 +403,15 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
|
|||
content:contentData
|
||||
userInfo:nil];
|
||||
|
||||
if (request != nil)
|
||||
{
|
||||
[request _setOriginatingAddress:rAddress];
|
||||
[request _setOriginatingPort:rPort];
|
||||
// [request _setAcceptingAddress:xxx];
|
||||
// [request _setAcceptingPort:yyy];
|
||||
}
|
||||
|
||||
|
||||
return [request autorelease];
|
||||
}
|
||||
|
||||
|
|
|
@ -66,17 +66,19 @@ Cf RFC 2616 (http://www.rfc-editor.org/rfc/rfc2616.txt)
|
|||
@private
|
||||
NSString* _method;
|
||||
GSWDynamicURLString* _uri;
|
||||
NSStringEncoding _defaultFormValueEncoding;
|
||||
NSStringEncoding _formValueEncoding;
|
||||
NSDictionary* _formValues;
|
||||
NSDictionary* _uriElements;
|
||||
NSDictionary* _cookie;
|
||||
BOOL _finishedParsingMultipartFormData;
|
||||
NSString* _applicationURLPrefix;
|
||||
NSArray* _requestHandlerPathArray;
|
||||
NSArray* _browserLanguages;
|
||||
NSArray* _browserAcceptedEncodings;
|
||||
int _requestType;
|
||||
NSStringEncoding _defaultFormValueEncoding;
|
||||
NSStringEncoding _formValueEncoding;
|
||||
NSDictionary* _formValues;
|
||||
NSDictionary* _uriElements;
|
||||
NSDictionary* _cookie;
|
||||
BOOL _finishedParsingMultipartFormData;
|
||||
NSString* _applicationURLPrefix;
|
||||
NSArray* _requestHandlerPathArray;
|
||||
NSArray* _browserLanguages;
|
||||
NSArray* _browserAcceptedEncodings;
|
||||
int _requestType;
|
||||
NSString* _originatingAddress;
|
||||
uint16_t _originatingPort;
|
||||
BOOL _isUsingWebServer;
|
||||
BOOL _formValueEncodingDetectionEnabled;
|
||||
int _applicationNumber;
|
||||
|
@ -222,6 +224,12 @@ Cf RFC 2616 (http://www.rfc-editor.org/rfc/rfc2616.txt)
|
|||
-(NSDictionary*)uriOrFormOrCookiesElements;
|
||||
|
||||
-(void)_validateAPI;
|
||||
|
||||
-(NSString*) _originatingAddress;
|
||||
-(void) _setOriginatingAddress:(NSString*) anAddress;
|
||||
- (uint16_t) _originatingPort;
|
||||
- (void) _setOriginatingPort:(uint16_t) aPort;
|
||||
|
||||
@end
|
||||
|
||||
#endif //_GSWRequest_h__
|
||||
|
|
|
@ -151,6 +151,7 @@ RCS_ID("$Id$")
|
|||
-(void)dealloc
|
||||
{
|
||||
DESTROY(_value);
|
||||
|
||||
[super dealloc];
|
||||
};
|
||||
|
||||
|
@ -261,6 +262,7 @@ RCS_ID("$Id$")
|
|||
DESTROY(_requestHandlerPathArray);
|
||||
DESTROY(_browserLanguages);
|
||||
DESTROY(_browserAcceptedEncodings);
|
||||
DESTROY(_originatingAddress);
|
||||
|
||||
[super dealloc];
|
||||
};
|
||||
|
@ -282,6 +284,8 @@ RCS_ID("$Id$")
|
|||
ASSIGNCOPY(clone->_requestHandlerPathArray,_requestHandlerPathArray);
|
||||
ASSIGNCOPY(clone->_browserLanguages,_browserLanguages);
|
||||
ASSIGNCOPY(clone->_browserAcceptedEncodings,_browserAcceptedEncodings);
|
||||
ASSIGNCOPY(clone->_originatingAddress,_originatingAddress);
|
||||
|
||||
clone->_requestType=_requestType;
|
||||
clone->_isUsingWebServer=_isUsingWebServer;
|
||||
clone->_formValueEncodingDetectionEnabled=_formValueEncodingDetectionEnabled;
|
||||
|
@ -2280,4 +2284,27 @@ into
|
|||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
};
|
||||
|
||||
|
||||
-(NSString*) _originatingAddress
|
||||
{
|
||||
return _originatingAddress;
|
||||
}
|
||||
|
||||
-(void) _setOriginatingAddress:(NSString*) anAddress
|
||||
{
|
||||
[_originatingAddress release];
|
||||
_originatingAddress = [anAddress retain];
|
||||
}
|
||||
|
||||
- (uint16_t) _originatingPort
|
||||
{
|
||||
return _originatingPort;
|
||||
}
|
||||
|
||||
- (void) _setOriginatingPort:(uint16_t) aPort
|
||||
{
|
||||
_originatingPort = aPort;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue