Coverage Report

Created: 2026-01-09 06:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/nghttp2/lib/nghttp2_helper.h
Line
Count
Source
1
/*
2
 * nghttp2 - HTTP/2 C Library
3
 *
4
 * Copyright (c) 2012 Tatsuhiro Tsujikawa
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining
7
 * a copy of this software and associated documentation files (the
8
 * "Software"), to deal in the Software without restriction, including
9
 * without limitation the rights to use, copy, modify, merge, publish,
10
 * distribute, sublicense, and/or sell copies of the Software, and to
11
 * permit persons to whom the Software is furnished to do so, subject to
12
 * the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be
15
 * included in all copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
 */
25
#ifndef NGHTTP2_HELPER_H
26
#define NGHTTP2_HELPER_H
27
28
#ifdef HAVE_CONFIG_H
29
#  include <config.h>
30
#endif /* defined(HAVE_CONFIG_H) */
31
32
#include <string.h>
33
#include <stddef.h>
34
35
#include <nghttp2/nghttp2.h>
36
#include "nghttp2_mem.h"
37
38
#define nghttp2_max_def(SUFFIX, T)                                             \
39
11.3k
  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_session.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_submit.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_helper.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_hd.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_http.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_pq.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_map.c:nghttp2_max_size
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_frame.c:nghttp2_max_size
nghttp2_buf.c:nghttp2_max_size
Line
Count
Source
39
11.3k
  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_buf.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_int8
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_int16
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_int32
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_int64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_uint8
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_uint16
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_uint32
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_uint64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_max_size
40
41
nghttp2_max_def(int8, int8_t)
42
nghttp2_max_def(int16, int16_t)
43
nghttp2_max_def(int32, int32_t)
44
nghttp2_max_def(int64, int64_t)
45
nghttp2_max_def(uint8, uint8_t)
46
nghttp2_max_def(uint16, uint16_t)
47
nghttp2_max_def(uint32, uint32_t)
48
nghttp2_max_def(uint64, uint64_t)
49
nghttp2_max_def(size, size_t)
50
51
#define nghttp2_min_def(SUFFIX, T)                                             \
52
136k
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_uint32
nghttp2_session.c:nghttp2_min_size
Line
Count
Source
52
92.8k
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
nghttp2_session.c:nghttp2_min_int32
Line
Count
Source
52
2.76k
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_session.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_submit.c:nghttp2_min_size
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_helper.c:nghttp2_min_size
nghttp2_hd.c:nghttp2_min_size
Line
Count
Source
52
39.5k
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_hd.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_http.c:nghttp2_min_size
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_rcbuf.c:nghttp2_min_size
nghttp2_ratelim.c:nghttp2_min_uint64
Line
Count
Source
52
574
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_ratelim.c:nghttp2_min_size
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_pq.c:nghttp2_min_size
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_map.c:nghttp2_min_size
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_frame.c:nghttp2_min_size
nghttp2_buf.c:nghttp2_min_size
Line
Count
Source
52
795
  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_buf.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_int8
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_int16
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_int32
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_int64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_uint8
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_uint16
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_uint32
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_uint64
Unexecuted instantiation: nghttp2_stream.c:nghttp2_min_size
53
54
nghttp2_min_def(int8, int8_t)
55
nghttp2_min_def(int16, int16_t)
56
nghttp2_min_def(int32, int32_t)
57
nghttp2_min_def(int64, int64_t)
58
nghttp2_min_def(uint8, uint8_t)
59
nghttp2_min_def(uint16, uint16_t)
60
nghttp2_min_def(uint32, uint32_t)
61
nghttp2_min_def(uint64, uint64_t)
62
nghttp2_min_def(size, size_t)
63
64
/*
65
 * nghttp2_strlen_lit returns the length of string literal |S|.  This
66
 * macro assumes |S| is NULL-terminated string literal.  It must not
67
 * be used with pointers.
68
 */
69
2.27k
#define nghttp2_strlen_lit(S) (sizeof(S) - 1)
70
71
#define lstreq(A, B, N)                                                        \
72
1.56k
  (nghttp2_strlen_lit((A)) == (N) && memcmp((A), (B), (N)) == 0)
73
74
#define nghttp2_struct_of(ptr, type, member)                                   \
75
0
  ((type *)(void *)((char *)(ptr) - offsetof(type, member)))
76
77
/*
78
 * Copies 2 byte unsigned integer |n| in host byte order to |buf| in
79
 * network byte order.
80
 */
81
void nghttp2_put_uint16be(uint8_t *buf, uint16_t n);
82
83
/*
84
 * Copies 4 byte unsigned integer |n| in host byte order to |buf| in
85
 * network byte order.
86
 */
87
void nghttp2_put_uint32be(uint8_t *buf, uint32_t n);
88
89
/*
90
 * Retrieves 2 byte unsigned integer stored in |data| in network byte
91
 * order and returns it in host byte order.
92
 */
93
uint16_t nghttp2_get_uint16(const uint8_t *data);
94
95
/*
96
 * Retrieves 4 byte unsigned integer stored in |data| in network byte
97
 * order and returns it in host byte order.
98
 */
99
uint32_t nghttp2_get_uint32(const uint8_t *data);
100
101
void nghttp2_downcase(uint8_t *s, size_t len);
102
103
/*
104
 * Adjusts |*local_window_size_ptr|, |*recv_window_size_ptr|,
105
 * |*recv_reduction_ptr| with |*delta_ptr| which is the
106
 * WINDOW_UPDATE's window_size_increment sent from local side. If
107
 * |delta| is strictly larger than |*recv_window_size_ptr|,
108
 * |*local_window_size_ptr| is increased by delta -
109
 * *recv_window_size_ptr. If |delta| is negative,
110
 * |*local_window_size_ptr| is decreased by delta.
111
 *
112
 * This function returns 0 if it succeeds, or one of the following
113
 * negative error codes:
114
 *
115
 * NGHTTP2_ERR_FLOW_CONTROL
116
 *     local_window_size overflow or gets negative.
117
 */
118
int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr,
119
                                     int32_t *recv_window_size_ptr,
120
                                     int32_t *recv_reduction_ptr,
121
                                     int32_t *delta_ptr);
122
123
/*
124
 * This function works like nghttp2_adjust_local_window_size().  The
125
 * difference is that this function assumes *delta_ptr >= 0, and
126
 * *recv_window_size_ptr is not decreased by *delta_ptr.
127
 *
128
 * This function returns 0 if it succeeds, or one of the following
129
 * negative error codes:
130
 *
131
 * NGHTTP2_ERR_FLOW_CONTROL
132
 *     local_window_size overflow or gets negative.
133
 */
134
int nghttp2_increase_local_window_size(int32_t *local_window_size_ptr,
135
                                       int32_t *recv_window_size_ptr,
136
                                       int32_t *recv_reduction_ptr,
137
                                       int32_t *delta_ptr);
138
139
/*
140
 * Returns non-zero if the function decided that WINDOW_UPDATE should
141
 * be sent.
142
 */
143
int nghttp2_should_send_window_update(int32_t local_window_size,
144
                                      int32_t recv_window_size);
145
146
/*
147
 * Copies the buffer |src| of length |len| to the destination pointed
148
 * by the |dest|, assuming that the |dest| is at lest |len| bytes long
149
 * . Returns dest + len.
150
 */
151
uint8_t *nghttp2_cpymem(uint8_t *dest, const void *src, size_t len);
152
153
#endif /* !defined(NGHTTP2_HELPER_H) */