gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33463 - in libmicrohttpd: . src/include src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r33463 - in libmicrohttpd: . src/include src/microhttpd
Date: Mon, 2 Jun 2014 00:08:47 +0200

Author: grothoff
Date: 2014-06-02 00:08:47 +0200 (Mon, 02 Jun 2014)
New Revision: 33463

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/configure.ac
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/internal.c
Log:
fix #3413

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2014-06-01 21:35:18 UTC (rev 33462)
+++ libmicrohttpd/ChangeLog     2014-06-01 22:08:47 UTC (rev 33463)
@@ -1,3 +1,12 @@
+Mon Jun  2 00:03:28 CEST 2014
+       Added back unescaping for URI path (#3413) but without
+       unescaping '+' (#3371) to remain compatible with
+       MHD 0.9.34 and before.  Note that applications providing
+       a custom MHD_OPTION_UNESCAPE_CALLBACK are no longer expected
+       to replace '+' with ' ', as that is now done separately for
+       the locations where this transformation is appropriate.
+       Releasing 0.9.37. -CG
+
 Wed May 28 15:30:56 CEST 2014
        Properly applying patch that was supposed to be
        committed on "May  2 20:22:45 CEST 2014" to address

Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac  2014-06-01 21:35:18 UTC (rev 33462)
+++ libmicrohttpd/configure.ac  2014-06-01 22:08:47 UTC (rev 33463)
@@ -22,15 +22,15 @@
 #
 AC_PREREQ([2.60])
 LT_PREREQ([2.4.0])
-AC_INIT([libmicrohttpd],[0.9.36],address@hidden)
+AC_INIT([libmicrohttpd],[0.9.37],address@hidden)
 AM_INIT_AUTOMAKE([silent-rules] [subdir-objects])
 AC_CONFIG_HEADERS([MHD_config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AH_TOP([#define _GNU_SOURCE  1])
 
-LIB_VERSION_CURRENT=35
+LIB_VERSION_CURRENT=37
 LIB_VERSION_REVISION=0
-LIB_VERSION_AGE=25
+LIB_VERSION_AGE=27
 AC_SUBST(LIB_VERSION_CURRENT)
 AC_SUBST(LIB_VERSION_REVISION)
 AC_SUBST(LIB_VERSION_AGE)

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2014-06-01 21:35:18 UTC (rev 
33462)
+++ libmicrohttpd/src/include/microhttpd.h      2014-06-01 22:08:47 UTC (rev 
33463)
@@ -130,7 +130,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00093601
+#define MHD_VERSION 0x00093700
 
 /**
  * MHD-internal return code for "YES".

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2014-06-01 21:35:18 UTC (rev 
33462)
+++ libmicrohttpd/src/microhttpd/connection.c   2014-06-01 22:08:47 UTC (rev 
33463)
@@ -149,6 +149,21 @@
 
 
 /**
+ * Convert all occurences of '+' to ' '.
+ *
+ * @param arg string that is modified
+ */
+static void
+escape_plus (char *arg)
+{
+  char *p;
+
+  for (p=strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
+    *p = ' ';
+}
+
+
+/**
  * This function can be used to add an entry to the HTTP headers of a
  * connection (so that the #MHD_get_connection_values function will
  * return them -- and the `struct MHD_PostProcessor` will also see
@@ -1175,6 +1190,7 @@
          if (NULL == equals)
            {
              /* got 'foo', add key 'foo' with NULL for value */
+              escape_plus (args);
              connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                                     connection,
                                                     args);
@@ -1186,9 +1202,11 @@
          /* got 'foo=bar' */
          equals[0] = '\0';
          equals++;
+          escape_plus (args);
          connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                                 connection,
                                                 args);
+          escape_plus (equals);
          connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                                 connection,
                                                 equals);
@@ -1201,6 +1219,7 @@
           (equals >= amper) )
        {
          /* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value 
*/
+          escape_plus (args);
          connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                                 connection,
                                                 args);
@@ -1219,9 +1238,11 @@
         so we got regular 'foo=value&bar...'-kind of argument */
       equals[0] = '\0';
       equals++;
+      escape_plus (args);
       connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                             connection,
                                             args);
+      escape_plus (equals);
       connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                             connection,
                                             equals);
@@ -1369,11 +1390,9 @@
       args++;
       parse_arguments (MHD_GET_ARGUMENT_KIND, connection, args);
     }
-#if 0
   connection->daemon->unescape_callback 
(connection->daemon->unescape_callback_cls,
                                         connection,
                                         uri);
-#endif
   connection->url = uri;
   if (NULL == http_version)
     connection->version = "";

Modified: libmicrohttpd/src/microhttpd/internal.c
===================================================================
--- libmicrohttpd/src/microhttpd/internal.c     2014-06-01 21:35:18 UTC (rev 
33462)
+++ libmicrohttpd/src/microhttpd/internal.c     2014-06-01 22:08:47 UTC (rev 
33463)
@@ -105,7 +105,7 @@
 
 
 /**
- * Process escape sequences ('+'=space, %HH) Updates val in place; the
+ * Process escape sequences ('%HH') Updates val in place; the
  * result should be UTF-8 encoded and cannot be larger than the input.
  * The result must also still be 0-terminated.
  *
@@ -130,11 +130,6 @@
     {
       switch (*rpos)
        {
-       case '+':
-         *wpos = ' ';
-         wpos++;
-         rpos++;
-         break;
        case '%':
           if ( ('\0' == rpos[1]) ||
                ('\0' == rpos[2]) )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]