libxml2 r3685 - trunk
- From: wbrack svn gnome org
- To: svn-commits-list gnome org
- Subject: libxml2 r3685 - trunk
- Date: Wed, 6 Feb 2008 04:12:47 +0000 (GMT)
Author: wbrack
Date: Wed Feb 6 04:12:46 2008
New Revision: 3685
URL: http://svn.gnome.org/viewvc/libxml2?rev=3685&view=rev
Log:
* nanohttp.c: added space for port number (when not 80) in
xmlNanoHTTPMethodRedir, plus a few more comments. Should
fix #514521.
Modified:
trunk/ChangeLog
trunk/nanohttp.c
Modified: trunk/nanohttp.c
==============================================================================
--- trunk/nanohttp.c (original)
+++ trunk/nanohttp.c Wed Feb 6 04:12:46 2008
@@ -1332,13 +1332,23 @@
if (headers != NULL)
blen += strlen(headers) + 2;
if (contentType && *contentType)
+ /* reserve for string plus 'Content-Type: \r\n" */
blen += strlen(*contentType) + 16;
if (ctxt->query != NULL)
+ /* 1 for '?' */
blen += strlen(ctxt->query) + 1;
blen += strlen(method) + strlen(ctxt->path) + 24;
#ifdef HAVE_ZLIB_H
+ /* reserve for possible 'Accept-Encoding: gzip' string */
blen += 23;
#endif
+ if (ctxt->port != 80) {
+ /* reserve space for ':xxxxx', incl. potential proxy */
+ if (proxy)
+ blen += 12;
+ else
+ blen += 6;
+ }
bp = (char*)xmlMallocAtomic(blen);
if ( bp == NULL ) {
xmlNanoHTTPFreeCtxt( ctxt );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]