[libsoup] http2: make state changes warnings more verbose



commit 9eb49ed5867a6eb3688a2473670403390f75e832
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue May 18 12:02:01 2021 +0200

    http2: make state changes warnings more verbose

 libsoup/http2/soup-client-message-io-http2.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index 94e09fa3..90edcefa 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -254,12 +254,17 @@ advance_state_from (SoupHTTP2MessageData *data,
                     SoupHTTP2IOState      from,
                     SoupHTTP2IOState      to)
 {
-        if (from != STATE_ANY)
-                g_warn_if_fail (data->state == from);
+        if (from != STATE_ANY && data->state != from) {
+                g_warning ("Unexpected state changed %s -> %s, expected to be from %s",
+                           state_to_string (data->state), state_to_string (to),
+                           state_to_string (from));
+        }
 
         /* State never goes backwards */
         if (to < data->state) {
-                g_warn_if_reached ();
+                g_warning ("Unexpected state changed %s -> %s, expected %s -> %s\n",
+                           state_to_string (data->state), state_to_string (to),
+                           state_to_string (from), state_to_string (to));
                 return;
         }
 


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