]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-h2: remove misleading leftover test on h2s' nullity
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Jan 2019 14:42:44 +0000 (15:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Jan 2019 14:45:02 +0000 (15:45 +0100)
The WINDOW_UPDATE and DATA frame handlers used to still have a check on
h2s to return either h2s_error() or h2c_error(). This is a leftover from
the early code. The h2s cannot be null there anymore as it has already
been dereferenced before reaching these locations.

src/mux_h2.c

index 8f8c37b4db71de4d89589ee9f057406261c267c7..4019ec1f7ad6fcdb081736093cd05125b94b7797 100644 (file)
@@ -1771,12 +1771,8 @@ static int h2c_handle_window_update(struct h2c *h2c, struct h2s *h2s)
        return 0;
 
  strm_err:
-       if (h2s) {
-               h2s_error(h2s, error);
-               h2c->st0 = H2_CS_FRAME_E;
-       }
-       else
-               h2c_error(h2c, error);
+       h2s_error(h2s, error);
+       h2c->st0 = H2_CS_FRAME_E;
        return 0;
 }
 
@@ -2143,12 +2139,8 @@ static int h2c_frt_handle_data(struct h2c *h2c, struct h2s *h2s)
        return 0;
 
  strm_err:
-       if (h2s) {
-               h2s_error(h2s, error);
-               h2c->st0 = H2_CS_FRAME_E;
-       }
-       else
-               h2c_error(h2c, error);
+       h2s_error(h2s, error);
+       h2c->st0 = H2_CS_FRAME_E;
        return 0;
 }