2002-06-03 Manuel Guesdon <mguesdon@orange-concept.com>

* GSWeb.framework/GSWBundle.m:
		o use smartTakeValue:forKey: instead of takeValue:forKey:
	* GSWeb.framework/GSWAssociation.m:
		o use smartTakeValue:forKeyPath: instead of takeValue:forKeyPath:
	* GSWeb.framework/GSWComponent.m:
		o use smartTakeValue:forKey: instead of takeValue:forKey:
	* GSWeb.framework/GSWDisplayGroup.m:
		o changes in -description
		o logs
	* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
		o added "reference"
	* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
		o added "reference"
	* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
		o added "reference"
	* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.h/.m:
		o added "reference"
	* GSWExtensionsGSW.framework/GSWFileUploadComponent.h/.m:
		o bug fixes
	* GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd:
		o added Height & With parameters for images
	* GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.html:
		o added delete check box title
	* GSWeb.framework/GSWElement.m:
		o logs
	* GSWeb.framework/GSWFileUpload.m:
		o logs
	* GSWeb.framework/GSWRequest.m:
		o bug fix for uploaded files


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@13762 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2002-06-03 08:27:15 +00:00
parent 893540cdaa
commit 1a474bf60f
19 changed files with 179 additions and 58 deletions

View file

@ -1,4 +1,35 @@
2002-05-xx Manuel Guesdon <mguesdon@orange-concept.com> 2002-06-03 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWBundle.m:
o use smartTakeValue:forKey: instead of takeValue:forKey:
* GSWeb.framework/GSWAssociation.m:
o use smartTakeValue:forKeyPath: instead of takeValue:forKeyPath:
* GSWeb.framework/GSWComponent.m:
o use smartTakeValue:forKey: instead of takeValue:forKey:
* GSWeb.framework/GSWDisplayGroup.m:
o changes in -description
o logs
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
o added "reference"
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
o added "reference"
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
o added "reference"
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.h/.m:
o added "reference"
* GSWExtensionsGSW.framework/GSWFileUploadComponent.h/.m:
o bug fixes
* GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd:
o added Height & With parameters for images
* GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.html:
o added delete check box title
* GSWeb.framework/GSWElement.m:
o logs
* GSWeb.framework/GSWFileUpload.m:
o logs
* GSWeb.framework/GSWRequest.m:
o bug fix for uploaded files
2002-05-16 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWTextField.m: * GSWeb.framework/GSWTextField.m:
o added warning in _isFormattedValueInComponent:equalToFormattedValue: o added warning in _isFormattedValueInComponent:equalToFormattedValue:
o added warning in takeValuesFromRequest:inContext: o added warning in takeValuesFromRequest:inContext:

View file

@ -25,6 +25,14 @@
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE> <PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
</td> </td>
</tr> </tr>
<tr>
<td align="right" valign="top">
<b>Reference:</b>
</td>
<td align="left" valign="top">
<PRE><gsweb name="ReferenceString"></gsweb></PRE>
</td>
</tr>
<tr> <tr>
<td align="right" valign="top"> <td align="right" valign="top">
<b>Erreur:</b> <b>Erreur:</b>

View file

@ -18,6 +18,13 @@ ApplicationNameString: GSWString
escapeHTML = NO; escapeHTML = NO;
} }
ReferenceString: GSWString
{
value = referenceString;
escapeHTML = YES;
convertHTMLEntities = YES;
}
ExceptionNameString: GSWString ExceptionNameString: GSWString
{ {
value = exception.name; value = exception.name;

View file

@ -25,6 +25,14 @@
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE> <PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
</td> </td>
</tr> </tr>
<tr>
<td align="right" valign="top">
<b>Reference:</b>
</td>
<td align="left" valign="top">
<PRE><gsweb name="ReferenceString"></gsweb></PRE>
</td>
</tr>
<tr> <tr>
<td align="RIGHT" Valign="MIDDLE"> <td align="RIGHT" Valign="MIDDLE">
<b>Error:</b> <b>Error:</b>

View file

@ -35,6 +35,7 @@
NSException* _exception; NSException* _exception;
NSArray* _reasons; NSArray* _reasons;
id _reference;
}; };
-(void)dealloc; -(void)dealloc;
@ -42,6 +43,7 @@
-(void)appendToResponse:(GSWResponse*)response -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context; inContext:(GSWContext*)context;
-(void)setException:(NSException*)exception; -(void)setException:(NSException*)exception;
-(NSString*)referenceString;
@end @end
#endif // _GSWExceptionPage_h__ #endif // _GSWExceptionPage_h__

View file

@ -42,6 +42,8 @@ static char rcsId[] = "$Id$";
DESTROY(_exception); DESTROY(_exception);
GSWLogC("Dealloc GSWExceptionPage reasons\n"); GSWLogC("Dealloc GSWExceptionPage reasons\n");
DESTROY(_reasons); DESTROY(_reasons);
GSWLogC("Dealloc GSWExceptionPage reference\n");
DESTROY(_reference);
GSWLogC("Dealloc GSWExceptionPage super\n"); GSWLogC("Dealloc GSWExceptionPage super\n");
[super dealloc]; [super dealloc];
GSWLogC("Dealloc GSWExceptionPage end\n"); GSWLogC("Dealloc GSWExceptionPage end\n");
@ -49,6 +51,10 @@ static char rcsId[] = "$Id$";
-(void)awake -(void)awake
{ {
if (!_reference)
{
ASSIGN(_reference,[NSCalendarDate calendarDate]);
}
[super awake]; [super awake];
}; };
@ -87,4 +93,9 @@ static char rcsId[] = "$Id$";
else else
return _tmpUserInfoValue; return _tmpUserInfoValue;
} }
-(NSString*)referenceString
{
return _reference;
}
@end @end

View file

@ -29,12 +29,16 @@ ImageWithPath: GSWImage
{ {
filename = fileInfo.filePath; filename = fileInfo.filePath;
border = 0; border = 0;
width = ^imageWidth;
height = ^imageHeight;
}; };
ImageWithURL: GSWImage ImageWithURL: GSWImage
{ {
src = fileInfo.fileURL; src = fileInfo.fileURL;
border = 0; border = 0;
width = ^imageWidth;
height = ^imageHeight;
}; };
UploadFile: GSWFileUpload UploadFile: GSWFileUpload
@ -71,3 +75,8 @@ DeleteCheckBox: GSWCheckBox
enabled=isDeleteEnabled; enabled=isDeleteEnabled;
checked= fileInfo.isDeleted; checked= fileInfo.isDeleted;
}; };
DeleteCheckBoxTitle: GSWString
{
value = ^deleteCheckBoxText;
};

View file

@ -16,7 +16,8 @@
</gsweb> </gsweb>
</gsweb> </gsweb>
</gsweb> </gsweb>
<br>
<gsweb name="UploadFile"></gsweb><br> <gsweb name="UploadFile"></gsweb><br>
<gsweb name="DeleteCondition"> <gsweb name="DeleteCondition">
<gsweb name="DeleteCheckBox"></gsweb> <gsweb name="DeleteCheckBoxTitle"></gsweb><gsweb name="DeleteCheckBox"></gsweb>
</gsweb> </gsweb>

View file

@ -26,7 +26,7 @@
//==================================================================== //====================================================================
@interface GSWFileUploadComponent : GSWComponent @interface GSWFileUploadComponent : GSWComponent
{ {
NSMutableDictionary* _fileInfo; NSMutableDictionary* _tmpFileInfo;
}; };
-(id)init; -(id)init;
-(void)dealloc; -(void)dealloc;

View file

@ -51,6 +51,7 @@ static char rcsId[] = "$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
[super awake]; [super awake];
_tmpFileInfo=nil;
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -58,6 +59,7 @@ static char rcsId[] = "$Id$";
-(void)sleep -(void)sleep
{ {
LOGObjectFnStart(); LOGObjectFnStart();
_tmpFileInfo=nil;
[super sleep]; [super sleep];
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -65,7 +67,6 @@ static char rcsId[] = "$Id$";
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)dealloc -(void)dealloc
{ {
DESTROY(_fileInfo);
[super dealloc]; [super dealloc];
}; };
@ -82,6 +83,7 @@ static char rcsId[] = "$Id$";
[aResponse appendDebugCommentContentString:[[self fileInfo]description]]; [aResponse appendDebugCommentContentString:[[self fileInfo]description]];
[super appendToResponse:aResponse [super appendToResponse:aResponse
inContext:aContext]; inContext:aContext];
_tmpFileInfo=nil;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -89,19 +91,20 @@ static char rcsId[] = "$Id$";
inContext:(GSWContext*)aContext inContext:(GSWContext*)aContext
{ {
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLog(@"fileInfo %@",_fileInfo); NSDebugMLog(@"fileInfo %@",_tmpFileInfo);
[super takeValuesFromRequest:aRequest [super takeValuesFromRequest:aRequest
inContext:aContext]; inContext:aContext];
NSDebugMLog(@"fileInfo.fileURL %@",[_fileInfo valueForKey:@"fileURL"]); NSDebugMLog(@"fileInfo.fileURL %@",[_tmpFileInfo valueForKey:@"fileURL"]);
NSDebugMLog(@"fileInfo.fileName %@",[_fileInfo valueForKey:@"fileName"]); NSDebugMLog(@"fileInfo.fileName %@",[_tmpFileInfo valueForKey:@"fileName"]);
NSDebugMLog(@"fileInfo.filePath %@",[_fileInfo valueForKey:@"filePath"]); NSDebugMLog(@"fileInfo.filePath %@",[_tmpFileInfo valueForKey:@"filePath"]);
NSDebugMLog(@"fileInfo.data %p",[_fileInfo valueForKey:@"data"]); NSDebugMLog(@"fileInfo.data %p",[_tmpFileInfo valueForKey:@"data"]);
NSDebugMLog(@"fileInfo.mimeType %@",[_fileInfo valueForKey:@"mimeType"]); NSDebugMLog(@"fileInfo.data length %d",(int)[[_tmpFileInfo valueForKey:@"data"] length]);
NSDebugMLog(@"fileInfo.isDeleted %@",[_fileInfo valueForKey:@"isDeleted"]); NSDebugMLog(@"fileInfo.mimeType %@",[_tmpFileInfo valueForKey:@"mimeType"]);
if ([[_fileInfo valueForKey:@"data"]length]>0 || boolValueWithDefaultFor([_fileInfo valueForKey:@"isDeleted"],NO)) NSDebugMLog(@"fileInfo.isDeleted %@",[_tmpFileInfo valueForKey:@"isDeleted"]);
[self setValue:_fileInfo if ([[_tmpFileInfo valueForKey:@"data"]length]>0 || boolValueWithDefaultFor([_tmpFileInfo valueForKey:@"isDeleted"],NO))
[self setValue:_tmpFileInfo
forBinding:@"fileInfo"]; forBinding:@"fileInfo"];
DESTROY(_fileInfo); _tmpFileInfo=nil;
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -109,17 +112,17 @@ static char rcsId[] = "$Id$";
-(NSMutableDictionary*)fileInfo -(NSMutableDictionary*)fileInfo
{ {
LOGObjectFnStart(); LOGObjectFnStart();
if (!_fileInfo) if (!_tmpFileInfo)
{ {
if ([self hasBinding:@"fileInfo"]) if ([self hasBinding:@"fileInfo"])
{ {
_fileInfo=[[self valueForBinding:@"fileInfo"] mutableCopy]; _tmpFileInfo=[[[self valueForBinding:@"fileInfo"] mutableCopy] autorelease];
if (!_fileInfo) if (!_tmpFileInfo)
_fileInfo=[NSMutableDictionary new]; _tmpFileInfo=(NSMutableDictionary*)[NSMutableDictionary dictionary];
}; };
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return _fileInfo; return _tmpFileInfo;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------

View file

@ -763,7 +763,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
if (keyPath) if (keyPath)
{ {
#if GDL2 #if GDL2
[object takeValue:value [object smartTakeValue:value
forKeyPath:keyPath]; forKeyPath:keyPath];
#else #else
NSMutableArray* keys=[[keyPath_ componentsSeparatedByString:@"."] mutableCopy]; NSMutableArray* keys=[[keyPath_ componentsSeparatedByString:@"."] mutableCopy];

View file

@ -402,7 +402,7 @@ objectForReference:(NSString*)keyPath
variableValue, variableValue,
variableValue, variableValue,
[variableValue retainCount]); [variableValue retainCount]);
[object_ takeValue:variableValue [object_ smartTakeValue:variableValue
forKey:variableName]; forKey:variableName];
NSDebugMLLog(@"bundles",@"AFT variableValue %p:%@ [RC=%d]", NSDebugMLLog(@"bundles",@"AFT variableValue %p:%@ [RC=%d]",
variableValue, variableValue,

View file

@ -430,8 +430,13 @@ associationsKeys:(NSArray*)associationsKeys
inComponent:self]; inComponent:self];
/*//MGNEW [self setIVarNamed:aKey /*//MGNEW [self setIVarNamed:aKey
withValue:aValue];*/ withValue:aValue];*/
#if GDL2 // GDL2 implementation
[self smartTakeValue:aValue
forKey:aKey];
#else
[self takeValue:aValue [self takeValue:aValue
forKey:aKey]; forKey:aKey];
#endif
}; };
}; };
}; };
@ -838,7 +843,7 @@ associationsKeys:(NSArray*)associationsKeys
{ {
NS_DURING NS_DURING
{ {
[self takeValue:value_ [self smartTakeValue:value_
forKey:parentBindingName_]; forKey:parentBindingName_];
} }
NS_HANDLER; NS_HANDLER;

View file

@ -135,37 +135,51 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
-(NSString*)description -(NSString*)description
{ {
NSString* _dscr=nil; NSString* dscr=nil;
GSWLogAssertGood(self); GSWLogAssertGood(self);
NSDebugMLLog(@"gswdisplaygroup",@"GSWDisplayGroup description Self=%p",self); NSDebugMLLog(@"gswdisplaygroup",@"GSWDisplayGroup description Self=%p",self);
_dscr=[NSString stringWithFormat:@"<%s %p - \n", dscr=[NSString stringWithFormat:@"<%s %p - \n",
object_get_class_name(self), object_get_class_name(self),
(void*)self]; (void*)self];
_dscr=[_dscr stringByAppendingFormat:@"numberOfObjectsPerBatch:[%d]\n", dscr=[dscr stringByAppendingFormat:@"numberOfObjectsPerBatch:[%d]\n",
_numberOfObjectsPerBatch]; _numberOfObjectsPerBatch];
_dscr=[_dscr stringByAppendingFormat:@"fetchesOnLoad:[%s]\n", dscr=[dscr stringByAppendingFormat:@"fetchesOnLoad:[%s]\n",
_flags.autoFetch ? "YES" : "NO"]; _flags.autoFetch ? "YES" : "NO"];
_dscr=[_dscr stringByAppendingFormat:@"validatesChangesImmediately:[%s]\n", dscr=[dscr stringByAppendingFormat:@"validatesChangesImmediately:[%s]\n",
_flags.validateImmediately ? "YES" : "NO"]; _flags.validateImmediately ? "YES" : "NO"];
_dscr=[_dscr stringByAppendingFormat:@"selectsFirstObjectAfterFetch:[%s]\n", dscr=[dscr stringByAppendingFormat:@"selectsFirstObjectAfterFetch:[%s]\n",
_flags.selectFirstObject ? "YES" : "NO"]; _flags.selectFirstObject ? "YES" : "NO"];
_dscr=[_dscr stringByAppendingFormat:@"localKeys:[%@]\n", dscr=[dscr stringByAppendingFormat:@"localKeys:[%@]\n",
_localKeys]; _localKeys];
_dscr=[_dscr stringByAppendingFormat:@"dataSource:[%@]\n", dscr=[dscr stringByAppendingFormat:@"dataSource:[%@]\n",
_dataSource]; _dataSource];
_dscr=[_dscr stringByAppendingFormat:@"sortOrdering:[%@]\n", dscr=[dscr stringByAppendingFormat:@"sortOrdering:[%@]\n",
_sortOrdering]; _sortOrdering];
_dscr=[_dscr stringByAppendingFormat:@"qualifier:[%@]\n", dscr=[dscr stringByAppendingFormat:@"qualifier:[%@]\n",
_qualifier]; _qualifier];
_dscr=[_dscr stringByAppendingFormat:@"formatForLikeQualifier:[%@]\n", dscr=[dscr stringByAppendingFormat:@"formatForLikeQualifier:[%@]\n",
_defaultStringMatchFormat]; _defaultStringMatchFormat];
_dscr=[_dscr stringByAppendingFormat:@"insertedObjectDefaultValues:[%@]\n", dscr=[dscr stringByAppendingFormat:@"insertedObjectDefaultValues:[%@]\n",
_insertedObjectDefaultValues]; _insertedObjectDefaultValues];
_dscr=[_dscr stringByAppendingFormat:@"queryOperator:[%@]\n", dscr=[dscr stringByAppendingFormat:@"queryOperator:[%@]\n",
_queryOperator]; _queryOperator];
dscr=[dscr stringByAppendingFormat:@"queryMatch:[%@]\n",
return _dscr; _queryMatch];
dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n",
_queryMin];
dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n",
_queryMax];
dscr=[dscr stringByAppendingFormat:@"queryOperator:[%@]\n",
_queryOperator];
dscr=[dscr stringByAppendingFormat:@"defaultStringMatchOperator:[%@]\n",
_defaultStringMatchOperator];
dscr=[dscr stringByAppendingFormat:@"defaultStringMatchFormat:[%@]\n",
_defaultStringMatchFormat];
dscr=[dscr stringByAppendingFormat:@"queryBindings:[%@]\n",
_queryBindings];
dscr=[dscr stringByAppendingString:@">"];
return dscr;
}; };
@ -1816,6 +1830,7 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
ofObject:masterObject]; ofObject:masterObject];
if ([self fetchesOnLoad]) if ([self fetchesOnLoad])
{ {
NSDebugMLLog(@"gswdisplaygroup",@"will fetch");
[self fetch]; [self fetch];
}; };
}; };
@ -1844,6 +1859,7 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
//self selectedObjects //self selectedObjects
// self updateDisplayedObjects // self updateDisplayedObjects
NSDebugMLog(@"objects=%@",objects); NSDebugMLog(@"objects=%@",objects);
[_allObjects removeAllObjects]; [_allObjects removeAllObjects];
[_allObjects addObjectsFromArray:objects]; [_allObjects addObjectsFromArray:objects];
@ -2053,6 +2069,7 @@ STOP ?
else else
{ {
_batchIndex = [self batchCount]; _batchIndex = [self batchCount];
NSDebugMLog(@"_batchIndex=%d",_batchIndex);
[self displayNextBatch]; [self displayNextBatch];
} }

View file

@ -66,6 +66,7 @@ extern BYTE ElementsMap_attributeElement;
#endif #endif
-(NSString*)definitionName; -(NSString*)definitionName;
-(void)setDefinitionName:(NSString*)definitionName;
@end @end
#ifdef NDEBBUG #ifdef NDEBBUG

View file

@ -60,20 +60,22 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
line:(int)line line:(int)line
{ {
LOGObjectFnStartC("GSWElement"); LOGObjectFnStartC("GSWElement");
NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d", /* NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
self, self,
[self class], [self class],
[self definitionName], [self definitionName],
_appendToResponseElementID,[_appendToResponseElementID length]); _appendToResponseElementID,[_appendToResponseElementID length]);
*/
[self assertIsElementIDInContext:context [self assertIsElementIDInContext:context
method:method method:method
file:file file:file
line:line]; line:line];
NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d", /* NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
self, self,
[self class], [self class],
[self definitionName], [self definitionName],
_appendToResponseElementID,[_appendToResponseElementID length]); _appendToResponseElementID,[_appendToResponseElementID length]);
*/
if ([_appendToResponseElementID length]>0) if ([_appendToResponseElementID length]>0)
{ {
NSString* elementID=[context elementID]; NSString* elementID=[context elementID];
@ -116,10 +118,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
line:(int)line line:(int)line
{ {
LOGObjectFnStartC("GSWElement"); LOGObjectFnStartC("GSWElement");
NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@", /* NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@",
self, self,
[self definitionName], [self definitionName],
_appendToResponseElementID,_appendToResponseElementID,[context elementID]); _appendToResponseElementID,_appendToResponseElementID,[context elementID]);
*/
if (_appendToResponseElementID && [_appendToResponseElementID length]==0 && [[context elementID] length]>0) if (_appendToResponseElementID && [_appendToResponseElementID length]==0 && [[context elementID] length]>0)
{ {
NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), in %@ _appendToResponseElementID '%@' (%p) is not set", NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), in %@ _appendToResponseElementID '%@' (%p) is not set",

View file

@ -145,8 +145,8 @@ static char rcsId[] = "$Id$";
if (fileDatasCount==1) if (fileDatasCount==1)
{ {
dataValue=[fileDatas objectAtIndex:0]; dataValue=[fileDatas objectAtIndex:0];
NSDebugMLLog(@"gswdync",@"dataValue (class=%@)=%@", NSDebugMLLog(@"gswdync",@"dataValue %p (class=%@)=%@",
[dataValue class],dataValue); dataValue,[dataValue class],dataValue);
if (dataValue) if (dataValue)
{ {
if ([dataValue isKindOfClass:[NSData class]]) if ([dataValue isKindOfClass:[NSData class]])
@ -161,12 +161,16 @@ static char rcsId[] = "$Id$";
if ([dataValue isKindOfClass:[NSString class]] && [dataValue length]==0) if ([dataValue isKindOfClass:[NSString class]] && [dataValue length]==0)
{ {
LOGError(@"No Data: %@",dataValue); LOGError(@"No Data: %@",dataValue);
NSDebugMLLog(@"gswdync",@"No Data: %p (class=%@)=%@",
dataValue,[dataValue class],dataValue);
dataValue=nil; dataValue=nil;
} }
else else
{ {
NSLog(@"content type request : %@",[request _contentType]); NSLog(@"content type request : %@",[request _contentType]);
NSLog(@"data class = %@",NSStringFromClass([dataValue class])); NSLog(@"data class = %@",NSStringFromClass([dataValue class]));
NSDebugMLLog(@"gswdync",@"??Data: %p (class=%@)=%@",
dataValue,[dataValue class],dataValue);
/*if (![dataValue isMemberOfClass:[NSString class]]) { /*if (![dataValue isMemberOfClass:[NSString class]]) {
ExceptionRaise(@"GSWFileUpload", ExceptionRaise(@"GSWFileUpload",
@"GSWFileUpload: bad data :%@", @"GSWFileUpload: bad data :%@",

View file

@ -378,6 +378,7 @@ static char rcsId[] = "$Id$";
else else
{ {
//TODO //TODO
thisOne=YES;//??
}; };
}; };
} }

View file

@ -1390,17 +1390,27 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF
if (!_headersEnd) if (!_headersEnd)
{ {
//TODO error //TODO error
NSDebugMLog(@"Error");
} }
else else
{ {
NSDebugMLLog(@"requests",@"i=%d",i); NSDebugMLLog(@"requests",@"i=%d _dataLength=%d _dataLength-i=%d",i,_dataLength,(_dataLength-i));
_data=[data_ subdataWithRange:NSMakeRange(i,_dataLength-i)]; _data=[data_ subdataWithRange:NSMakeRange(i,_dataLength-i)];
//I'm not sure this is good but it avoid 2 bytes datas on an empty input type=file located t the end of the request)
//It may be better to deal with this few lines up, around (_headersEnd=YES;)
if ([_data length]==2)
{
const unsigned char* _bytes=(unsigned char*)[_data bytes];
if (_bytes[0]=='\r' && _bytes[1]=='\n')
_data=[NSData data];
};
}; };
_headers=[NSDictionary dictionaryWithDictionary:_headers]; _headers=[NSDictionary dictionaryWithDictionary:_headers];
_parsedData=[NSArray arrayWithObjects:_headers,_data,nil]; _parsedData=[NSArray arrayWithObjects:_headers,_data,nil];
NSDebugMLLog(@"requests",@"_headers=%@",_headers); NSDebugMLLog(@"requests",@"_headers=%@",_headers);
NSDebugMLLog(@"requests",@"_data=%@",_data); NSDebugMLLog(@"requests",@"_data %p (length=%d)=%@",_data,[_data length],_data);
NSDebugMLLog(@"requests",@"_parsedData=%@",_parsedData); NSDebugMLLog(@"requests",@"_parsedData %p =%@",_parsedData,_parsedData);
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return _parsedData; return _parsedData;