Pārlūkot izejas kodu

MHD_get_connection_info(): fixed returned 'bool' which is not a member of union MHD_ConnectionInfo

Evgeny Grin (Karlson2k) 8 gadi atpakaļ
vecāks
revīzija
a3519410ee
2 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 2 1
      src/microhttpd/connection.c
  2. 5 0
      src/microhttpd/internal.h

+ 2 - 1
src/microhttpd/connection.c

@@ -3486,7 +3486,8 @@ MHD_get_connection_info (struct MHD_Connection *connection,
     case MHD_CONNECTION_INFO_SOCKET_CONTEXT:
       return (const union MHD_ConnectionInfo *) &connection->socket_context;
     case MHD_CONNECTION_INFO_CONNECTION_SUSPENDED:
-      return (const union MHD_ConnectionInfo *) &connection->suspended;
+      connection->suspended_dummy = connection->suspended ? MHD_YES : MHD_NO;
+      return (const union MHD_ConnectionInfo *) &connection->suspended_dummy;
     case MHD_CONNECTION_INFO_CONNECTION_TIMEOUT:
       connection->connection_timeout_dummy = (unsigned int)connection->connection_timeout;
       return (const union MHD_ConnectionInfo *) &connection->connection_timeout_dummy;

+ 5 - 0
src/microhttpd/internal.h

@@ -995,6 +995,11 @@ struct MHD_Connection
    */
   bool suspended;
 
+  /**
+   * Special member to be returned by #MHD_get_connection_info()
+   */
+  int suspended_dummy;
+
   /**
    * Is the connection wanting to resume?
    */