mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Minor tweak to complete parsing earlier if content length is zero
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22885 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5aaf7ecd23
commit
149aeb6631
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-05-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m: Check for content-length specified as
|
||||
zero, and mark parsing as complete without attempting to read body.
|
||||
|
||||
2006-05-09 Nicolas Roard <nicolas@roard.com>
|
||||
|
||||
* Source/NSSortDescriptor.m: use -valueForKeyPath: instead
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>The MIME parsing system</title>
|
||||
<chapter>
|
||||
|
@ -1413,6 +1414,7 @@ wordData(NSString *word)
|
|||
if (flags.inBody == 1)
|
||||
{
|
||||
NSDictionary *info;
|
||||
GSMimeHeader *hdr;
|
||||
|
||||
info = [[document headersNamed: @"http"] lastObject];
|
||||
if (info != nil)
|
||||
|
@ -1436,6 +1438,17 @@ wordData(NSString *word)
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If there is a zero content length, parsing is complete.
|
||||
*/
|
||||
hdr = [document headerNamed: @"content-length"];
|
||||
if (hdr != nil && [[hdr value] intValue] == 0)
|
||||
{
|
||||
[document setContent: @""];
|
||||
flags.inBody = 0;
|
||||
flags.complete = 1;
|
||||
return NO; // No more data needed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue