Skip to content

Commit 8f4e980

Browse files
committed
Merge branch 'develop' into feature/type-erased-response
2 parents 3adac15 + 26197e8 commit 8f4e980

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+322
-311
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ if (BOOST_REDIS_MAIN_PROJECT)
3838
align
3939
context
4040
core
41-
coroutine
4241
static_assert
4342
pool
4443
date_time

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,33 +676,51 @@ https://lists.boost.org/Archives/boost/2023/01/253944.php.
676676

677677
## Changelog
678678

679+
### Boost 1.87
680+
681+
* (Issue [205](https://github.com/boostorg/redis/issues/205))
682+
Improves reaction time to disconnection by using `wait_for_one_error`
683+
instead of `wait_for_all`. The function `connection::async_run` was
684+
also changed to return EOF to the user when that error is received
685+
from the server. That is a breaking change.
686+
687+
* (Issue [210](https://github.com/boostorg/redis/issues/210))
688+
Fixes the adapter of empty nested reposponses.
689+
690+
* (Issues [211](https://github.com/boostorg/redis/issues/211) and [212](https://github.com/boostorg/redis/issues/212))
691+
Fixes the reconnect loop that would hang under certain conditions,
692+
see the linked issues for more details.
693+
694+
* (Issue [219](https://github.com/boostorg/redis/issues/219))
695+
Changes the default log level from `disabled` to `debug`.
696+
679697
### Boost 1.85
680698

681-
* ([Issue 170](https://github.com/boostorg/redis/issues/170))
699+
* (Issue [170](https://github.com/boostorg/redis/issues/170))
682700
Under load and on low-latency networks it is possible to start
683701
receiving responses before the write operation completed and while
684702
the request is still marked as staged and not written. This messes
685703
up with the heuristics that classifies responses as unsolicied or
686704
not.
687705

688-
* ([Issue 168](https://github.com/boostorg/redis/issues/168)).
706+
* (Issue [168](https://github.com/boostorg/redis/issues/168)).
689707
Provides a way of passing a custom SSL context to the connection.
690708
The design here differs from that of Boost.Beast and Boost.MySql
691709
since in Boost.Redis the connection owns the context instead of only
692710
storing a reference to a user provided one. This is ok so because
693711
apps need only one connection for their entire application, which
694712
makes the overhead of one ssl-context per connection negligible.
695713

696-
* ([Issue 181](https://github.com/boostorg/redis/issues/181)).
714+
* (Issue [181](https://github.com/boostorg/redis/issues/181)).
697715
See a detailed description of this bug in
698716
[this](https://github.com/boostorg/redis/issues/181#issuecomment-1913346983)
699717
comment.
700718

701-
* ([Issue 182](https://github.com/boostorg/redis/issues/182)).
719+
* (Issue [182](https://github.com/boostorg/redis/issues/182)).
702720
Sets `"default"` as the default value of `config::username`. This
703721
makes it simpler to use the `requirepass` configuration in Redis.
704722

705-
* ([Issue 189](https://github.com/boostorg/redis/issues/189)).
723+
* (Issue [189](https://github.com/boostorg/redis/issues/189)).
706724
Fixes narrowing convertion by using `std::size_t` instead of
707725
`std::uint64_t` for the sizes of bulks and aggregates. The code
708726
relies now on `std::from_chars` returning an error if a value

build.jam

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright René Ferdinand Rivera Morell 2024
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
require-b2 5.2 ;
7+
8+
constant boost_dependencies :
9+
/boost/asio//boost_asio
10+
/boost/assert//boost_assert
11+
/boost/core//boost_core
12+
/boost/mp11//boost_mp11
13+
/boost/system//boost_system
14+
/boost/throw_exception//boost_throw_exception ;
15+
16+
project /boost/redis
17+
: common-requirements
18+
<include>include
19+
;
20+
21+
explicit
22+
[ alias boost_redis : : : : <library>$(boost_dependencies) ]
23+
[ alias all : boost_redis test ]
24+
;
25+
26+
call-if : boost-library redis
27+
;
28+

example/sync_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
2+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
33
*
44
* Distributed under the Boost Software License, Version 1.0. (See
55
* accompanying file LICENSE.txt)

include/boost/redis.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
1+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
22
*
33
* Distributed under the Boost Software License, Version 1.0. (See
44
* accompanying file LICENSE.txt)

include/boost/redis/adapter/adapt.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
1+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
22
*
33
* Distributed under the Boost Software License, Version 1.0. (See
44
* accompanying file LICENSE.txt)

include/boost/redis/adapter/detail/adapters.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
1+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
22
*
33
* Distributed under the Boost Software License, Version 1.0. (See
44
* accompanying file LICENSE.txt)

include/boost/redis/adapter/detail/response_traits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
1+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
22
*
33
* Distributed under the Boost Software License, Version 1.0. (See
44
* accompanying file LICENSE.txt)

include/boost/redis/adapter/detail/result_traits.hpp

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva ([email protected])
1+
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva ([email protected])
22
*
33
* Distributed under the Boost Software License, Version 1.0. (See
44
* accompanying file LICENSE.txt)
@@ -102,8 +102,12 @@ class static_aggregate_adapter<result<Tuple>> {
102102
std::variant>,
103103
std::tuple_size<Tuple>::value>;
104104

105+
// Tuple element we are currently on.
105106
std::size_t i_ = 0;
107+
108+
// Nested aggregate element counter.
106109
std::size_t aggregate_size_ = 0;
110+
107111
adapters_array_type adapters_;
108112
result<Tuple>* res_ = nullptr;
109113

@@ -117,36 +121,35 @@ class static_aggregate_adapter<result<Tuple>> {
117121
}
118122

119123
template <class String>
120-
void count(resp3::basic_node<String> const& nd)
124+
void count(resp3::basic_node<String> const& elem)
121125
{
122-
if (nd.depth == 1) {
123-
if (is_aggregate(nd.data_type))
124-
aggregate_size_ = element_multiplicity(nd.data_type) * nd.aggregate_size;
125-
else
126-
++i_;
127-
128-
return;
126+
if (elem.depth == 1 && is_aggregate(elem.data_type)) {
127+
aggregate_size_ = element_multiplicity(elem.data_type) * elem.aggregate_size;
129128
}
130129

131-
if (--aggregate_size_ == 0)
132-
++i_;
130+
if (aggregate_size_ == 0) {
131+
i_ += 1;
132+
} else {
133+
aggregate_size_ -= 1;
134+
}
133135
}
134136

135137
template <class String>
136-
void operator()(resp3::basic_node<String> const& nd, system::error_code& ec)
138+
void operator()(resp3::basic_node<String> const& elem, system::error_code& ec)
137139
{
138140
using std::visit;
139141

140-
if (nd.depth == 0) {
141-
auto const real_aggr_size = nd.aggregate_size * element_multiplicity(nd.data_type);
142+
if (elem.depth == 0) {
143+
auto const multiplicity = element_multiplicity(elem.data_type);
144+
auto const real_aggr_size = elem.aggregate_size * multiplicity;
142145
if (real_aggr_size != std::tuple_size<Tuple>::value)
143146
ec = redis::error::incompatible_size;
144147

145148
return;
146149
}
147150

148-
visit([&](auto& arg){arg(nd, ec);}, adapters_[i_]);
149-
count(nd);
151+
visit([&](auto& arg){arg(elem, ec);}, adapters_[i_]);
152+
count(elem);
150153
}
151154
};
152155

0 commit comments

Comments
 (0)