| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec83431 commit fc94992
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -328,7 +328,7 @@ EXTRACFLAG = @EXTRACFLAG@ | |||
| 328 | 328 | EXTRA_DEFS = @EXTRA_DEFS@ | |
| 329 | 329 | FGREP = @FGREP@ | |
| 330 | 330 | GREP = @GREP@ | |
| 331 | - HAVE_CXX14 = @HAVE_CXX14@ | ||
| 331 | + HAVE_CXX20 = @HAVE_CXX20@ | ||
| 332 | 332 | INSTALL = @INSTALL@ | |
| 333 | 333 | INSTALL_DATA = @INSTALL_DATA@ | |
| 334 | 334 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -233,7 +233,7 @@ EXTRACFLAG = @EXTRACFLAG@ | |||
| 233 | 233 | EXTRA_DEFS = @EXTRA_DEFS@ | |
| 234 | 234 | FGREP = @FGREP@ | |
| 235 | 235 | GREP = @GREP@ | |
| 236 | - HAVE_CXX14 = @HAVE_CXX14@ | ||
| 236 | + HAVE_CXX20 = @HAVE_CXX20@ | ||
| 237 | 237 | INSTALL = @INSTALL@ | |
| 238 | 238 | INSTALL_DATA = @INSTALL_DATA@ | |
| 239 | 239 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,14 +29,14 @@ | |||
| 29 | 29 | * @macro | |
| 30 | 30 | * Version number of the nghttp2 library release | |
| 31 | 31 | */ | |
| 32 | - #define NGHTTP2_VERSION "1.61.0" | ||
| 32 | + #define NGHTTP2_VERSION "1.62.0" | ||
| 33 | 33 | ||
| 34 | 34 | /** | |
| 35 | 35 | * @macro | |
| 36 | 36 | * Numerical representation of the version number of the nghttp2 library | |
| 37 | 37 | * release. This is a 24 bit number with 8 bits for major number, 8 bits | |
| 38 | 38 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. | |
| 39 | 39 | */ | |
| 40 | - #define NGHTTP2_VERSION_NUM 0x013d00 | ||
| 40 | + #define NGHTTP2_VERSION_NUM 0x013e00 | ||
| 41 | 41 | ||
| 42 | 42 | #endif /* NGHTTP2VER_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap, nghttp2_mem *mem) { | |||
| 61 | 61 | return 0; | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | - new_cap = nghttp2_max(new_cap, cap * 2); | ||
| 64 | + new_cap = nghttp2_max_size(new_cap, cap * 2); | ||
| 65 | 65 | ||
| 66 | 66 | ptr = nghttp2_mem_realloc(mem, buf->begin, new_cap); | |
| 67 | 67 | if (ptr == NULL) { | |
@@ -343,7 +343,7 @@ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) { | |||
| 343 | 343 | while (len) { | |
| 344 | 344 | buf = &bufs->cur->buf; | |
| 345 | 345 | ||
| 346 | - nwrite = nghttp2_min(nghttp2_buf_avail(buf), len); | ||
| 346 | + nwrite = nghttp2_min_size(nghttp2_buf_avail(buf), len); | ||
| 347 | 347 | if (nwrite == 0) { | |
| 348 | 348 | rv = bufs_alloc_chain(bufs); | |
| 349 | 349 | if (rv != 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1245,13 +1245,13 @@ static void hd_context_shrink_table_size(nghttp2_hd_context *context, | |||
| 1245 | 1245 | ||
| 1246 | 1246 | int nghttp2_hd_deflate_change_table_size( | |
| 1247 | 1247 | nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) { | |
| 1248 | - size_t next_bufsize = nghttp2_min(settings_max_dynamic_table_size, | ||
| 1249 | - deflater->deflate_hd_table_bufsize_max); | ||
| 1248 | + size_t next_bufsize = nghttp2_min_size( | ||
| 1249 | + settings_max_dynamic_table_size, deflater->deflate_hd_table_bufsize_max); | ||
| 1250 | 1250 | ||
| 1251 | 1251 | deflater->ctx.hd_table_bufsize_max = next_bufsize; | |
| 1252 | 1252 | ||
| 1253 | 1253 | deflater->min_hd_table_bufsize_max = | |
| 1254 | - nghttp2_min(deflater->min_hd_table_bufsize_max, next_bufsize); | ||
| 1254 | + nghttp2_min_size(deflater->min_hd_table_bufsize_max, next_bufsize); | ||
| 1255 | 1255 | ||
| 1256 | 1256 | deflater->notify_table_size_change = 1; | |
| 1257 | 1257 | ||
@@ -1738,7 +1738,7 @@ static nghttp2_ssize hd_inflate_read_huff(nghttp2_hd_inflater *inflater, | |||
| 1738 | 1738 | static nghttp2_ssize hd_inflate_read(nghttp2_hd_inflater *inflater, | |
| 1739 | 1739 | nghttp2_buf *buf, const uint8_t *in, | |
| 1740 | 1740 | const uint8_t *last) { | |
| 1741 | - size_t len = nghttp2_min((size_t)(last - in), inflater->left); | ||
| 1741 | + size_t len = nghttp2_min_size((size_t)(last - in), inflater->left); | ||
| 1742 | 1742 | ||
| 1743 | 1743 | buf->last = nghttp2_cpymem(buf->last, in, len); | |
| 1744 | 1744 | ||
@@ -1962,8 +1962,8 @@ nghttp2_ssize nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater, | |||
| 1962 | 1962 | rfin = 0; | |
| 1963 | 1963 | rv = hd_inflate_read_len( | |
| 1964 | 1964 | inflater, &rfin, in, last, 5, | |
| 1965 | - nghttp2_min(inflater->min_hd_table_bufsize_max, | ||
| 1966 | - inflater->settings_hd_table_bufsize_max)); | ||
| 1965 | + nghttp2_min_size(inflater->min_hd_table_bufsize_max, | ||
| 1966 | + inflater->settings_hd_table_bufsize_max)); | ||
| 1967 | 1967 | if (rv < 0) { | |
| 1968 | 1968 | goto fail; | |
| 1969 | 1969 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,9 @@ nghttp2_ssize nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx, | |||
| 116 | 116 | uint8_t c; | |
| 117 | 117 | ||
| 118 | 118 | /* We use the decoding algorithm described in | |
| 119 | - http://graphics.ics.uci.edu/pub/Prefix.pdf */ | ||
| 119 | + - http://graphics.ics.uci.edu/pub/Prefix.pdf [!!! NO LONGER VALID !!!] | ||
| 120 | + - https://ics.uci.edu/~dan/pubs/Prefix.pdf | ||
| 121 | + - https://github.com/nghttp2/nghttp2/files/15141264/Prefix.pdf */ | ||
| 120 | 122 | for (; src != end;) { | |
| 121 | 123 | c = *src++; | |
| 122 | 124 | t = &huff_decode_table[t->fstate & 0x1ff][c >> 4]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,7 +160,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr, | |||
| 160 | 160 | int32_t recv_reduction_delta; | |
| 161 | 161 | int32_t delta; | |
| 162 | 162 | int32_t new_recv_window_size = | |
| 163 | - nghttp2_max(0, *recv_window_size_ptr) - *delta_ptr; | ||
| 163 | + nghttp2_max_int32(0, *recv_window_size_ptr) - *delta_ptr; | ||
| 164 | 164 | ||
| 165 | 165 | if (new_recv_window_size >= 0) { | |
| 166 | 166 | *recv_window_size_ptr = new_recv_window_size; | |
@@ -177,7 +177,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr, | |||
| 177 | 177 | *local_window_size_ptr += delta; | |
| 178 | 178 | /* If there is recv_reduction due to earlier window_size | |
| 179 | 179 | reduction, we have to adjust it too. */ | |
| 180 | - recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta); | ||
| 180 | + recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta); | ||
| 181 | 181 | *recv_reduction_ptr -= recv_reduction_delta; | |
| 182 | 182 | if (*recv_window_size_ptr < 0) { | |
| 183 | 183 | *recv_window_size_ptr += recv_reduction_delta; | |
@@ -233,7 +233,7 @@ int nghttp2_increase_local_window_size(int32_t *local_window_size_ptr, | |||
| 233 | 233 | *local_window_size_ptr += delta; | |
| 234 | 234 | /* If there is recv_reduction due to earlier window_size | |
| 235 | 235 | reduction, we have to adjust it too. */ | |
| 236 | - recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta); | ||
| 236 | + recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta); | ||
| 237 | 237 | *recv_reduction_ptr -= recv_reduction_delta; | |
| 238 | 238 | ||
| 239 | 239 | *recv_window_size_ptr += recv_reduction_delta; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,8 +35,31 @@ | |||
| 35 | 35 | #include <nghttp2/nghttp2.h> | |
| 36 | 36 | #include "nghttp2_mem.h" | |
| 37 | 37 | ||
| 38 | - #define nghttp2_min(A, B) ((A) < (B) ? (A) : (B)) | ||
| 39 | - #define nghttp2_max(A, B) ((A) > (B) ? (A) : (B)) | ||
| 38 | + #define nghttp2_max_def(SUFFIX, T) \ | ||
| 39 | + static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; } | ||
| 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 | + static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; } | ||
| 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); | ||
| 40 | 63 | ||
| 41 | 64 | #define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0) | |
| 42 | 65 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,7 @@ int nghttp2_pq_push(nghttp2_pq *pq, nghttp2_pq_entry *item) { | |||
| 69 | 69 | void *nq; | |
| 70 | 70 | size_t ncapacity; | |
| 71 | 71 | ||
| 72 | - ncapacity = nghttp2_max(4, (pq->capacity * 2)); | ||
| 72 | + ncapacity = nghttp2_max_size(4, (pq->capacity * 2)); | ||
| 73 | 73 | ||
| 74 | 74 | nq = nghttp2_mem_realloc(pq->mem, pq->q, | |
| 75 | 75 | ncapacity * sizeof(nghttp2_pq_entry *)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp) { | |||
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | rl->val += gain; | |
| 64 | - rl->val = nghttp2_min(rl->val, rl->burst); | ||
| 64 | + rl->val = nghttp2_min_uint64(rl->val, rl->burst); | ||
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | 67 | int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments