mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-24 04:01:07 +03:00
Summary:
Codemod done with:
```
$ find . -type f -exec sed -i "s#folly/detail/SingletonStackTrace.h#folly/experimental/symbolizer/Symbolizer.h#g" {} +
$ find . -type f -exec sed -i "s#detail::getSingletonStackTrace#symbolizer::getStackTraceStr#g" {} +
$ find . -type f -exec sed -i "s#folly/detail:singleton_stack_trace#folly/experimental/symbolizer:symbolizer#g" {} +
$ find . -type f -exec sed -i "s#:detail_singleton_stack_trace#:experimental_symbolizer_symbolizer#g" {} +
```
Reviewed By: yfeldblum
Differential Revision: D33783971
fbshipit-source-id: 8af88803e69245ad4b5f4f9e729b57930064c3d3
61 lines
1.8 KiB
C++
61 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include <quic/client/QuicClientAsyncTransport.h>
|
|
|
|
#include <folly/Conv.h>
|
|
#include <folly/experimental/symbolizer/Symbolizer.h>
|
|
|
|
namespace quic {
|
|
|
|
QuicClientAsyncTransport::QuicClientAsyncTransport(
|
|
const std::shared_ptr<quic::QuicClientTransport>& clientSock) {
|
|
setSocket(clientSock);
|
|
clientSock->start(this);
|
|
}
|
|
|
|
void QuicClientAsyncTransport::onNewBidirectionalStream(
|
|
StreamId /*id*/) noexcept {
|
|
CHECK(false);
|
|
}
|
|
void QuicClientAsyncTransport::onNewUnidirectionalStream(
|
|
StreamId /*id*/) noexcept {
|
|
CHECK(false);
|
|
}
|
|
|
|
void QuicClientAsyncTransport::onStopSending(
|
|
StreamId /*id*/,
|
|
ApplicationErrorCode /*error*/) noexcept {}
|
|
|
|
void QuicClientAsyncTransport::onConnectionEnd() noexcept {
|
|
folly::AsyncSocketException ex(
|
|
folly::AsyncSocketException::UNKNOWN, "Quic connection ended");
|
|
// TODO: closeNow inside this callback may actually trigger gracefull close
|
|
closeNowImpl(std::move(ex));
|
|
}
|
|
|
|
void QuicClientAsyncTransport::onConnectionError(
|
|
std::pair<QuicErrorCode, std::string> code) noexcept {
|
|
folly::AsyncSocketException ex(
|
|
folly::AsyncSocketException::UNKNOWN,
|
|
folly::to<std::string>("Quic connection error", code.second));
|
|
// TODO: closeNow inside this callback may actually trigger gracefull close
|
|
closeNowImpl(std::move(ex));
|
|
}
|
|
|
|
void QuicClientAsyncTransport::onTransportReady() noexcept {
|
|
auto streamId = sock_->createBidirectionalStream();
|
|
if (!streamId) {
|
|
folly::AsyncSocketException ex(
|
|
folly::AsyncSocketException::UNKNOWN, "Quic failed to create stream");
|
|
closeNowImpl(std::move(ex));
|
|
}
|
|
setStreamId(streamId.value());
|
|
}
|
|
|
|
} // namespace quic
|