Commit graph

824 commits

Author SHA1 Message Date
Björn Svensson
5114d894e5 Remove fixed alignment 2021-10-18 11:36:54 +02:00
Yo-An Lin
b13dc8aa6e
Merge pull request #131 from iresty/feature-ipv6
feature: supported to use ipv6 address match route.
2021-10-14 10:31:23 +08:00
Yo-An Lin
eca8d9992e
Merge pull request #143 from Nordix/str_array-fixes
Corrections in `str_array`
2021-10-14 10:29:49 +08:00
Yo-An Lin
c9743f3904
Merge pull request #142 from Nordix/invalid-read-corrections
Correcting buffer over-read errors
2021-10-14 10:29:19 +08:00
Björn Svensson
383717a8c7 Update the faulty access macros for str_array
Adds a testcase for the usage of the access macros, and also
updates the testsuite to only include what str_array requires.
This shows that str_array can be used separately by users.
2021-10-13 08:47:20 +02:00
Björn Svensson
673bb2f6d9 Remove declarations for nonexisting functions in str_array.h 2021-10-13 08:47:20 +02:00
Björn Svensson
4babe735e8 Remove cyclic dependency between str_array.h and r3.h
This also makes sure we dont get warnings regarding bool
redefinitions when building with clang.
2021-10-13 08:46:47 +02:00
Björn Svensson
0072b618b6 Check for existence of stdbool.h during CMake builds
The headerfile is searched for during autogen/autoconf builds to
determine when to include stdbool.h.
This let CMake builds have the same behavior.
2021-10-12 10:52:44 +02:00
Björn Svensson
00ec8b7f2b Correct buffer over-read errors
When inserting multiple routes with common slug patterns
there are reads beyond end of strings.

The scenario is added as a testcase and can be triggered by
the address-sanitizer when built using:
`CFLAGS="-fno-omit-frame-pointer -fsanitize=address" cmake ..`

Indicated as a `buffer-overflow`
2021-10-11 10:19:09 +02:00
Yo-An Lin
d2fcf2f2d4
Merge pull request #135 from fishgege/patch-1
bugfix: insert path success, but get data failed
2021-10-07 22:08:13 +08:00
Yo-An Lin
da0c89b6db
Merge pull request #137 from dthadi3/ppc64le
Travis-ci: added support for ppc64le
2021-10-07 22:07:24 +08:00
Yo-An Lin
3228fb8cb5
Merge pull request #141 from Nordix/multi-edge-corrections
Correcting issue and memory leak when using multiple edges
2021-10-07 22:07:02 +08:00
Björn Svensson
ff1ef2c148 Correcting issue with multiple edges
When `r3_node_find_common_prefix()` searches for the common prefix it
selects the first matched edge, which might not be the best match.

This issue gives memoryleaks which can be viewed in legacy
testcase `check_tree::test_insert_pathl()` by building using:
`CFLAGS="-fno-omit-frame-pointer -fsanitize=leak" cmake ..`
See testcase procedures:
    ret = r3_tree_insert_path(n, "/foo/{id}",  NULL);
    ..
    ret = r3_tree_insert_path(n, "/foo/{idx}/{idy}",  NULL);
    ..
    ret = r3_tree_insert_path(n, "/foo/{idx}/{idh}",  NULL); <-- leaks

Also added a testcase that triggers the problem including a leak for
reproduction on baseline.
2021-09-20 16:55:37 +02:00
Devendranath Thadi
ac7af9697c Travis-ci: added support for ppc64le 2020-11-18 14:14:29 +00:00
董宇
36198aefba
bugfix: insert path success, but get data failed
background : use  r3_tree_insert_pathl_ex to add path,A : abcdefg   B:abc
When the node A already exists, we set B, then  will split the node and make a branch, suboath_len  is 0 
In this case,  branch a  zero len subpath, which tree's data not set
2019-12-15 13:05:49 +08:00
Yo-An Lin
e20e48a5ce
Merge pull request #128 from iresty/bug-end-maybe-0-len
bugfix: the end matching length is 0.
2019-08-06 10:22:30 +08:00
Yuansheng
79fd587615 feature: supported to match ipv6 address. 2019-08-01 21:38:14 -04:00
Yuansheng
1b9e007dfc bugfix: make a try for endpoint. 2019-07-21 08:46:37 -04:00
Yuansheng
81f77ffe5a test: added test cases. 2019-07-21 08:46:37 -04:00
Yuansheng
0d70b8f5de bugfix: the end matching length is 0. 2019-07-21 08:46:37 -04:00
Yo-An Lin
577cfa0ccb
Merge pull request #130 from iresty/typo
change: typo.
2019-07-21 19:30:50 +08:00
Yo-An Lin
3dac164cec
Merge pull request #126 from iresty/optimize-wildcard
optimize: optimized pattern `.*`, which can be used prefix matching.
2019-07-21 19:30:37 +08:00
Yuansheng
f8a3741211 change: typo. 2019-07-21 09:14:37 +08:00
Yuansheng
845c47907f test: describe the test case name. 2019-07-21 07:48:11 +08:00
Yuansheng
2ad6b4c4f0 test: skip one test case, will fix it later. 2019-07-20 22:58:17 +08:00
Yuansheng
3364df80ee test: run test case check_routes2. 2019-07-20 22:55:44 +08:00
Yuansheng
db91289ab6 change: rename OP_EXPECT_NOLINEBREAKS to OP_GREEDY_ANY. 2019-07-20 10:52:56 -04:00
Yuansheng
d516237aab optimize: optimized pattern .*, which can be used prefix matching. 2019-07-20 10:52:56 -04:00
Yo-An Lin
41685d402d
Merge pull request #129 from iresty/make-warning
change: avoided compiling warning.
2019-07-20 18:00:48 +08:00
Yo-An Lin
27d4d3191e
Merge pull request #125 from iresty/feature-scheme
feature: supported to match http scheme.
2019-07-20 17:59:48 +08:00
Yo-An Lin
fd34c7244a
Merge branch '2.0' into feature-scheme 2019-07-20 17:56:59 +08:00
Yo-An Lin
2b332bffba
Merge pull request #127 from iresty/check-more
test: run test case `check_remote_addr` in travis.
2019-07-20 17:55:17 +08:00
Yuansheng
91cfc9d282 test: run the test case check_http_scheme. 2019-07-20 07:21:05 +08:00
Yuansheng
fdc698f924 change: avoided compiling warning message. 2019-07-20 07:12:37 +08:00
Yuansheng
0485554d44 change(tests/check_slug): avoided compiling warning. 2019-07-20 07:06:56 +08:00
Yuansheng
4b066dd0fc test: run all of the test cases. 2019-07-19 09:15:47 -04:00
Yuansheng
43666a1183 feature: supported to match http scheme. 2019-06-26 23:06:32 +08:00
Yo-An Lin
3f410ef5d4
Merge pull request #124 from iresty/make-WARN
make: avoided the warning message when do make at Ubuntu OS.
2019-06-21 12:55:15 +08:00
Yuansheng
8e18a995d8 make: avoided the warning message when do make.
change: code style, delete some useless spaces(visual code).

eg:

warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
2019-06-21 10:45:54 +08:00
Yo-An Lin
410f66bc1a
Merge pull request #123 from iresty/feature-remote-ip
feature: supported to match remote ip address.
2019-06-20 11:47:46 +08:00
Yuansheng
848b8efdca feature: supported to match remote ip address. 2019-06-19 23:36:37 -04:00
Yo-An Lin
2a08bc62d5
Merge pull request #122 from iresty/feature-wildcard-host
feature: supported wildcard match way for host.
2019-06-20 11:29:52 +08:00
Yuansheng
917fa6e385 change: removed useless comments. 2019-06-20 11:21:04 +08:00
Yuansheng
4ab222a308 feature: supported wildcard match way for host. 2019-06-19 10:07:14 -04:00
Yo-An Lin
9761bdeec3
Merge pull request #119 from GuacheSuede/patch-1
Quick Includes Bug fix
2019-01-23 23:02:41 +08:00
Sakamoto
69e31ce07a
Quick Includes Bug fix 2019-01-23 01:02:04 +08:00
Yo-An Lin
22a6b99b34
Merge pull request #115 from msteinert/remove-zmalloc
Remove zmalloc
2018-07-10 07:36:49 -07:00
Michael Steinert
8abc03ea56 cmake: Add some comments regarding r3.pc.in 2018-07-10 08:24:05 -05:00
Michael Steinert
b3dbf75da5 Remove zmalloc dependency
Zmalloc comes from Redis. It's purpose is to track total allocations so
that a maximum can be set. For more information see the following links:

https://groups.google.com/forum/#!topic/redis-db/dPRdpowqJsY
https://stackoverflow.com/questions/22729730/when-would-one-use-malloc-over-zmalloc

This allocator is slower, not needed, and conflicts with Zlib (when
linking statically). This patch removes Zmalloc in favor of the system
allocator. Application developers can still choose to override the
allocator in their applications, e.g. Jemalloc, TCMalloc, etc.

Fixes #104
2018-07-10 08:20:46 -05:00
Yo-An Lin
afd2c486c6
Merge pull request #113 from msteinert/cleanup-cmake
Cleanup cmake
2018-07-10 06:11:41 -07:00