libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 29ad274096d4a8e2c4812c57db415c9b885767df
parent 25e0d426214de820a2590f5895622ac0583a3c42
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 27 Jan 2012 10:01:51 +0000

-fixing #2120

Diffstat:
MChangeLog | 4++++
Msrc/daemon/postprocessor.c | 8+++++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 27 11:00:43 CET 2012 + Fixed postprocessor failure for applications that enclosed boundary + in quotes (#2120). -woof + Tue Jan 24 16:07:53 CET 2012 Added configure check for sin_len in 'struct sockaddr' and adding code to initialize this field if it exists now. -CG diff --git a/src/daemon/postprocessor.c b/src/daemon/postprocessor.c @@ -1,6 +1,6 @@ /* This file is part of libmicrohttpd - (C) 2007, 2009 Daniel Pittman and Christian Grothoff + (C) 2007, 2009, 2010, 2011, 2012 Daniel Pittman and Christian Grothoff This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -280,6 +280,12 @@ MHD_create_post_processor (struct MHD_Connection *connection, blen = strlen (boundary); if ((blen == 0) || (blen * 2 + 2 > buffer_size)) return NULL; /* (will be) out of memory or invalid boundary */ + if ( (boundary[0] == '"') && (boundary[blen - 1] == '"') ) + { + /* remove enclosing quotes */ + ++boundary; + blen -= 2; + } } else blen = 0;