Skip to content

Commit

Permalink
bparser reworking
Browse files Browse the repository at this point in the history
- deque of sent_requests plus modified binary search to find RID's
- bparser callback only exposes message type
- ::respond method implemented in message type exposed in callback
- message type holds weak_ptr to bparser
  • Loading branch information
dr7ana committed Sep 22, 2023
1 parent 8e38f5f commit aa678fb
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 197 deletions.
12 changes: 6 additions & 6 deletions include/quic/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ namespace oxen::quic

public:
template <typename StreamT = Stream, typename... Args, std::enable_if_t<std::is_base_of_v<Stream, StreamT>, int> = 0>
std::shared_ptr<Stream> queue_stream(Args&&... args)
std::shared_ptr<StreamT> queue_stream(Args&&... args)
{
return queue_stream_impl([&](Connection& c, Endpoint& e) {
return std::static_pointer_cast<StreamT>(queue_stream_impl([&](Connection& c, Endpoint& e) {
return std::make_shared<StreamT>(c, e, std::forward<Args>(args)...);
});
}));
}

template <typename StreamT = Stream, typename... Args, std::enable_if_t<std::is_base_of_v<Stream, StreamT>, int> = 0>
std::shared_ptr<Stream> get_new_stream(Args&&... args)
std::shared_ptr<StreamT> get_new_stream(Args&&... args)
{
return get_new_stream_impl([&](Connection& c, Endpoint& e) {
return std::static_pointer_cast<StreamT>(get_new_stream_impl([&](Connection& c, Endpoint& e) {
return std::make_shared<StreamT>(c, e, std::forward<Args>(args)...);
});
}));
}

template <
Expand Down

0 comments on commit aa678fb

Please sign in to comment.