mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 11:11:21 +00:00
* GSWeb/GSWContext.m
- computeQueryDictionaryWithPath:queryDictionary:otherQueryDictionary use boolValue. This fixes ?wosid in links where it not has to be. * GSWeb/GSWMessage.h remove _contentEncodingIMP, GSWMessage_contentEncoding * GSWeb/GSWMessage.m remove contentEncodingSEL, GSWMessage_contentEncoding() * GSWeb/GSWUtils.h remove NSStringEncoding remove + encodingNamed: * GSWeb/GSWUtils.m remove encodingsByName remove + encodingNamed: * GSWeb/GSWResponse.h remove GSWResponse_contentEncoding * GSWeb/GSWBundle.m use [GSMimeDocument encodingFromCharset:encodingObject] not + encodingNamed (which we trashed above) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@30782 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a4b0f2705b
commit
42c4a4c771
8 changed files with 32 additions and 98 deletions
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
||||||
|
2010-06-18 David Wetzel <dave@turbocat.de>
|
||||||
|
* GSWeb/GSWContext.m
|
||||||
|
- computeQueryDictionaryWithPath:queryDictionary:otherQueryDictionary
|
||||||
|
use boolValue.
|
||||||
|
This fixes ?wosid in links where it not has to be.
|
||||||
|
* GSWeb/GSWMessage.h
|
||||||
|
remove _contentEncodingIMP, GSWMessage_contentEncoding
|
||||||
|
* GSWeb/GSWMessage.m
|
||||||
|
remove contentEncodingSEL, GSWMessage_contentEncoding()
|
||||||
|
* GSWeb/GSWUtils.h
|
||||||
|
remove NSStringEncoding
|
||||||
|
remove + encodingNamed:
|
||||||
|
* GSWeb/GSWUtils.m
|
||||||
|
remove encodingsByName
|
||||||
|
remove + encodingNamed:
|
||||||
|
* GSWeb/GSWResponse.h
|
||||||
|
remove GSWResponse_contentEncoding
|
||||||
|
* GSWeb/GSWBundle.m
|
||||||
|
use [GSMimeDocument encodingFromCharset:encodingObject]
|
||||||
|
not + encodingNamed (which we trashed above)
|
||||||
|
|
||||||
2010-06-17 David Wetzel <dave@turbocat.de>
|
2010-06-17 David Wetzel <dave@turbocat.de>
|
||||||
* GSWAdaptors/Apache2/mod_gsw.c
|
* GSWAdaptors/Apache2/mod_gsw.c
|
||||||
minor cleanups, avoid missing filename message to logs
|
minor cleanups, avoid missing filename message to logs
|
||||||
|
|
|
@ -38,6 +38,7 @@ RCS_ID("$Id$")
|
||||||
#include "GSWeb.h"
|
#include "GSWeb.h"
|
||||||
#include <GNUstepBase/NSObject+GNUstepBase.h>
|
#include <GNUstepBase/NSObject+GNUstepBase.h>
|
||||||
#include "WOKeyValueUnarchiver.h"
|
#include "WOKeyValueUnarchiver.h"
|
||||||
|
#include <GNUstepBase/GSMime.h>
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWBundleUnarchiverDelegate : NSObject
|
@interface GSWBundleUnarchiverDelegate : NSObject
|
||||||
|
@ -842,14 +843,20 @@ RCS_ID("$Id$")
|
||||||
//NSLog(@"encodingObject is '%@'", encodingObject);
|
//NSLog(@"encodingObject is '%@'", encodingObject);
|
||||||
//encodingObject is 'NSISOLatin1StringEncoding'
|
//encodingObject is 'NSISOLatin1StringEncoding'
|
||||||
//not very cool to make a int into a string and some time later a string..
|
//not very cool to make a int into a string and some time later a string..
|
||||||
encodingObject=GSWIntToNSString([NSString encodingNamed: encodingObject]);
|
|
||||||
|
encoding = [GSMimeDocument encodingFromCharset:encodingObject];
|
||||||
|
|
||||||
|
if ((encoding == 0)) {
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"Resource named %@ -- unknown encoding '%@'", aName, encodingObject];
|
||||||
|
}
|
||||||
|
|
||||||
|
encodingObject=GSWIntToNSString(encoding);
|
||||||
[_encodingCache setObject:encodingObject
|
[_encodingCache setObject:encodingObject
|
||||||
forKey:aName];
|
forKey:aName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (encodingObject)
|
|
||||||
encoding=[encodingObject intValue];
|
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
|
|
@ -1884,8 +1884,7 @@ If none, try request languages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECKME: can [newQueryDictionary sessionID] be a NO/FALSE value?
|
if ((sessionId != nil) && ([[newQueryDictionary sessionID] boolValue])) {
|
||||||
if ((sessionId != nil) && ([newQueryDictionary sessionID] == nil)) {
|
|
||||||
[newQueryDictionary setObject:sessionId
|
[newQueryDictionary setObject:sessionId
|
||||||
forKey:[GSWApp sessionIdKey]];
|
forKey:[GSWApp sessionIdKey]];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
typedef struct _GSWMessageIMPs
|
typedef struct _GSWMessageIMPs
|
||||||
{
|
{
|
||||||
// Instance IMPs
|
// Instance IMPs
|
||||||
GSWIMP_STRING_ENCODING _contentEncodingIMP;
|
|
||||||
IMP _contentIMP;
|
IMP _contentIMP;
|
||||||
IMP _contentStringIMP;
|
IMP _contentStringIMP;
|
||||||
IMP _appendContentAsciiStringIMP;
|
IMP _appendContentAsciiStringIMP;
|
||||||
|
@ -64,7 +63,6 @@ typedef struct _GSWMessageIMPs
|
||||||
GSWEB_EXPORT void GetGSWMessageIMPs(GSWMessageIMPs* impsPtr,GSWMessage* message);
|
GSWEB_EXPORT void GetGSWMessageIMPs(GSWMessageIMPs* impsPtr,GSWMessage* message);
|
||||||
|
|
||||||
/** functions to accelerate calls of frequently used GSWMessage methods **/
|
/** functions to accelerate calls of frequently used GSWMessage methods **/
|
||||||
GSWEB_EXPORT NSStringEncoding GSWMessage_contentEncoding(GSWMessage* aMessage);
|
|
||||||
GSWEB_EXPORT NSData* GSWMessage_content(GSWMessage* aMessage);
|
GSWEB_EXPORT NSData* GSWMessage_content(GSWMessage* aMessage);
|
||||||
GSWEB_EXPORT NSString* GSWMessage_contentString(GSWMessage* aMessage);
|
GSWEB_EXPORT NSString* GSWMessage_contentString(GSWMessage* aMessage);
|
||||||
GSWEB_EXPORT void GSWMessage_appendContentAsciiString(GSWMessage* aMessage,NSString* aString);
|
GSWEB_EXPORT void GSWMessage_appendContentAsciiString(GSWMessage* aMessage,NSString* aString);
|
||||||
|
|
|
@ -43,7 +43,6 @@ static NSString* globalDefaultURLEncoding=nil;
|
||||||
|
|
||||||
static SEL appendDataSel = NULL;
|
static SEL appendDataSel = NULL;
|
||||||
|
|
||||||
static SEL contentEncodingSEL = NULL;
|
|
||||||
static SEL contentSEL = NULL;
|
static SEL contentSEL = NULL;
|
||||||
static SEL contentStringSEL = NULL;
|
static SEL contentStringSEL = NULL;
|
||||||
|
|
||||||
|
@ -71,18 +70,6 @@ static SEL stringByConvertingToHTMLSEL = NULL;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
/** functions to accelerate calls of frequently used GSWMessage methods **/
|
/** functions to accelerate calls of frequently used GSWMessage methods **/
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
NSStringEncoding GSWMessage_contentEncoding(GSWMessage* aMessage)
|
|
||||||
{
|
|
||||||
if (aMessage)
|
|
||||||
{
|
|
||||||
return (*(aMessage->_selfMsgIMPs._contentEncodingIMP))
|
|
||||||
(aMessage,contentEncodingSEL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return (NSStringEncoding)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
NSData* GSWMessage_content(GSWMessage* aMessage)
|
NSData* GSWMessage_content(GSWMessage* aMessage)
|
||||||
{
|
{
|
||||||
|
@ -329,11 +316,6 @@ void GetGSWMessageIMPs(GSWMessageIMPs* impsPtr,GSWMessage* message)
|
||||||
NSCAssert(message,@"No message");
|
NSCAssert(message,@"No message");
|
||||||
|
|
||||||
Class messageClass=object_getClass(message);
|
Class messageClass=object_getClass(message);
|
||||||
|
|
||||||
NSCAssert(contentEncodingSEL,@"No contentEncodingSEL on GetGSWMessageIMPs");
|
|
||||||
|
|
||||||
impsPtr->_contentEncodingIMP =
|
|
||||||
(GSWIMP_STRING_ENCODING)[message methodForSelector:contentEncodingSEL];
|
|
||||||
|
|
||||||
impsPtr->_contentIMP =
|
impsPtr->_contentIMP =
|
||||||
[message methodForSelector:contentSEL];
|
[message methodForSelector:contentSEL];
|
||||||
|
@ -413,9 +395,6 @@ static __inline__ NSMutableData *_checkBody(GSWMessage *self) {
|
||||||
appendDataSel = @selector(appendData:);
|
appendDataSel = @selector(appendData:);
|
||||||
NSAssert(appendDataSel,@"No appendDataSel");
|
NSAssert(appendDataSel,@"No appendDataSel");
|
||||||
|
|
||||||
contentEncodingSEL = @selector(contentEncoding);
|
|
||||||
NSAssert(contentEncodingSEL,@"No contentEncodingSEL");
|
|
||||||
|
|
||||||
contentSEL = @selector(content);
|
contentSEL = @selector(content);
|
||||||
NSAssert(contentSEL,@"No contentSEL");
|
NSAssert(contentSEL,@"No contentSEL");
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,6 @@ GSWEB_EXPORT void GetGSWResponseIMPs(GSWResponseIMPs* impsPtr,GSWResponse* aResp
|
||||||
GSWEB_EXPORT void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse* aResponse,NSString* aString,id value,BOOL escaping);
|
GSWEB_EXPORT void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse* aResponse,NSString* aString,id value,BOOL escaping);
|
||||||
|
|
||||||
/** functions to accelerate calls of frequently used GSResponse methods **/
|
/** functions to accelerate calls of frequently used GSResponse methods **/
|
||||||
#define GSWResponse_contentEncoding(aResponse) \
|
|
||||||
GSWMessage_contentEncoding(aResponse)
|
|
||||||
#define GSWResponse_content(aResponse) \
|
#define GSWResponse_content(aResponse) \
|
||||||
GSWMessage_content(aResponse)
|
GSWMessage_content(aResponse)
|
||||||
#define GSWResponse_contentString(aResponse) \
|
#define GSWResponse_contentString(aResponse) \
|
||||||
|
|
|
@ -72,7 +72,6 @@ typedef long (*GSWIMP_LONG)(id, SEL, ...);
|
||||||
typedef BOOL (*GSWIMP_BOOL)(id, SEL, ...);
|
typedef BOOL (*GSWIMP_BOOL)(id, SEL, ...);
|
||||||
typedef float (*GSWIMP_FLOAT)(id, SEL, ...);
|
typedef float (*GSWIMP_FLOAT)(id, SEL, ...);
|
||||||
typedef double (*GSWIMP_DOUBLE)(id, SEL, ...);
|
typedef double (*GSWIMP_DOUBLE)(id, SEL, ...);
|
||||||
typedef NSStringEncoding (*GSWIMP_STRING_ENCODING)(id, SEL, ...);
|
|
||||||
|
|
||||||
GSWEB_EXPORT NSNumber* GSWNumber_Yes();
|
GSWEB_EXPORT NSNumber* GSWNumber_Yes();
|
||||||
GSWEB_EXPORT NSNumber* GSWNumber_No();
|
GSWEB_EXPORT NSNumber* GSWNumber_No();
|
||||||
|
@ -448,8 +447,6 @@ typedef enum _NSNumFmtType
|
||||||
|
|
||||||
+ (id)stringWithContentsOfFile:(NSString *)path
|
+ (id)stringWithContentsOfFile:(NSString *)path
|
||||||
encoding:(NSStringEncoding)encoding;
|
encoding:(NSStringEncoding)encoding;
|
||||||
|
|
||||||
+ (NSStringEncoding) encodingNamed:(NSString*) encodingName;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
|
@ -68,8 +68,6 @@ static Class nsStringClass=Nil;
|
||||||
static Class nsMutableStringClass=Nil;
|
static Class nsMutableStringClass=Nil;
|
||||||
static Class eoNullClass=Nil;
|
static Class eoNullClass=Nil;
|
||||||
|
|
||||||
static NSMapTable* encodingsByName=NULL;
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void GSWInitializeAllMisc()
|
void GSWInitializeAllMisc()
|
||||||
{
|
{
|
||||||
|
@ -111,53 +109,6 @@ void GSWInitializeAllMisc()
|
||||||
nsString_stringWithCString_lengthIMP = [nsStringClass methodForSelector:stringWithCString_lengthSEL];
|
nsString_stringWithCString_lengthIMP = [nsStringClass methodForSelector:stringWithCString_lengthSEL];
|
||||||
NSCAssert(nsString_stringWithCString_lengthIMP,@"No IMP for stringWithCString:length:");
|
NSCAssert(nsString_stringWithCString_lengthIMP,@"No IMP for stringWithCString:length:");
|
||||||
|
|
||||||
// Encodings
|
|
||||||
encodingsByName=NSCreateMapTable(NSObjectMapKeyCallBacks,
|
|
||||||
NSIntMapValueCallBacks,
|
|
||||||
32);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSISOLatin1StringEncoding",
|
|
||||||
(const void*)NSISOLatin1StringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSASCIIStringEncoding",
|
|
||||||
(const void*)NSASCIIStringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSISOLatin2StringEncoding",
|
|
||||||
(const void*)NSISOLatin2StringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSJapaneseEUCStringEncoding",
|
|
||||||
(const void*)NSJapaneseEUCStringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSMacOSRomanStringEncoding",
|
|
||||||
(const void*)NSMacOSRomanStringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSNEXTSTEPStringEncoding",
|
|
||||||
(const void*)NSNEXTSTEPStringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSNonLossyASCIIStringEncoding",
|
|
||||||
(const void*)NSNonLossyASCIIStringEncoding);
|
|
||||||
|
|
||||||
// we might need this for compatibility. -- dw
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"UTF-8",
|
|
||||||
(const void*)NSUTF8StringEncoding);
|
|
||||||
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSUTF8StringEncoding",
|
|
||||||
(const void*)NSUTF8StringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSUnicodeStringEncoding",
|
|
||||||
(const void*)NSUnicodeStringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSWindowsCP1253StringEncoding",
|
|
||||||
(const void*)NSWindowsCP1253StringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSWindowsCP1252StringEncoding",
|
|
||||||
(const void*)NSWindowsCP1252StringEncoding);
|
|
||||||
NSMapInsert(encodingsByName,
|
|
||||||
@"NSWindowsCP1254StringEncoding",
|
|
||||||
(const void*)NSWindowsCP1254StringEncoding);
|
|
||||||
|
|
||||||
// NSString+HTML
|
// NSString+HTML
|
||||||
NSStringHTML_Initialize();
|
NSStringHTML_Initialize();
|
||||||
};
|
};
|
||||||
|
@ -2061,22 +2012,6 @@ NSString* GSWGetDefaultDocRoot()
|
||||||
return tmpString;
|
return tmpString;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
+ (NSStringEncoding) encodingNamed:(NSString*) encodingName
|
|
||||||
{
|
|
||||||
NSStringEncoding encoding;
|
|
||||||
|
|
||||||
NSCAssert(encodingsByName,@"encodingsByName not initialized");
|
|
||||||
|
|
||||||
encoding=(NSStringEncoding)NSMapGet(encodingsByName,(const void*)encodingName);
|
|
||||||
if (!encoding)
|
|
||||||
[NSException raise:NSInvalidArgumentException
|
|
||||||
format:@"%s: does not know about '%s'",
|
|
||||||
__PRETTY_FUNCTION__, encodingName];
|
|
||||||
|
|
||||||
return encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
Loading…
Reference in a new issue