1 Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
2 ===================================================================
3 --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1546)
4 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
9 +/* GCSEOAdaptorChannel protocol */
10 +static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \
11 + @" c_name VARCHAR (256) NOT NULL,\n"
12 + @" c_content VARCHAR (100000) NOT NULL,\n"
13 + @" c_creationdate INT4 NOT NULL,\n"
14 + @" c_lastmodified INT4 NOT NULL,\n"
15 + @" c_version INT4 NOT NULL,\n"
16 + @" c_deleted INT4 NULL\n"
18 +static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
19 + @" c_uid VARCHAR (256) NOT NULL,\n"
20 + @" c_object VARCHAR (256) NOT NULL,\n"
21 + @" c_role VARCHAR (80) NOT NULL\n"
24 +- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
28 + sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
30 + return [self evaluateExpressionX: sql];
33 +- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
37 + sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
39 + return [self evaluateExpressionX: sql];
42 @end /* PostgreSQL72Channel */
44 @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
45 Index: sope-gdl1/Oracle8/GNUmakefile
46 ===================================================================
47 --- sope-gdl1/Oracle8/GNUmakefile (révision 1546)
48 +++ sope-gdl1/Oracle8/GNUmakefile (copie de travail)
51 ORACLE_VERSION=10.2.0.3
52 #ORACLE_VERSION=11.1.0.1
53 -ADDITIONAL_INCLUDE_DIRS += -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
54 +ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
56 +local_arch = $(subst 64,,$(shell uname -m))
58 +ifeq ($(local_arch),ppc)
59 +PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++
64 ifneq ($(frameworks),yes)
65 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
66 -otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
67 +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)
69 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
70 -otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
71 +common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS)
73 +Oracle8_BUNDLE_LIBS += $(common_LIBS)
74 +otest_TOOL_LIBS += $(common_LIBS)
78 Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m
79 ===================================================================
80 --- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1546)
81 +++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail)
85 info = [[_row_buffer objectAtIndex: c] pointerValue];
86 - [_row_buffer removeObjectAtIndex: c];
88 // We free our LOB object. If it fails, it likely mean it isn't a LOB
89 // so we just free the value instead.
90 - if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
96 + if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
101 + [_row_buffer removeObjectAtIndex: c];
104 OCIHandleFree(_current_stm, OCI_HTYPE_STMT);
107 @implementation OracleAdaptorChannel
112 + if (OCITerminate(OCI_DEFAULT))
113 + NSLog(@"FAILED: OCITerminate()");
115 + NSLog(@"Oracle8: environment shut down");
120 + // We Initialize the OCI process environment.
121 + if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0,
122 + (dvoid * (*)(dvoid *, size_t)) 0,
123 + (dvoid * (*)(dvoid *, dvoid *, size_t))0,
124 + (void (*)(dvoid *, dvoid *)) 0 ))
125 + NSLog(@"FAILED: OCIInitialize()");
128 + NSLog(@"Oracle8: environment initialized");
129 + atexit(DBTerminate);
133 - (id) initWithAdaptorContext: (EOAdaptorContext *) theAdaptorContext
135 if ((self = [super initWithAdaptorContext: theAdaptorContext]))
136 @@ -134,10 +161,14 @@
137 NSLog(@"FAILED: OCILogoff()");
140 - if (OCITerminate(OCI_DEFAULT))
142 - NSLog(@"FAILED: OCITerminate()");
145 + OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
146 + OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
147 + // OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
149 + _oci_ctx = (OCISvcCtx *)0;
150 + _oci_err = (OCIError *)0;
151 + _oci_env = (OCIEnv *)0;
158 RELEASE(_resultSetProperties);
160 - OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
161 - OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
162 - OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
171 - // We Initialize the OCI process environment.
172 - if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0,
173 - (dvoid * (*)(dvoid *, size_t)) 0,
174 - (dvoid * (*)(dvoid *, dvoid *, size_t))0,
175 - (void (*)(dvoid *, dvoid *)) 0 ))
177 - NSLog(@"FAILED: OCIInitialize()");
182 if (OCIEnvInit((OCIEnv **)&_oci_env, (ub4)OCI_DEFAULT, (size_t)0, (dvoid **)0))
184 NSLog(@"FAILED: OCIEnvInit()");
185 Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m
186 ===================================================================
187 --- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1546)
188 +++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail)
190 OCILobFreeTemporary([theChannel serviceContext], [theChannel errorHandle], info->value);
191 OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB);
195 + [theColumns release];
197 OCIHandleFree(theStatement, OCI_HTYPE_STMT);
199 Index: sope-mime/NGImap4/NGImap4Connection.m
200 ===================================================================
201 --- sope-mime/NGImap4/NGImap4Connection.m (révision 1546)
202 +++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail)
205 if (debugCache) [self logWithFormat:@" no folders cached yet .."];
207 - result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"*")
208 + result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"")
210 if (![[result valueForKey:@"result"] boolValue]) {
211 [self errorWithFormat:@"Could not list mailbox hierarchy!"];
212 Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m
213 ===================================================================
214 --- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1546)
215 +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail)
216 @@ -648,14 +648,13 @@
217 enumerator = [_flags objectEnumerator];
219 while ((obj = [enumerator nextObject])) {
220 - if (![obj isNotEmpty])
223 - if (![[obj substringToIndex:1] isEqualToString:@"\\"])
226 - objs[cnt] = [obj substringFromIndex:1];
228 + if ([obj isNotEmpty]) {
229 + if ([obj hasPrefix:@"\\"])
230 + objs[cnt] = [obj substringFromIndex:1];
236 result = [NSArray arrayWithObjects:objs count:cnt];
237 if (objs) free(objs);
238 Index: sope-mime/NGImap4/NGImap4ResponseParser.m
239 ===================================================================
240 --- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1546)
241 +++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail)
243 static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
244 BOOL isBodyStructure);
246 +static NSArray *_parseLanguages();
248 static NSString *_parseBodyString(NGImap4ResponseParser *self,
249 BOOL _convertString);
250 static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self,
252 static NSNumber *_parseUnsigned(NGImap4ResponseParser *self);
253 static NSString *_parseUntil(NGImap4ResponseParser *self, char _c);
254 static NSString *_parseUntil2(NGImap4ResponseParser *self, char _c1, char _c2);
255 +static BOOL _endsWithCQuote(NSString *_string);
257 static __inline__ NSException *_consumeIfMatch
258 (NGImap4ResponseParser *self, unsigned char _m);
259 @@ -649,12 +652,31 @@
262 - (NSString *)_parseQuotedString {
263 + NSMutableString *quotedString;
264 + NSString *tmpString;
267 /* parse a quoted string, eg '"' */
268 if (_la(self, 0) == '"') {
270 - return _parseUntil(self, '"');
271 + quotedString = [NSMutableString string];
274 + tmpString = _parseUntil(self, '"');
275 + [quotedString appendString: tmpString];
276 + if(_endsWithCQuote(tmpString)) {
277 + [quotedString deleteSuffix: @"\\"];
278 + [quotedString appendString: @"\""];
287 + quotedString = nil;
289 + return quotedString;
291 - (void)_consumeOptionalSpace {
292 if (_la(self, 0) == ' ') _consume(self, 1);
293 @@ -1185,7 +1207,7 @@
294 route = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
295 mailbox = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
296 host = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
299 if (_la(self, 0) != ')') {
300 [self logWithFormat:@"WARNING: IMAP4 envelope "
301 @"address not properly closed (c0=%c,c1=%c): %@",
302 @@ -1197,6 +1219,7 @@
303 address = [[NGImap4EnvelopeAddress alloc] initWithPersonalName:pname
304 sourceRoute:route mailbox:mailbox
310 @@ -1627,6 +1650,29 @@
311 return _parseBodyDecodeString(self, _convertString, NO /* no decode */);
314 +static NSArray *_parseLanguages(NGImap4ResponseParser *self) {
315 + NSMutableArray *languages;
316 + NSString *language;
318 + languages = [NSMutableArray array];
319 + if (_la(self, 0) == '(') {
320 + while (_la(self, 0) != ')') {
322 + language = _parseBodyString(self, YES);
323 + if ([language length])
324 + [languages addObject: language];
329 + language = _parseBodyString(self, YES);
330 + if ([language length])
331 + [languages addObject: language];
337 static NSDictionary *_parseBodyParameterList(NGImap4ResponseParser *self)
339 NSMutableDictionary *list;
340 @@ -1734,10 +1780,11 @@
341 *encoding, *bodysize;
342 NSDictionary *parameterList;
343 NSMutableDictionary *dict;
344 + NSArray *languages;
346 type = [_parseBodyString(self, YES) lowercaseString];
347 _consumeIfMatch(self, ' ');
348 - subtype = _parseBodyString(self, YES);
349 + subtype = [_parseBodyString(self, YES) lowercaseString];
350 _consumeIfMatch(self, ' ');
351 parameterList = _parseBodyParameterList(self);
352 _consumeIfMatch(self, ' ');
353 @@ -1762,7 +1809,8 @@
354 _consumeIfMatch(self, ' ');
355 [dict setObject:_parseBodyString(self, YES) forKey:@"lines"];
357 - else if ([type isEqualToString:@"message"]) {
358 + else if ([type isEqualToString:@"message"]
359 + && [subtype isEqualToString:@"rfc822"]) {
360 if (_la(self, 0) != ')') {
361 _consumeIfMatch(self, ' ');
362 _consumeIfMatch(self, '(');
363 @@ -1805,14 +1853,9 @@
364 forKey: @"disposition"];
365 if (_la(self, 0) != ')') {
367 - if (_la(self, 0) == '(') {
368 - [dict setObject: _parseBodyParameterList(self)
369 - forKey: @"language"];
372 - [dict setObject: _parseBodyString(self, YES)
373 - forKey: @"language"];
375 + languages = _parseLanguages(self);
376 + if ([languages count])
377 + [dict setObject: languages forKey: @"languages"];
378 if (_la(self, 0) != ')') {
380 [dict setObject: _parseBodyString(self, YES)
381 @@ -1829,6 +1872,7 @@
382 static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
383 BOOL isBodyStructure) {
384 NSMutableArray *parts;
385 + NSArray *languages;
387 NSMutableDictionary *dict;
389 @@ -1854,14 +1898,9 @@
390 forKey: @"disposition"];
391 if (_la(self, 0) != ')') {
393 - if (_la(self, 0) == '(') {
394 - [dict setObject: _parseBodyParameterList(self)
395 - forKey: @"language"];
398 - [dict setObject: _parseBodyString(self, YES)
399 - forKey: @"language"];
401 + languages = _parseLanguages(self);
402 + if ([languages count])
403 + [dict setObject: languages forKey: @"languages"];
404 if (_la(self, 0) != ')') {
406 [dict setObject: _parseBodyString(self, YES)
407 @@ -2170,6 +2209,21 @@
411 +static BOOL _endsWithCQuote(NSString *_string){
412 + unsigned int quoteSlashes;
416 + pos = [_string length] - 1;
418 + && [_string characterAtIndex: pos] == '\\') {
423 + return ((quoteSlashes % 2) == 1);
426 - (NSException *)exceptionForFailedMatch:(unsigned char)_match
427 got:(unsigned char)_avail
429 Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m
430 ===================================================================
431 --- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1546)
432 +++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail)
433 @@ -285,24 +285,16 @@
434 - (id)parseValue:(id)_data ofHeaderField:(NSString *)_field {
436 NSCalendarDate *date = nil;
437 - unsigned char buf[256];
438 - unsigned char *bytes = buf, *pe;
439 + unsigned char *bytes, *pe;
441 NSTimeZone *tz = nil;
442 char dayOfMonth, monthOfYear, hour, minute, second;
446 - if ((length = [_data cStringLength]) > 254) {
447 - [self logWithFormat:
448 - @"header field value to large for date parsing: '%@'(%i)",
453 - [_data getCString:(char *)buf maxLength:length];
454 - buf[length] = '\0';
457 + length = [_data length];
458 + bytes = [_data cStringUsingEncoding: NSASCIIStringEncoding];
460 /* remove leading chars (skip to first digit, the day of the month) */
461 while (length > 0 && (!isdigit(*bytes))) {
463 Index: sope-mime/NGMime/NGMimeBodyPart.m
464 ===================================================================
465 --- sope-mime/NGMime/NGMimeBodyPart.m (révision 1546)
466 +++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail)
471 -static NGMimeType *defaultType = nil;
473 -+ (void)initialize {
474 - static BOOL isInitialized = NO;
475 - if (!isInitialized) {
476 - isInitialized = YES;
479 - [[NGMimeType mimeType:@"text/plain; charset=us-ascii"] retain];
483 + (id)bodyPartWithHeader:(NGHashMap *)_header {
484 return [[[self alloc] initWithHeader:_header] autorelease];
486 @@ -156,13 +144,12 @@
488 Fields = (NGMimeHeaderNames *)[NGMimePartParser headerFieldNames];
491 type = [self->header objectForKey:Fields->contentType];
493 if (![type isKindOfClass:[NGMimeType class]])
494 type = [NGMimeType mimeType:[type stringValue]];
496 - return (type != nil ? type : (id)defaultType);
500 - (NSString *)contentId {
501 Index: sope-mime/NGMime/NGMimeBodyParser.m
502 ===================================================================
503 --- sope-mime/NGMime/NGMimeBodyParser.m (révision 1546)
504 +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail)
506 if (_data == nil) return nil;
508 ctype = [_part contentType];
511 + && [_d respondsToSelector: @selector(parser:contentTypeOfPart:)])
512 + ctype = [_d parser: self contentTypeOfPart: _part];
514 if (![ctype isKindOfClass:[NGMimeType class]])
515 ctype = [NGMimeType mimeType:[ctype stringValue]];
517 Index: sope-mime/NGMime/NGMimePartParser.h
518 ===================================================================
519 --- sope-mime/NGMime/NGMimePartParser.h (révision 1546)
520 +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail)
522 BOOL parserParseRawBodyDataOfPart:1;
523 BOOL parserBodyParserForPart:1;
524 BOOL parserDecodeBodyOfPart:1;
525 + BOOL parserContentTypeOfPart:1;
526 } delegateRespondsTo;
530 - (id<NGMimeBodyParser>)parser:(NGMimePartParser *)_parser
531 bodyParserForPart:(id<NGMimePart>)_part;
533 +- (NGMimeType *)parser:(id)_parser
534 + contentTypeOfPart:(id<NGMimePart>)_part;
536 @end /* NSObject(NGMimePartParserDelegate) */
538 @interface NSObject(NGMimePartParser)
539 Index: sope-mime/NGMime/NGMimePartParser.m
540 ===================================================================
541 --- sope-mime/NGMime/NGMimePartParser.m (révision 1546)
542 +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail)
543 @@ -1091,7 +1091,10 @@
544 id<NGMimeBodyParser> bodyParser = nil;
546 ctype = [_p contentType];
549 + && self->delegateRespondsTo.parserContentTypeOfPart)
550 + ctype = [self->delegate parser: self contentTypeOfPart: _p];
552 contentType = ([ctype isKindOfClass:[NGMimeType class]])
554 : [NGMimeType mimeType:[ctype stringValue]];
555 Index: sope-appserver/NGObjWeb/GNUmakefile.postamble
556 ===================================================================
557 --- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1546)
558 +++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail)
564 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
566 +ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
567 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
570 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make: ngobjweb.make
571 $(MKDIRS) $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/
572 $(INSTALL_DATA) ngobjweb.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
574 -ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
576 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make: woapp-gs.make
577 $(INSTALL_DATA) woapp-gs.make \
578 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make
580 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make: wobundle-gs.make
581 $(INSTALL_DATA) wobundle-gs.make \
582 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
584 Index: sope-appserver/NGObjWeb/WOContext.m
585 ===================================================================
586 --- sope-appserver/NGObjWeb/WOContext.m (révision 1546)
587 +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail)
589 static BOOL testNSURLs = NO;
590 static BOOL newCURLStyle = NO;
591 static NSString *WOApplicationSuffix = nil;
592 +static NSURL *redirectURL = nil;
595 static BOOL didInit = NO;
603 debugCursor = [ud boolForKey:@"WODebugCursor"] ? 1 : 0;
604 debugComponentAwake = [ud boolForKey:@"WODebugComponentAwake"];
605 WOApplicationSuffix = [[ud stringForKey:@"WOApplicationSuffix"] copy];
606 + url = [ud stringForKey:@"WOApplicationRedirectURL"];
608 + redirectURL = [NSURL URLWithString: url];
611 + (id)contextWithRequest:(WORequest *)_r {
617 + // Use URL from user defaults (WOApplicationRedirectURL)
618 + return redirectURL;
621 if ((serverURL = [rq headerForKey:@"x-webobjects-server-url"]) == nil) {
622 if ((host = [rq headerForKey:@"host"]))
623 serverURL = [@"http://" stringByAppendingString:host];
624 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m
625 ===================================================================
626 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1546)
627 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail)
633 + if ((self->isAbsolute = OWGetProperty(_config, @"absolute"))) {
639 self->rest = _config;
641 Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m
642 ===================================================================
643 --- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1546)
644 +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail)
646 WOAssociation *string;
647 WOAssociation *target;
648 WOAssociation *disabled;
649 + WOAssociation *isAbsolute;
655 if ((self = [super initWithName:_name hyperlinkInfo:_info template:_t])) {
656 self->href = _info->href;
657 + self->isAbsolute = _info->isAbsolute;
662 // TODO: we need a binding to disable rewriting!
665 + if ([[self->isAbsolute valueInContext:_ctx] boolValue] == YES)
668 r = [_s rangeOfString:@":"];
671 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h
672 ===================================================================
673 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1546)
674 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail)
676 WOAssociation *pageName;
677 WOAssociation *actionClass;
678 WOAssociation *directActionName;
680 + WOAssociation *isAbsolute;
684 /* 'ivar' associations */
685 Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m
686 ===================================================================
687 --- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1546)
688 +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail)
690 static int debugLookup = -1;
691 static int debugBaseURL = -1;
692 static int useRelativeURLs = -1;
693 +static int redirectInitted = -1;
694 +static NSURL *redirectURL = nil;
696 static void _initialize(void) {
698 + NSUserDefaults *ud;
700 + ud = [NSUserDefaults standardUserDefaults];
702 if (debugLookup == -1) {
703 - debugLookup = [[NSUserDefaults standardUserDefaults]
704 - boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
705 + debugLookup = [ud boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
706 NSLog(@"Note(SoObject): SoDebugKeyLookup is enabled!");
708 if (debugBaseURL == -1) {
709 - debugBaseURL = [[NSUserDefaults standardUserDefaults]
710 - boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
711 + debugBaseURL = [ud boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
712 NSLog(@"Note(SoObject): SoDebugBaseURL is enabled!");
714 if (useRelativeURLs == -1) {
715 - useRelativeURLs = [[NSUserDefaults standardUserDefaults]
716 - boolForKey:@"WOUseRelativeURLs"] ?1:0;
717 + useRelativeURLs = [ud boolForKey:@"WOUseRelativeURLs"] ?1:0;
718 NSLog(@"Note(SoObject): relative base URLs are enabled.");
720 + if (redirectInitted == -1) {
721 + url = [ud stringForKey:@"WOApplicationRedirectURL"];
722 + if ([url length]) {
723 + redirectURL = [[NSURL alloc] initWithString: url];
725 + redirectInitted = 1;
730 @@ -318,56 +330,61 @@
733 ms = [[NSMutableString alloc] initWithCapacity:128];
736 + [ms appendString: [redirectURL absoluteString]];
739 + if (!useRelativeURLs) {
740 + port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
742 - if (!useRelativeURLs) {
743 - port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
745 - /* this is actually a bug in Apache */
747 - static BOOL didWarn = NO;
749 - [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
750 - __PRETTY_FUNCTION__, __LINE__];
752 + /* this is actually a bug in Apache */
754 + static BOOL didWarn = NO;
756 + [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
757 + __PRETTY_FUNCTION__, __LINE__];
765 - if ((tmp = [rq headerForKey:@"host"]) != nil) {
766 - /* check whether we have a host header with port */
767 - if ([tmp rangeOfString:@":"].length == 0)
770 - if (tmp != nil) { /* we have a host header with port */
772 - [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
773 - [ms appendString:isHTTPS ? @"https://" : @"http://"];
774 - [ms appendString:tmp];
776 - else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
777 - /* sometimes the URL is just wrong! (suggests port 80) */
778 - if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
779 - [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
780 - __PRETTY_FUNCTION__, tmp];
781 - tmp = [tmp substringToIndex:([tmp length] - 2)];
782 + if ((tmp = [rq headerForKey:@"host"]) != nil) {
783 + /* check whether we have a host header with port */
784 + if ([tmp rangeOfString:@":"].length == 0)
787 - else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
788 - /* see OGo bug #1435, Debian Apache hack */
789 - [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
790 - @"assuming Debian/Apache bug (OGo #1435): '%@'",
791 - __PRETTY_FUNCTION__, tmp];
792 - tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
793 - tmp = [@"https" stringByAppendingString:tmp];
794 + if (tmp != nil) { /* we have a host header with port */
796 + [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
797 + [ms appendString:isHTTPS ? @"https://" : @"http://"];
798 + [ms appendString:tmp];
800 - [ms appendString:tmp];
803 - // TODO: isHTTPS always no in this case?
804 - [ms appendString:isHTTPS ? @"https://" : @"http://"];
805 + else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
806 + /* sometimes the URL is just wrong! (suggests port 80) */
807 + if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
808 + [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
809 + __PRETTY_FUNCTION__, tmp];
810 + tmp = [tmp substringToIndex:([tmp length] - 2)];
812 + else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
813 + /* see OGo bug #1435, Debian Apache hack */
814 + [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
815 + @"assuming Debian/Apache bug (OGo #1435): '%@'",
816 + __PRETTY_FUNCTION__, tmp];
817 + tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
818 + tmp = [@"https" stringByAppendingString:tmp];
820 + [ms appendString:tmp];
823 + // TODO: isHTTPS always no in this case?
824 + [ms appendString:isHTTPS ? @"https://" : @"http://"];
826 - [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
827 - if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
828 - [ms appendFormat:@":%i", port];
829 + [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
830 + if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
831 + [ms appendFormat:@":%i", port];
836 Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m
837 ===================================================================
838 --- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1546)
839 +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail)
841 #include <NGObjWeb/WOCookie.h>
842 #include <NGExtensions/NSData+gzip.h>
843 #include <NGHttp/NGHttp.h>
844 +#include <NGMime/NGMimeType.h>
848 @@ -1016,6 +1017,12 @@
849 - (void)parser:(NGMimePartParser *)_parser didParseHeader:(NGHashMap *)_header {
852 +- (NGMimeType *)parser:(id)_parser
853 + contentTypeOfPart:(id<NGMimePart>)_part
855 + return [NGMimeType mimeType: @"text/plain; charset=utf-8"];
858 @end /* WOHttpAdaptor */
860 @implementation WOCoreApplication(SimpleParserSelection)