@@ -14,8 +14,6 @@ auto const kOutboxCapacity = 1023;
14
14
EventOutbox::EventOutbox (net::any_io_executor executor,
15
15
std::string callback_url)
16
16
: callback_url_{std::move (callback_url)},
17
- callback_port_{},
18
- callback_host_{},
19
17
callback_counter_{0 },
20
18
executor_{executor},
21
19
resolver_{executor},
@@ -29,7 +27,7 @@ EventOutbox::EventOutbox(net::any_io_executor executor,
29
27
callback_port_ = uri_components->port ();
30
28
}
31
29
32
- void EventOutbox::do_shutdown (beast::error_code ec, std::string what ) {
30
+ void EventOutbox::do_shutdown (beast::error_code ec) {
33
31
event_stream_.socket ().shutdown (tcp::socket::shutdown_both, ec);
34
32
flush_timer_.cancel ();
35
33
}
@@ -54,16 +52,14 @@ void EventOutbox::run() {
54
52
55
53
void EventOutbox::stop () {
56
54
beast::error_code ec = net::error::basic_errors::operation_aborted;
57
- std::string reason = " stop" ;
58
55
shutdown_ = true ;
59
- net::post (executor_,
60
- beast::bind_front_handler (&EventOutbox::do_shutdown,
61
- shared_from_this (), ec, reason));
56
+ net::post (executor_, beast::bind_front_handler (&EventOutbox::do_shutdown,
57
+ shared_from_this (), ec));
62
58
}
63
59
64
60
EventOutbox::RequestType EventOutbox::build_request (
65
61
std::size_t counter,
66
- std::variant<launchdarkly::sse::Event, launchdarkly::sse::Error> ev ) {
62
+ std::variant<launchdarkly::sse::Event, launchdarkly::sse::Error> event ) {
67
63
RequestType req;
68
64
69
65
req.set (http::field::host, callback_host_);
@@ -101,7 +97,7 @@ EventOutbox::RequestType EventOutbox::build_request(
101
97
json = msg;
102
98
}
103
99
},
104
- std::move (ev ));
100
+ std::move (event ));
105
101
106
102
req.body () = json.dump ();
107
103
req.prepare_payload ();
@@ -111,7 +107,7 @@ EventOutbox::RequestType EventOutbox::build_request(
111
107
void EventOutbox::on_resolve (beast::error_code ec,
112
108
tcp::resolver::results_type results) {
113
109
if (ec) {
114
- return do_shutdown (ec, " resolve " );
110
+ return do_shutdown (ec);
115
111
}
116
112
117
113
beast::get_lowest_layer (event_stream_)
@@ -123,7 +119,7 @@ void EventOutbox::on_resolve(beast::error_code ec,
123
119
void EventOutbox::on_connect (beast::error_code ec,
124
120
tcp::resolver::results_type::endpoint_type) {
125
121
if (ec) {
126
- return do_shutdown (ec, " connect " );
122
+ return do_shutdown (ec);
127
123
}
128
124
129
125
boost::system::error_code dummy;
@@ -133,7 +129,7 @@ void EventOutbox::on_connect(beast::error_code ec,
133
129
134
130
void EventOutbox::on_flush_timer (boost::system::error_code ec) {
135
131
if (ec && shutdown_) {
136
- return do_shutdown (ec, " flush " );
132
+ return do_shutdown (ec);
137
133
}
138
134
139
135
if (!outbox_.empty ()) {
@@ -156,7 +152,7 @@ void EventOutbox::on_flush_timer(boost::system::error_code ec) {
156
152
157
153
void EventOutbox::on_write (beast::error_code ec, std::size_t ) {
158
154
if (ec) {
159
- return do_shutdown (ec, " write " );
155
+ return do_shutdown (ec);
160
156
}
161
157
outbox_.pop ();
162
158
on_flush_timer (boost::system::error_code{});
0 commit comments