From 9796174a8cec8b6e08846dcf2d68d10f8f06ea42 Mon Sep 17 00:00:00 2001 From: mguesdon Date: Tue, 6 Apr 2004 11:11:22 +0000 Subject: [PATCH] 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 --- GSWeb.framework/GSWResponse.m | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/GSWeb.framework/GSWResponse.m b/GSWeb.framework/GSWResponse.m index 6d7c083..6a34a19 100644 --- a/GSWeb.framework/GSWResponse.m +++ b/GSWeb.framework/GSWResponse.m @@ -149,7 +149,6 @@ static NSArray* cacheControlHeaderValues=nil; //-------------------------------------------------------------------- -(void)disableClientCaching { - //OK LOGObjectFnStart(); if (!_isClientCachingDisabled) { @@ -160,12 +159,9 @@ static NSArray* cacheControlHeaderValues=nil; [self setHeader:@"no-cache" forKey:@"pragma"]; - //TODO later - /* - if([GSWApp _allowsCacheControlHeader]) + if([[GSWApp class] _allowsCacheControlHeader]) [self setHeaders:cacheControlHeaderValues forKey:@"cache-control"]; - */ _isClientCachingDisabled=YES; }; LOGObjectFnStop(); @@ -261,7 +257,6 @@ static NSArray* cacheControlHeaderValues=nil; //-------------------------------------------------------------------- -(void)_finalizeInContext:(GSWContext*)aContext { - //OK GSWRequest* request=nil; int applicationNumber=-1; int dataLength=0; @@ -287,15 +282,19 @@ static NSArray* cacheControlHeaderValues=nil; [self _resolveContentFaultsInContext:aContext]; + // Finalize cookies [self _finalizeCookiesInContext:aContext]; - request=[aContext request]; - applicationNumber=[request applicationNumber]; - NSDebugMLLog(@"low",@"applicationNumber=%d",applicationNumber); - //TODO - /* if (_applicationNumber>=0) - { - LOGError(); //TODO - }; */ + + // Add load info to headers + if (![self headersForKey:GSWHTTPHeader_LoadAverage[GSWebNamingConv]]) + [self setHeader:[NSString stringWithFormat:@"%d",[GSWApp activeSessionsCount]] + forKey:GSWHTTPHeader_LoadAverage[GSWebNamingConv]]; + + // 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];