Prechádzať zdrojové kódy

MHD_daemon_event_update(): finished two log messages

Evgeny Grin (Karlson2k) 10 mesiacov pred
rodič
commit
c23197590f

+ 11 - 0
src/include/microhttpd2.h

@@ -1684,6 +1684,17 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
    * The application failed to de-register FD for the external events monitoring
    */
   MHD_SC_EXTR_EVENT_DEREG_FAILED = 60244
+  ,
+  /**
+   * The application called #MHD_daemon_event_update() with broken data
+   */
+  MHD_SC_EXTR_EVENT_BROKEN_DATA = 60250
+  ,
+  /**
+   * The application called #MHD_daemon_event_update() with status that
+   * has not been requested
+   */
+  MHD_SC_EXTR_EVENT_UNEXPECTED_STATUS = 60251
 };
 
 /**

+ 11 - 0
src/include/microhttpd2_preamble.h.in

@@ -1684,6 +1684,17 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
    * The application failed to de-register FD for the external events monitoring
    */
   MHD_SC_EXTR_EVENT_DEREG_FAILED = 60244
+  ,
+  /**
+   * The application called #MHD_daemon_event_update() with broken data
+   */
+  MHD_SC_EXTR_EVENT_BROKEN_DATA = 60250
+  ,
+  /**
+   * The application called #MHD_daemon_event_update() with status that
+   * has not been requested
+   */
+  MHD_SC_EXTR_EVENT_UNEXPECTED_STATUS = 60251
 };
 
 /**

+ 9 - 4
src/mhd2/daemon_event_update.c

@@ -56,6 +56,7 @@ MHD_daemon_event_update (
     return;
 
   broken_app_data = false;
+  unneeded_event = false;
 
   switch ((mhd_SockRelMarker) ecb_cntx)
   {
@@ -115,12 +116,16 @@ MHD_daemon_event_update (
 
   if (broken_app_data)
   {
-    // TODO: log error
-    (void) 0;
+    mhd_LOG_MSG (daemon, \
+                 MHD_SC_EXTR_EVENT_BROKEN_DATA, \
+                 "MHD_daemon_event_update() is called with broken content " \
+                 "data");
   }
   else if (unneeded_event)
   {
-    // TODO: log error
-    (void) 0;
+    mhd_LOG_MSG (daemon, \
+                 MHD_SC_EXTR_EVENT_BROKEN_DATA, \
+                 "MHD_daemon_event_update() is called with status that has " \
+                 "not been requested");
   }
 }