You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by lg...@apache.org on 2016/06/12 16:14:00 UTC
svn commit: r1748025 - /serf/trunk/protocols/http2_protocol.c
Author: lgo
Date: Sun Jun 12 16:14:00 2016
New Revision: 1748025
URL: http://svn.apache.org/viewvc?rev=1748025&view=rev
Log:
Fix compiler warnings.
* protocols/http2_protocol.c
(http2_handle_stream_window_update, http2_handle_connection_window_update):
A 32-bit unsigned integer shouldn't be compared < 0). The existing test
' > 0x7FFFFFFF is sufficient. In fact, since current code is reading
4 bytes and then sets the top bit to 0, the situation tested for can never
happen.
Modified:
serf/trunk/protocols/http2_protocol.c
Modified: serf/trunk/protocols/http2_protocol.c
URL: http://svn.apache.org/viewvc/serf/trunk/protocols/http2_protocol.c?rev=1748025&r1=1748024&r2=1748025&view=diff
==============================================================================
--- serf/trunk/protocols/http2_protocol.c (original)
+++ serf/trunk/protocols/http2_protocol.c Sun Jun 12 16:14:00 2016
@@ -1,4 +1,4 @@
-/* ====================================================================
+ /* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -634,7 +634,7 @@ http2_handle_stream_window_update(void *
stream->lr_window += value;
- if (stream->lr_window > HTTP2_WINDOW_MAX_ALLOWED || stream->lr_window < 0)
+ if (stream->lr_window > HTTP2_WINDOW_MAX_ALLOWED )
{
/* A sender MUST NOT allow a flow-control window to exceed 2^31-1
octets. If a sender receives a WINDOW_UPDATE that causes a flow-
@@ -693,7 +693,7 @@ http2_handle_connection_window_update(vo
was0 = (h2->lr_window == 0);
h2->lr_window += value;
- if (h2->lr_window > HTTP2_WINDOW_MAX_ALLOWED || h2->lr_window < 0)
+ if (h2->lr_window > HTTP2_WINDOW_MAX_ALLOWED)
{
/* A sender MUST NOT allow a flow-control window to exceed 2^31-1
octets. If a sender receives a WINDOW_UPDATE that causes a flow-