Fix clang-8 warning

This commit is contained in:
Tatsuhiro Tsujikawa 2019-06-22 17:35:13 +09:00
parent ee44313445
commit 7a5908933e
2 changed files with 4 additions and 4 deletions

View File

@ -5404,8 +5404,8 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
case NGHTTP2_IB_READ_CLIENT_MAGIC: case NGHTTP2_IB_READ_CLIENT_MAGIC:
readlen = nghttp2_min(inlen, iframe->payloadleft); readlen = nghttp2_min(inlen, iframe->payloadleft);
if (memcmp(NGHTTP2_CLIENT_MAGIC + NGHTTP2_CLIENT_MAGIC_LEN - if (memcmp(&NGHTTP2_CLIENT_MAGIC[NGHTTP2_CLIENT_MAGIC_LEN -
iframe->payloadleft, iframe->payloadleft],
in, readlen) != 0) { in, readlen) != 0) {
return NGHTTP2_ERR_BAD_CLIENT_MAGIC; return NGHTTP2_ERR_BAD_CLIENT_MAGIC;
} }

View File

@ -305,7 +305,7 @@ int ClientHandler::upstream_write() {
int ClientHandler::upstream_http2_connhd_read() { int ClientHandler::upstream_http2_connhd_read() {
auto nread = std::min(left_connhd_len_, rb_.rleft()); auto nread = std::min(left_connhd_len_, rb_.rleft());
if (memcmp(NGHTTP2_CLIENT_MAGIC + NGHTTP2_CLIENT_MAGIC_LEN - left_connhd_len_, if (memcmp(&NGHTTP2_CLIENT_MAGIC[NGHTTP2_CLIENT_MAGIC_LEN - left_connhd_len_],
rb_.pos(), nread) != 0) { rb_.pos(), nread) != 0) {
// There is no downgrade path here. Just drop the connection. // There is no downgrade path here. Just drop the connection.
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
@ -334,7 +334,7 @@ int ClientHandler::upstream_http2_connhd_read() {
int ClientHandler::upstream_http1_connhd_read() { int ClientHandler::upstream_http1_connhd_read() {
auto nread = std::min(left_connhd_len_, rb_.rleft()); auto nread = std::min(left_connhd_len_, rb_.rleft());
if (memcmp(NGHTTP2_CLIENT_MAGIC + NGHTTP2_CLIENT_MAGIC_LEN - left_connhd_len_, if (memcmp(&NGHTTP2_CLIENT_MAGIC[NGHTTP2_CLIENT_MAGIC_LEN - left_connhd_len_],
rb_.pos(), nread) != 0) { rb_.pos(), nread) != 0) {
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
CLOG(INFO, this) << "This is HTTP/1.1 connection, " CLOG(INFO, this) << "This is HTTP/1.1 connection, "