1 Index: sope-mime/NGImap4/NGImap4Connection.m
2 ===================================================================
3 --- sope-mime/NGImap4/NGImap4Connection.m (révision 1546)
4 +++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail)
7 if (debugCache) [self logWithFormat:@" no folders cached yet .."];
9 - result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"*")
10 + result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"")
12 if (![[result valueForKey:@"result"] boolValue]) {
13 [self errorWithFormat:@"Could not list mailbox hierarchy!"];
14 Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m
15 ===================================================================
16 --- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1546)
17 +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail)
19 enumerator = [_flags objectEnumerator];
21 while ((obj = [enumerator nextObject])) {
22 - if (![obj isNotEmpty])
25 - if (![[obj substringToIndex:1] isEqualToString:@"\\"])
28 - objs[cnt] = [obj substringFromIndex:1];
30 + if ([obj isNotEmpty]) {
31 + if ([obj hasPrefix:@"\\"])
32 + objs[cnt] = [obj substringFromIndex:1];
38 result = [NSArray arrayWithObjects:objs count:cnt];
40 Index: sope-mime/NGImap4/NGImap4ResponseParser.m
41 ===================================================================
42 --- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1546)
43 +++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail)
45 static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
46 BOOL isBodyStructure);
48 +static NSArray *_parseLanguages();
50 static NSString *_parseBodyString(NGImap4ResponseParser *self,
52 static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self,
54 static NSNumber *_parseUnsigned(NGImap4ResponseParser *self);
55 static NSString *_parseUntil(NGImap4ResponseParser *self, char _c);
56 static NSString *_parseUntil2(NGImap4ResponseParser *self, char _c1, char _c2);
57 +static BOOL _endsWithCQuote(NSString *_string);
59 static __inline__ NSException *_consumeIfMatch
60 (NGImap4ResponseParser *self, unsigned char _m);
64 - (NSString *)_parseQuotedString {
65 + NSMutableString *quotedString;
66 + NSString *tmpString;
69 /* parse a quoted string, eg '"' */
70 if (_la(self, 0) == '"') {
72 - return _parseUntil(self, '"');
73 + quotedString = [NSMutableString string];
76 + tmpString = _parseUntil(self, '"');
77 + [quotedString appendString: tmpString];
78 + if(_endsWithCQuote(tmpString)) {
79 + [quotedString deleteSuffix: @"\\"];
80 + [quotedString appendString: @"\""];
91 + return quotedString;
93 - (void)_consumeOptionalSpace {
94 if (_la(self, 0) == ' ') _consume(self, 1);
96 route = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
97 mailbox = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
98 host = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
101 if (_la(self, 0) != ')') {
102 [self logWithFormat:@"WARNING: IMAP4 envelope "
103 @"address not properly closed (c0=%c,c1=%c): %@",
104 @@ -1197,6 +1219,7 @@
105 address = [[NGImap4EnvelopeAddress alloc] initWithPersonalName:pname
106 sourceRoute:route mailbox:mailbox
112 @@ -1627,6 +1650,29 @@
113 return _parseBodyDecodeString(self, _convertString, NO /* no decode */);
116 +static NSArray *_parseLanguages(NGImap4ResponseParser *self) {
117 + NSMutableArray *languages;
118 + NSString *language;
120 + languages = [NSMutableArray array];
121 + if (_la(self, 0) == '(') {
122 + while (_la(self, 0) != ')') {
124 + language = _parseBodyString(self, YES);
125 + if ([language length])
126 + [languages addObject: language];
131 + language = _parseBodyString(self, YES);
132 + if ([language length])
133 + [languages addObject: language];
139 static NSDictionary *_parseBodyParameterList(NGImap4ResponseParser *self)
141 NSMutableDictionary *list;
142 @@ -1734,10 +1780,11 @@
143 *encoding, *bodysize;
144 NSDictionary *parameterList;
145 NSMutableDictionary *dict;
146 + NSArray *languages;
148 type = [_parseBodyString(self, YES) lowercaseString];
149 _consumeIfMatch(self, ' ');
150 - subtype = _parseBodyString(self, YES);
151 + subtype = [_parseBodyString(self, YES) lowercaseString];
152 _consumeIfMatch(self, ' ');
153 parameterList = _parseBodyParameterList(self);
154 _consumeIfMatch(self, ' ');
155 @@ -1762,7 +1809,8 @@
156 _consumeIfMatch(self, ' ');
157 [dict setObject:_parseBodyString(self, YES) forKey:@"lines"];
159 - else if ([type isEqualToString:@"message"]) {
160 + else if ([type isEqualToString:@"message"]
161 + && [subtype isEqualToString:@"rfc822"]) {
162 if (_la(self, 0) != ')') {
163 _consumeIfMatch(self, ' ');
164 _consumeIfMatch(self, '(');
165 @@ -1805,14 +1853,9 @@
166 forKey: @"disposition"];
167 if (_la(self, 0) != ')') {
169 - if (_la(self, 0) == '(') {
170 - [dict setObject: _parseBodyParameterList(self)
171 - forKey: @"language"];
174 - [dict setObject: _parseBodyString(self, YES)
175 - forKey: @"language"];
177 + languages = _parseLanguages(self);
178 + if ([languages count])
179 + [dict setObject: languages forKey: @"languages"];
180 if (_la(self, 0) != ')') {
182 [dict setObject: _parseBodyString(self, YES)
183 @@ -1829,6 +1872,7 @@
184 static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
185 BOOL isBodyStructure) {
186 NSMutableArray *parts;
187 + NSArray *languages;
189 NSMutableDictionary *dict;
191 @@ -1854,14 +1898,9 @@
192 forKey: @"disposition"];
193 if (_la(self, 0) != ')') {
195 - if (_la(self, 0) == '(') {
196 - [dict setObject: _parseBodyParameterList(self)
197 - forKey: @"language"];
200 - [dict setObject: _parseBodyString(self, YES)
201 - forKey: @"language"];
203 + languages = _parseLanguages(self);
204 + if ([languages count])
205 + [dict setObject: languages forKey: @"languages"];
206 if (_la(self, 0) != ')') {
208 [dict setObject: _parseBodyString(self, YES)
209 @@ -2170,6 +2209,21 @@
213 +static BOOL _endsWithCQuote(NSString *_string){
214 + unsigned int quoteSlashes;
218 + pos = [_string length] - 1;
220 + && [_string characterAtIndex: pos] == '\\') {
225 + return ((quoteSlashes % 2) == 1);
228 - (NSException *)exceptionForFailedMatch:(unsigned char)_match
229 got:(unsigned char)_avail
231 Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m
232 ===================================================================
233 --- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1546)
234 +++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail)
235 @@ -285,24 +285,16 @@
236 - (id)parseValue:(id)_data ofHeaderField:(NSString *)_field {
238 NSCalendarDate *date = nil;
239 - unsigned char buf[256];
240 - unsigned char *bytes = buf, *pe;
241 + unsigned char *bytes, *pe;
243 NSTimeZone *tz = nil;
244 char dayOfMonth, monthOfYear, hour, minute, second;
248 - if ((length = [_data cStringLength]) > 254) {
249 - [self logWithFormat:
250 - @"header field value to large for date parsing: '%@'(%i)",
255 - [_data getCString:(char *)buf maxLength:length];
256 - buf[length] = '\0';
259 + length = [_data length];
260 + bytes = [_data cString];
262 /* remove leading chars (skip to first digit, the day of the month) */
263 while (length > 0 && (!isdigit(*bytes))) {
265 Index: sope-mime/NGMime/NGMimeBodyPart.m
266 ===================================================================
267 --- sope-mime/NGMime/NGMimeBodyPart.m (révision 1546)
268 +++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail)
273 -static NGMimeType *defaultType = nil;
275 -+ (void)initialize {
276 - static BOOL isInitialized = NO;
277 - if (!isInitialized) {
278 - isInitialized = YES;
281 - [[NGMimeType mimeType:@"text/plain; charset=us-ascii"] retain];
285 + (id)bodyPartWithHeader:(NGHashMap *)_header {
286 return [[[self alloc] initWithHeader:_header] autorelease];
288 @@ -156,13 +144,12 @@
290 Fields = (NGMimeHeaderNames *)[NGMimePartParser headerFieldNames];
293 type = [self->header objectForKey:Fields->contentType];
295 if (![type isKindOfClass:[NGMimeType class]])
296 type = [NGMimeType mimeType:[type stringValue]];
298 - return (type != nil ? type : (id)defaultType);
302 - (NSString *)contentId {
303 Index: sope-mime/NGMime/NGMimeBodyParser.m
304 ===================================================================
305 --- sope-mime/NGMime/NGMimeBodyParser.m (révision 1546)
306 +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail)
308 if (_data == nil) return nil;
310 ctype = [_part contentType];
313 + && [_d respondsToSelector: @selector(parser:contentTypeOfPart:)])
314 + ctype = [_d parser: self contentTypeOfPart: _part];
316 if (![ctype isKindOfClass:[NGMimeType class]])
317 ctype = [NGMimeType mimeType:[ctype stringValue]];
319 Index: sope-mime/NGMime/NGMimePartParser.h
320 ===================================================================
321 --- sope-mime/NGMime/NGMimePartParser.h (révision 1546)
322 +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail)
324 BOOL parserParseRawBodyDataOfPart:1;
325 BOOL parserBodyParserForPart:1;
326 BOOL parserDecodeBodyOfPart:1;
327 + BOOL parserContentTypeOfPart:1;
328 } delegateRespondsTo;
332 - (id<NGMimeBodyParser>)parser:(NGMimePartParser *)_parser
333 bodyParserForPart:(id<NGMimePart>)_part;
335 +- (NGMimeType *)parser:(id)_parser
336 + contentTypeOfPart:(id<NGMimePart>)_part;
338 @end /* NSObject(NGMimePartParserDelegate) */
340 @interface NSObject(NGMimePartParser)
341 Index: sope-mime/NGMime/NGMimePartParser.m
342 ===================================================================
343 --- sope-mime/NGMime/NGMimePartParser.m (révision 1546)
344 +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail)
345 @@ -1091,7 +1091,10 @@
346 id<NGMimeBodyParser> bodyParser = nil;
348 ctype = [_p contentType];
351 + && self->delegateRespondsTo.parserContentTypeOfPart)
352 + ctype = [self->delegate parser: self contentTypeOfPart: _p];
354 contentType = ([ctype isKindOfClass:[NGMimeType class]])
356 : [NGMimeType mimeType:[ctype stringValue]];
357 Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
358 ===================================================================
359 --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1546)
360 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
365 +/* GCSEOAdaptorChannel protocol */
366 +static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \
367 + @" c_name VARCHAR (256) NOT NULL,\n"
368 + @" c_content VARCHAR (100000) NOT NULL,\n"
369 + @" c_creationdate INT4 NOT NULL,\n"
370 + @" c_lastmodified INT4 NOT NULL,\n"
371 + @" c_version INT4 NOT NULL,\n"
372 + @" c_deleted INT4 NULL\n"
374 +static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
375 + @" c_uid VARCHAR (256) NOT NULL,\n"
376 + @" c_object VARCHAR (256) NOT NULL,\n"
377 + @" c_role VARCHAR (80) NOT NULL\n"
380 +- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
384 + sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
386 + return [self evaluateExpressionX: sql];
389 +- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
393 + sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
395 + return [self evaluateExpressionX: sql];
398 @end /* PostgreSQL72Channel */
400 @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
401 Index: sope-gdl1/Oracle8/GNUmakefile
402 ===================================================================
403 --- sope-gdl1/Oracle8/GNUmakefile (révision 1546)
404 +++ sope-gdl1/Oracle8/GNUmakefile (copie de travail)
407 ORACLE_VERSION=10.2.0.3
408 #ORACLE_VERSION=11.1.0.1
409 -ADDITIONAL_INCLUDE_DIRS += -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
410 +ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
412 +local_arch = $(subst 64,,$(shell uname -m))
414 +ifeq ($(local_arch),ppc)
415 +PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++
420 ifneq ($(frameworks),yes)
421 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
422 -otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
423 +common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -L../GDLAccess/obj -lGDLAccess -L../../sope-core/EOControl/obj -lEOControl $(PPC_LDFLAGS)
425 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
426 -otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
427 +common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS)
429 +Oracle8_BUNDLE_LIBS += $(common_LIBS)
430 +otest_TOOL_LIBS += $(common_LIBS)
433 BUNDLE_NAME = Oracle8
434 Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m
435 ===================================================================
436 --- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1546)
437 +++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail)
441 info = [[_row_buffer objectAtIndex: c] pointerValue];
442 - [_row_buffer removeObjectAtIndex: c];
444 // We free our LOB object. If it fails, it likely mean it isn't a LOB
445 // so we just free the value instead.
446 - if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
452 + if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
454 + info->value = NULL;
457 + [_row_buffer removeObjectAtIndex: c];
460 OCIHandleFree(_current_stm, OCI_HTYPE_STMT);
463 NSLog(@"FAILED: OCITerminate()");
466 + OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
467 + OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
468 + OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
470 + _oci_ctx = (OCISvcCtx *)0;
471 + _oci_err = (OCIError *)0;
472 + _oci_env = (OCIEnv *)0;
479 RELEASE(_resultSetProperties);
481 - OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
482 - OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
483 - OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
488 Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m
489 ===================================================================
490 --- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1546)
491 +++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail)
493 OCILobFreeTemporary([theChannel serviceContext], [theChannel errorHandle], info->value);
494 OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB);
498 + [theColumns release];
500 OCIHandleFree(theStatement, OCI_HTYPE_STMT);
502 Index: sope-appserver/NGObjWeb/GNUmakefile.postamble
503 ===================================================================
504 --- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1546)
505 +++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail)
511 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
513 +ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
514 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
517 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make: ngobjweb.make
518 $(MKDIRS) $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/
519 $(INSTALL_DATA) ngobjweb.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
521 -ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
523 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make: woapp-gs.make
524 $(INSTALL_DATA) woapp-gs.make \
525 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make
527 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make: wobundle-gs.make
528 $(INSTALL_DATA) wobundle-gs.make \
529 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
531 Index: sope-appserver/NGObjWeb/WOContext.m
532 ===================================================================
533 --- sope-appserver/NGObjWeb/WOContext.m (révision 1546)
534 +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail)
536 static BOOL testNSURLs = NO;
537 static BOOL newCURLStyle = NO;
538 static NSString *WOApplicationSuffix = nil;
539 +static NSURL *redirectURL = nil;
542 static BOOL didInit = NO;
550 debugCursor = [ud boolForKey:@"WODebugCursor"] ? 1 : 0;
551 debugComponentAwake = [ud boolForKey:@"WODebugComponentAwake"];
552 WOApplicationSuffix = [[ud stringForKey:@"WOApplicationSuffix"] copy];
553 + url = [ud stringForKey:@"WOApplicationRedirectURL"];
555 + redirectURL = [NSURL URLWithString: url];
558 + (id)contextWithRequest:(WORequest *)_r {
564 + // Use URL from user defaults (WOApplicationRedirectURL)
565 + return redirectURL;
568 if ((serverURL = [rq headerForKey:@"x-webobjects-server-url"]) == nil) {
569 if ((host = [rq headerForKey:@"host"]))
570 serverURL = [@"http://" stringByAppendingString:host];
571 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m
572 ===================================================================
573 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1546)
574 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail)
580 + if ((self->isAbsolute = OWGetProperty(_config, @"absolute"))) {
586 self->rest = _config;
588 Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m
589 ===================================================================
590 --- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1546)
591 +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail)
593 WOAssociation *string;
594 WOAssociation *target;
595 WOAssociation *disabled;
596 + WOAssociation *isAbsolute;
602 if ((self = [super initWithName:_name hyperlinkInfo:_info template:_t])) {
603 self->href = _info->href;
604 + self->isAbsolute = _info->isAbsolute;
609 // TODO: we need a binding to disable rewriting!
612 + if ([[self->isAbsolute valueInContext:_ctx] boolValue] == YES)
615 r = [_s rangeOfString:@":"];
618 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h
619 ===================================================================
620 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1546)
621 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail)
623 WOAssociation *pageName;
624 WOAssociation *actionClass;
625 WOAssociation *directActionName;
627 + WOAssociation *isAbsolute;
631 /* 'ivar' associations */
632 Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m
633 ===================================================================
634 --- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1546)
635 +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail)
637 static int debugLookup = -1;
638 static int debugBaseURL = -1;
639 static int useRelativeURLs = -1;
640 +static int redirectInitted = -1;
641 +static NSURL *redirectURL = nil;
643 static void _initialize(void) {
645 + NSUserDefaults *ud;
647 + ud = [NSUserDefaults standardUserDefaults];
649 if (debugLookup == -1) {
650 - debugLookup = [[NSUserDefaults standardUserDefaults]
651 - boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
652 + debugLookup = [ud boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
653 NSLog(@"Note(SoObject): SoDebugKeyLookup is enabled!");
655 if (debugBaseURL == -1) {
656 - debugBaseURL = [[NSUserDefaults standardUserDefaults]
657 - boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
658 + debugBaseURL = [ud boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
659 NSLog(@"Note(SoObject): SoDebugBaseURL is enabled!");
661 if (useRelativeURLs == -1) {
662 - useRelativeURLs = [[NSUserDefaults standardUserDefaults]
663 - boolForKey:@"WOUseRelativeURLs"] ?1:0;
664 + useRelativeURLs = [ud boolForKey:@"WOUseRelativeURLs"] ?1:0;
665 NSLog(@"Note(SoObject): relative base URLs are enabled.");
667 + if (redirectInitted == -1) {
668 + url = [ud stringForKey:@"WOApplicationRedirectURL"];
669 + if ([url length]) {
670 + redirectURL = [[NSURL alloc] initWithString: url];
672 + redirectInitted = 1;
677 @@ -318,56 +330,61 @@
680 ms = [[NSMutableString alloc] initWithCapacity:128];
683 + [ms appendString: [redirectURL absoluteString]];
686 + if (!useRelativeURLs) {
687 + port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
689 - if (!useRelativeURLs) {
690 - port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
692 - /* this is actually a bug in Apache */
694 - static BOOL didWarn = NO;
696 - [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
697 - __PRETTY_FUNCTION__, __LINE__];
699 + /* this is actually a bug in Apache */
701 + static BOOL didWarn = NO;
703 + [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
704 + __PRETTY_FUNCTION__, __LINE__];
712 - if ((tmp = [rq headerForKey:@"host"]) != nil) {
713 - /* check whether we have a host header with port */
714 - if ([tmp rangeOfString:@":"].length == 0)
717 - if (tmp != nil) { /* we have a host header with port */
719 - [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
720 - [ms appendString:isHTTPS ? @"https://" : @"http://"];
721 - [ms appendString:tmp];
723 - else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
724 - /* sometimes the URL is just wrong! (suggests port 80) */
725 - if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
726 - [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
727 - __PRETTY_FUNCTION__, tmp];
728 - tmp = [tmp substringToIndex:([tmp length] - 2)];
729 + if ((tmp = [rq headerForKey:@"host"]) != nil) {
730 + /* check whether we have a host header with port */
731 + if ([tmp rangeOfString:@":"].length == 0)
734 - else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
735 - /* see OGo bug #1435, Debian Apache hack */
736 - [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
737 - @"assuming Debian/Apache bug (OGo #1435): '%@'",
738 - __PRETTY_FUNCTION__, tmp];
739 - tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
740 - tmp = [@"https" stringByAppendingString:tmp];
741 + if (tmp != nil) { /* we have a host header with port */
743 + [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
744 + [ms appendString:isHTTPS ? @"https://" : @"http://"];
745 + [ms appendString:tmp];
747 - [ms appendString:tmp];
750 - // TODO: isHTTPS always no in this case?
751 - [ms appendString:isHTTPS ? @"https://" : @"http://"];
752 + else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
753 + /* sometimes the URL is just wrong! (suggests port 80) */
754 + if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
755 + [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
756 + __PRETTY_FUNCTION__, tmp];
757 + tmp = [tmp substringToIndex:([tmp length] - 2)];
759 + else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
760 + /* see OGo bug #1435, Debian Apache hack */
761 + [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
762 + @"assuming Debian/Apache bug (OGo #1435): '%@'",
763 + __PRETTY_FUNCTION__, tmp];
764 + tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
765 + tmp = [@"https" stringByAppendingString:tmp];
767 + [ms appendString:tmp];
770 + // TODO: isHTTPS always no in this case?
771 + [ms appendString:isHTTPS ? @"https://" : @"http://"];
773 - [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
774 - if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
775 - [ms appendFormat:@":%i", port];
776 + [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
777 + if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
778 + [ms appendFormat:@":%i", port];
783 Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m
784 ===================================================================
785 --- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1546)
786 +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail)
788 #include <NGObjWeb/WOCookie.h>
789 #include <NGExtensions/NSData+gzip.h>
790 #include <NGHttp/NGHttp.h>
791 +#include <NGMime/NGMimeType.h>
795 @@ -1016,6 +1017,12 @@
796 - (void)parser:(NGMimePartParser *)_parser didParseHeader:(NGHashMap *)_header {
799 +- (NGMimeType *)parser:(id)_parser
800 + contentTypeOfPart:(id<NGMimePart>)_part
802 + return [NGMimeType mimeType: @"text/plain; charset=utf-8"];
805 @end /* WOHttpAdaptor */
807 @implementation WOCoreApplication(SimpleParserSelection)