mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-31 01:01:19 +00:00
o finalized -disableClientCaching
o in -_finalizeInContext: add load info to headers o in -_finalizeInContext: new session refusing info git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@19040 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d2c9f51a5f
commit
9796174a8c
1 changed files with 13 additions and 14 deletions
|
@ -149,7 +149,6 @@ static NSArray* cacheControlHeaderValues=nil;
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)disableClientCaching
|
-(void)disableClientCaching
|
||||||
{
|
{
|
||||||
//OK
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (!_isClientCachingDisabled)
|
if (!_isClientCachingDisabled)
|
||||||
{
|
{
|
||||||
|
@ -160,12 +159,9 @@ static NSArray* cacheControlHeaderValues=nil;
|
||||||
[self setHeader:@"no-cache"
|
[self setHeader:@"no-cache"
|
||||||
forKey:@"pragma"];
|
forKey:@"pragma"];
|
||||||
|
|
||||||
//TODO later
|
if([[GSWApp class] _allowsCacheControlHeader])
|
||||||
/*
|
|
||||||
if([GSWApp _allowsCacheControlHeader])
|
|
||||||
[self setHeaders:cacheControlHeaderValues
|
[self setHeaders:cacheControlHeaderValues
|
||||||
forKey:@"cache-control"];
|
forKey:@"cache-control"];
|
||||||
*/
|
|
||||||
_isClientCachingDisabled=YES;
|
_isClientCachingDisabled=YES;
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -261,7 +257,6 @@ static NSArray* cacheControlHeaderValues=nil;
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_finalizeInContext:(GSWContext*)aContext
|
-(void)_finalizeInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
|
||||||
GSWRequest* request=nil;
|
GSWRequest* request=nil;
|
||||||
int applicationNumber=-1;
|
int applicationNumber=-1;
|
||||||
int dataLength=0;
|
int dataLength=0;
|
||||||
|
@ -287,15 +282,19 @@ static NSArray* cacheControlHeaderValues=nil;
|
||||||
|
|
||||||
[self _resolveContentFaultsInContext:aContext];
|
[self _resolveContentFaultsInContext:aContext];
|
||||||
|
|
||||||
|
// Finalize cookies
|
||||||
[self _finalizeCookiesInContext:aContext];
|
[self _finalizeCookiesInContext:aContext];
|
||||||
request=[aContext request];
|
|
||||||
applicationNumber=[request applicationNumber];
|
// Add load info to headers
|
||||||
NSDebugMLLog(@"low",@"applicationNumber=%d",applicationNumber);
|
if (![self headersForKey:GSWHTTPHeader_LoadAverage[GSWebNamingConv]])
|
||||||
//TODO
|
[self setHeader:[NSString stringWithFormat:@"%d",[GSWApp activeSessionsCount]]
|
||||||
/* if (_applicationNumber>=0)
|
forKey:GSWHTTPHeader_LoadAverage[GSWebNamingConv]];
|
||||||
{
|
|
||||||
LOGError(); //TODO
|
// Add refusing new sessions info to headers
|
||||||
}; */
|
if ([GSWApp isRefusingNewSessions]
|
||||||
|
&& ![self headersForKey:GSWHTTPHeader_RefuseSessions[GSWebNamingConv]])
|
||||||
|
[self setHeader:[NSString stringWithFormat:@"%d",(int)[GSWApp _refuseNewSessionsTimeInterval]]
|
||||||
|
forKey:GSWHTTPHeader_RefuseSessions[GSWebNamingConv]];
|
||||||
|
|
||||||
[self _finalizeContentEncodingInContext:aContext];
|
[self _finalizeContentEncodingInContext:aContext];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue