Tidy hanbdleing of encoding type

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13922 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-06-19 15:57:23 +00:00
parent 97d7e3f93a
commit e74f169f9e

View file

@ -3586,11 +3586,12 @@ static NSCharacterSet *tokenSet = nil;
}
type = [self headerNamed: @"content-type"];
}
enc = [self headerNamed: @"content-transfer-encoding"];
if ([[type objectForKey: @"Type"] isEqual: @"multipart"] == YES)
{
NSString *v;
enc = [self headerNamed: @"content-transfer-encoding"];
if (enc != nil)
{
[NSException raise: NSInternalInconsistencyException
@ -3605,9 +3606,12 @@ static NSCharacterSet *tokenSet = nil;
}
boundary = [v dataUsingEncoding: NSASCIIStringEncoding];
}
else if (enc == nil)
else
{
d = [self convertToData];
enc = [self headerNamed: @"content-transfer-encoding"];
if (enc == nil)
{
enc = [GSMimeHeader alloc];
if ([[type objectForKey: @"Type"] isEqual: @"text"] == YES)
{
@ -3635,6 +3639,7 @@ static NSCharacterSet *tokenSet = nil;
[self addHeader: enc];
RELEASE(enc);
}
}
/*
* Now build the output.