Explorar el Código

Renamed public upgraded handle type

Evgeny Grin (Karlson2k) hace 1 año
padre
commit
c2c7123825

+ 6 - 6
src/include/microhttpd2.h

@@ -1439,7 +1439,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
   MHD_SC_DAEMON_DESTROYED_WITH_UNCLOSED_UPGRADED = 60160
   ,
   /**
-   * The provided pointer to 'struct MHD_UpgradeHandle' is invalid
+   * The provided pointer to 'struct MHD_UpgradedHandle' is invalid
    */
   MHD_SC_UPGRADED_HANDLE_INVALID = 60161
   ,
@@ -6628,7 +6628,7 @@ MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3,2);
  * actions relating to MHD responses that "upgrade"
  * the HTTP protocol (i.e. to WebSockets).
  */
-struct MHD_UpgradeHandle;
+struct MHD_UpgradedHandle;
 
 
 #ifndef MHD_UPGRADEHANDLER_DEFINED
@@ -6660,7 +6660,7 @@ typedef void
 (MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_NONNULL_ (3)
  *MHD_UpgradeHandler)(void *cls,
                       struct MHD_Request *MHD_RESTRICT request,
-                      struct MHD_UpgradeHandle *MHD_RESTRICT urh);
+                      struct MHD_UpgradedHandle *MHD_RESTRICT urh);
 
 #define MHD_UPGRADEHANDLER_DEFINED 1
 #endif /* ! MHD_UPGRADEHANDLER_DEFINED */
@@ -6773,7 +6773,7 @@ MHD_FN_PAR_IN_SIZE_ (6,5);
  *                                                by this MHD build or platform
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_recv (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_recv (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t recv_buf_size,
                    void *MHD_RESTRICT recv_buf,
                    size_t *MHD_RESTRICT received_size,
@@ -6827,7 +6827,7 @@ MHD_FN_PAR_OUT_ (4);
  *                                                by this MHD build or platform
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_send (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_send (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t send_buf_size,
                    const void *MHD_RESTRICT send_buf,
                    size_t *MHD_RESTRICT sent_size,
@@ -6850,7 +6850,7 @@ MHD_FN_PAR_OUT_ (4);
  *         error code otherwise
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_close (struct MHD_UpgradeHandle *urh)
+MHD_upgraded_close (struct MHD_UpgradedHandle *urh)
 MHD_FN_PAR_NONNULL_ (1);
 
 

+ 5 - 5
src/include/microhttpd2_main.h.in

@@ -2204,7 +2204,7 @@ MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3,2);
  * actions relating to MHD responses that "upgrade"
  * the HTTP protocol (i.e. to WebSockets).
  */
-struct MHD_UpgradeHandle;
+struct MHD_UpgradedHandle;
 
 
 #ifndef MHD_UPGRADEHANDLER_DEFINED
@@ -2236,7 +2236,7 @@ typedef void
 (MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_NONNULL_ (3)
  *MHD_UpgradeHandler)(void *cls,
                       struct MHD_Request *MHD_RESTRICT request,
-                      struct MHD_UpgradeHandle *MHD_RESTRICT urh);
+                      struct MHD_UpgradedHandle *MHD_RESTRICT urh);
 
 #define MHD_UPGRADEHANDLER_DEFINED 1
 #endif /* ! MHD_UPGRADEHANDLER_DEFINED */
@@ -2349,7 +2349,7 @@ MHD_FN_PAR_IN_SIZE_ (6,5);
  *                                                by this MHD build or platform
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_recv (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_recv (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t recv_buf_size,
                    void *MHD_RESTRICT recv_buf,
                    size_t *MHD_RESTRICT received_size,
@@ -2403,7 +2403,7 @@ MHD_FN_PAR_OUT_ (4);
  *                                                by this MHD build or platform
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_send (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_send (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t send_buf_size,
                    const void *MHD_RESTRICT send_buf,
                    size_t *MHD_RESTRICT sent_size,
@@ -2426,7 +2426,7 @@ MHD_FN_PAR_OUT_ (4);
  *         error code otherwise
  */
 MHD_EXTERN_ enum MHD_StatusCode
-MHD_upgraded_close (struct MHD_UpgradeHandle *urh)
+MHD_upgraded_close (struct MHD_UpgradedHandle *urh)
 MHD_FN_PAR_NONNULL_ (1);
 
 

+ 1 - 1
src/include/microhttpd2_preamble.h.in

@@ -1439,7 +1439,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
   MHD_SC_DAEMON_DESTROYED_WITH_UNCLOSED_UPGRADED = 60160
   ,
   /**
-   * The provided pointer to 'struct MHD_UpgradeHandle' is invalid
+   * The provided pointer to 'struct MHD_UpgradedHandle' is invalid
    */
   MHD_SC_UPGRADED_HANDLE_INVALID = 60161
   ,

+ 2 - 2
src/mhd2/mhd_action.h

@@ -213,14 +213,14 @@ struct mhd_PostParseActionData
 
 #ifdef MHD_UPGRADE_SUPPORT
 
-struct MHD_UpgradeHandle; /* forward declaration */
+struct MHD_UpgradedHandle; /* forward declaration */
 
 #ifndef MHD_UPGRADEHANDLER_DEFINED
 
 typedef void
 (*MHD_UpgradeHandler)(void *cls,
                       struct MHD_Request *MHD_RESTRICT request,
-                      struct MHD_UpgradeHandle *MHD_RESTRICT urh);
+                      struct MHD_UpgradedHandle *MHD_RESTRICT urh);
 
 #define MHD_UPGRADEHANDLER_DEFINED 1
 #endif /* ! MHD_UPGRADEHANDLER_DEFINED */

+ 1 - 1
src/mhd2/mhd_connection.h

@@ -458,7 +458,7 @@ struct MHD_Connection
   /**
    * The data for handling HTTP-Upgraded connection
    */
-  struct MHD_UpgradeHandle upgr;
+  struct MHD_UpgradedHandle upgr;
 
   /**
    * Double-linke list of HTTP-Upgraded connections waiting for clean-up

+ 1 - 1
src/mhd2/mhd_upgrade.h

@@ -37,7 +37,7 @@ struct MHD_Connection; /* forward declaration */
 /**
  * The data for "HTTP-upgraded" connection
  */
-struct MHD_UpgradeHandle
+struct MHD_UpgradedHandle
 {
   /**
    * The pointer to the "connection" object

+ 1 - 1
src/mhd2/upgrade_proc.c

@@ -116,7 +116,7 @@ mhd_upgrade_finish_switch_to_upgraded (struct MHD_Connection *restrict c)
 
 MHD_EXTERN_
 MHD_FN_PAR_NONNULL_ (1) enum MHD_StatusCode
-MHD_upgraded_close (struct MHD_UpgradeHandle *urh)
+MHD_upgraded_close (struct MHD_UpgradedHandle *urh)
 {
   struct MHD_Connection *const restrict c = urh->c;
   struct MHD_Daemon *const restrict d = c->daemon;

+ 3 - 3
src/mhd2/upgraded_net.c

@@ -19,7 +19,7 @@
 */
 
 /**
- * @file src/mhd2/upgrade_net.c
+ * @file src/mhd2/upgraded_net.c
  * @brief  The implementation of functions for network data exchange
  *         for HTTP Upgraded connections
  * @author Karlson2k (Evgeny Grin)
@@ -102,7 +102,7 @@ MHD_EXTERN_
 MHD_FN_PAR_NONNULL_ALL_
 MHD_FN_PAR_OUT_SIZE_ (3,2)
 MHD_FN_PAR_OUT_ (4) enum MHD_StatusCode
-MHD_upgraded_recv (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_recv (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t recv_buf_size,
                    void *MHD_RESTRICT recv_buf,
                    size_t *MHD_RESTRICT received_size,
@@ -318,7 +318,7 @@ MHD_EXTERN_
 MHD_FN_PAR_NONNULL_ALL_
 MHD_FN_PAR_IN_SIZE_ (3,2)
 MHD_FN_PAR_OUT_ (4) enum MHD_StatusCode
-MHD_upgraded_send (struct MHD_UpgradeHandle *MHD_RESTRICT urh,
+MHD_upgraded_send (struct MHD_UpgradedHandle *MHD_RESTRICT urh,
                    size_t send_buf_size,
                    const void *MHD_RESTRICT send_buf,
                    size_t *MHD_RESTRICT sent_size,

+ 7 - 5
src/tests/upgrade/test_upgrade.c

@@ -568,6 +568,7 @@ wr_create_tls_sckt (void)
   return NULL;
 }
 
+
 #if defined(HTTPS_SUPPORT) && defined(HAVE_FORK) && defined(HAVE_WAITPID)
 
 /**
@@ -595,6 +596,7 @@ wr_create_from_plain_sckt (MHD_Socket plain_sk)
   return s;
 }
 
+
 #endif /* HTTPS_SUPPORT && HAVE_FORK && HAVE_WAITPID */
 
 #if 0 /* Disabled code */
@@ -1352,7 +1354,7 @@ receive_eof (struct wr_socket *sock)
 #endif /* Unused code */
 
 static void
-recv_upg_all (struct MHD_UpgradeHandle *urh,
+recv_upg_all (struct MHD_UpgradedHandle *urh,
               const void *data,
               size_t data_size)
 {
@@ -1410,7 +1412,7 @@ recv_upg_all (struct MHD_UpgradeHandle *urh,
 
 
 static void
-send_upg_all (struct MHD_UpgradeHandle *urh,
+send_upg_all (struct MHD_UpgradedHandle *urh,
               const void *data,
               size_t data_size)
 {
@@ -1435,7 +1437,7 @@ send_upg_all (struct MHD_UpgradeHandle *urh,
  * @param urh the "upgraded" handle to use
  */
 static void
-receive_upg_eof (struct MHD_UpgradeHandle *urh)
+receive_upg_eof (struct MHD_UpgradedHandle *urh)
 {
   size_t rcvd_sise;
   uint8_t buf[1];
@@ -1463,7 +1465,7 @@ receive_upg_eof (struct MHD_UpgradeHandle *urh)
 static void *
 run_usock_server (void *cls)
 {
-  struct MHD_UpgradeHandle *urh = cls;
+  struct MHD_UpgradedHandle *urh = cls;
 
   recv_upg_all (urh,
                 rclient_msg,
@@ -1548,7 +1550,7 @@ run_usock_client (void *cls)
 static void
 upgrade_cb (void *cls,
             struct MHD_Request *MHD_RESTRICT request,
-            struct MHD_UpgradeHandle *MHD_RESTRICT urh)
+            struct MHD_UpgradedHandle *MHD_RESTRICT urh)
 {
   if (NULL != cls)
     mhdErrorExitDesc ("'cls' is not NULL");