gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31160 - in libmicrohttpd: . src/include src/microhttpd
Date: Sat, 7 Dec 2013 00:45:41 +0100

Author: grothoff
Date: 2013-12-07 00:45:41 +0100 (Sat, 07 Dec 2013)
New Revision: 31160

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/internal.h
Log:
-fix build issue without HTTPS and compiler warnings, as reported by   Dilyan 
Palauzov
on the mailinglist

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-12-06 22:01:13 UTC (rev 31159)
+++ libmicrohttpd/ChangeLog     2013-12-06 23:45:41 UTC (rev 31160)
@@ -1,3 +1,7 @@
+Sat Dec  7 00:44:49 CET 2013
+       Fixing warnings and build issue if --disable-https is given
+       to configure. -CG
+
 Tue Dec  3 21:25:56 CET 2013
        Security fix: do not read past 0-terminator when unescaping
        strings (thanks to Florian Weimer for reporting).

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2013-12-06 22:01:13 UTC (rev 
31159)
+++ libmicrohttpd/src/include/microhttpd.h      2013-12-06 23:45:41 UTC (rev 
31160)
@@ -121,7 +121,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00093200
+#define MHD_VERSION 0x00093201
 
 /**
  * MHD-internal return code for "YES".

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2013-12-06 22:01:13 UTC (rev 
31159)
+++ libmicrohttpd/src/microhttpd/connection.c   2013-12-06 23:45:41 UTC (rev 
31160)
@@ -352,14 +352,14 @@
                        MHD_MIN (response->data_buffer_size,
                                 response->total_size -
                                 connection->response_write_position));
-  if ( (MHD_CONTENT_READER_END_OF_STREAM == ret) ||
-       (MHD_CONTENT_READER_END_WITH_ERROR == ret) )
+  if ( (((ssize_t) MHD_CONTENT_READER_END_OF_STREAM) == ret) ||
+       (((ssize_t) MHD_CONTENT_READER_END_WITH_ERROR) == ret) )
     {
       /* either error or http 1.0 transfer, close socket! */
       response->total_size = connection->response_write_position;
       if (NULL != response->crc)
        pthread_mutex_unlock (&response->mutex);
-      if (MHD_CONTENT_READER_END_OF_STREAM == ret)
+      if ( ((ssize_t)MHD_CONTENT_READER_END_OF_STREAM) == ret)
        MHD_connection_close (connection, MHD_REQUEST_TERMINATED_COMPLETED_OK);
       else
        CONNECTION_CLOSE_ERROR (connection,
@@ -426,7 +426,8 @@
     {
       /* buffer already ready, use what is there for the chunk */
       ret = response->data_size + response->data_start - 
connection->response_write_position;
-      if (ret > connection->write_buffer_size - sizeof (cbuf) - 2)
+      if ( (ret > 0) &&
+           (((size_t) ret) > connection->write_buffer_size - sizeof (cbuf) - 
2) )
        ret = connection->write_buffer_size - sizeof (cbuf) - 2;
       memcpy (&connection->write_buffer[sizeof (cbuf)],
              &response->data[connection->response_write_position - 
response->data_start],
@@ -443,7 +444,7 @@
                             &connection->write_buffer[sizeof (cbuf)],
                             connection->write_buffer_size - sizeof (cbuf) - 2);
     }
-  if (MHD_CONTENT_READER_END_WITH_ERROR == ret)
+  if ( ((ssize_t) MHD_CONTENT_READER_END_WITH_ERROR) == ret)
     {
       /* error, close socket! */
       response->total_size = connection->response_write_position;
@@ -451,7 +452,7 @@
                              "Closing connection (error generating 
response)\n");
       return MHD_NO;
     }
-  if ( (MHD_CONTENT_READER_END_OF_STREAM == ret) ||
+  if ( (((ssize_t) MHD_CONTENT_READER_END_OF_STREAM) == ret) ||
        (0 == response->total_size) )
     {
       /* end of message, signal other side! */

Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h     2013-12-06 22:01:13 UTC (rev 
31159)
+++ libmicrohttpd/src/microhttpd/internal.h     2013-12-06 23:45:41 UTC (rev 
31160)
@@ -1,17 +1,17 @@
 /*
   This file is part of libmicrohttpd
   (C) 2007-2013 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
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
-  
+
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
-  
+
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
@@ -70,14 +70,14 @@
 #if HAVE_MESSAGES
 /**
  * Trigger 'panic' action based on fatal errors.
- * 
+ *
  * @param msg error message (const char *)
  */
 #define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg)
 #else
 /**
  * Trigger 'panic' action based on fatal errors.
- * 
+ *
  * @param msg error message (const char *)
  */
 #define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL)
@@ -142,12 +142,12 @@
 
     /**
      * We are waiting for the application to provide data.
-     */ 
+     */
     MHD_EVENT_LOOP_INFO_BLOCK = 2,
 
     /**
      * We are finished and are awaiting cleanup.
-     */ 
+     */
     MHD_EVENT_LOOP_INFO_CLEANUP = 3
   };
 
@@ -165,9 +165,9 @@
  * A structure representing the internal holder of the
  * nonce-nc map.
  */
-struct MHD_NonceNc 
+struct MHD_NonceNc
 {
-  
+
   /**
    * Nonce counter, a value that increases for each subsequent
    * request for the same nonce.
@@ -175,7 +175,7 @@
   unsigned long int nc;
 
   /**
-   * Nonce value: 
+   * Nonce value:
    */
   char nonce[MAX_NONCE_LENGTH];
 
@@ -186,8 +186,8 @@
  * fprintf-like helper function for logging debug
  * messages.
  */
-void 
-MHD_DLOG (const struct MHD_Daemon *daemon, 
+void
+MHD_DLOG (const struct MHD_Daemon *daemon,
          const char *format, ...);
 #endif
 
@@ -202,7 +202,7 @@
  * @return length of the resulting val (strlen(val) maybe
  *  shorter afterwards due to elimination of escape sequences)
  */
-size_t 
+size_t
 MHD_http_unescape (void *cls,
                   struct MHD_Connection *connection,
                   char *val);
@@ -833,6 +833,7 @@
    * even though the socket is not?
    */
   int tls_read_ready;
+#endif
 
   /**
    * Is the connection suspended?
@@ -843,7 +844,6 @@
    * Is the connection wanting to resume?
    */
   int resuming;
-#endif
 };
 
 /**
@@ -854,7 +854,7 @@
  * @param con connection handle
  * @return new closure
  */
-typedef void * (*LogCallback)(void * cls, 
+typedef void * (*LogCallback)(void * cls,
                              const char * uri,
                              struct MHD_Connection *con);
 
@@ -1088,7 +1088,7 @@
   int epoll_fd;
 
   /**
-   * MHD_YES if the listen socket is in the 'epoll' set, 
+   * MHD_YES if the listen socket is in the 'epoll' set,
    * MHD_NO if not.
    */
   int listen_socket_in_epoll;




reply via email to

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