Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions iocore/net/P_QUICNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
limitations under the License.
*/

#ifndef __P_QUICNET_H__
#define __P_QUICNET_H__
#pragma once

#include <bitset>

Expand Down Expand Up @@ -77,4 +76,3 @@ get_QUICPollCont(EThread *t)
}

extern ClassAllocator<QUICPollEvent> quicPollEventAllocator;
#endif
6 changes: 3 additions & 3 deletions iocore/net/P_QUICPacketHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class QUICPacketHandler
QUICConnection *_check_stateless_reset(const uint8_t *buf, size_t buf_len);

// FIXME Remove this
// QUICPacketHandler could be a continuation, but NetAccept is a contination too.
// QUICPacketHandler could be a continuation, but NetAccept is a continuation too.
virtual Continuation *_get_continuation() = 0;

Event *_collector_event = nullptr;
Expand All @@ -65,7 +65,7 @@ class QUICPacketHandler
};

/*
* @class QUICPacketHanderIn
* @class QUICPacketHandlerIn
* @brief QUIC Packet Handler for incoming connections
*/
class QUICPacketHandlerIn : public NetAccept, public QUICPacketHandler
Expand Down Expand Up @@ -97,7 +97,7 @@ class QUICPacketHandlerIn : public NetAccept, public QUICPacketHandler
};

/*
* @class QUICPacketHanderOut
* @class QUICPacketHandlerOut
* @brief QUIC Packet Handler for outgoing connections
*/
class QUICPacketHandlerOut : public Continuation, public QUICPacketHandler
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/QUICNetProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QUICNetProcessor::QUICNetProcessor() {}

QUICNetProcessor::~QUICNetProcessor()
{
// TODO: clear all values before destory the table.
// TODO: clear all values before destroy the table.
delete this->_ctable;
}

Expand Down
14 changes: 7 additions & 7 deletions iocore/net/QUICNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void
QUICNetVConnection::destroy(EThread *t)
{
QUICConDebug("Destroy connection");
/* TODO: Uncmment these blocks after refactoring read / write process
/* TODO: Uncomment these blocks after refactoring read / write process
if (from_accept_thread) {
quicNetVCAllocator.free(this);
} else {
Expand Down Expand Up @@ -806,7 +806,7 @@ QUICNetVConnection::state_handshake(int event, Event *data)
// Don't make this error, and discard the packet.
// Because:
// - Attacker can terminate connections
// - It could be just an errora on lower layer
// - It could be just an error on lower layer
error = nullptr;
} else if (result == QUICPacketCreationResult::SUCCESS || result == QUICPacketCreationResult::UNSUPPORTED) {
error = this->_state_handshake_process_packet(*packet);
Expand Down Expand Up @@ -1291,7 +1291,7 @@ QUICNetVConnection::_state_connection_established_process_protected_packet(const
}
}

// For Connection Migration excercise
// For Connection Migration exercise
if (this->netvc_context == NET_VCONNECTION_OUT && this->_quic_config->cm_exercise_enabled()) {
this->_state_connection_established_initiate_connection_migration();
}
Expand All @@ -1314,7 +1314,7 @@ QUICNetVConnection::_state_connection_established_receive_packet()
// Don't make this error, and discard the packet.
// Because:
// - Attacker can terminate connections
// - It could be just an errora on lower layer
// - It could be just an error on lower layer
continue;
} else if (result == QUICPacketCreationResult::NO_PACKET) {
return error;
Expand Down Expand Up @@ -1400,7 +1400,7 @@ QUICNetVConnection::_state_draining_receive_packet()
* 1. Check congestion window
* 2. Allocate buffer for UDP Payload
* 3. Generate QUIC Packet
* 4. Store data to the paylaod
* 4. Store data to the payload
* 5. Send UDP Packet
*/
QUICConnectionErrorUPtr
Expand Down Expand Up @@ -1758,7 +1758,7 @@ QUICNetVConnection::_build_packet(uint8_t *packet_buf, QUICEncryptionLevel level
size_t token_len = 0;

if (this->netvc_context == NET_VCONNECTION_OUT) {
// TODO: Add a case of using token which is advertized by NEW_TOKEN frame
// TODO: Add a case of using token which is advertised by NEW_TOKEN frame
if (this->_av_token) {
token = ats_unique_malloc(this->_av_token_len);
token_len = this->_av_token_len;
Expand Down Expand Up @@ -2301,7 +2301,7 @@ QUICNetVConnection::_state_connection_established_migrate_connection(const QUICP
}

/**
* Connection Migration Excercise from client
* Connection Migration Exercise from client
*/
QUICConnectionErrorUPtr
QUICNetVConnection::_state_connection_established_initiate_connection_migration()
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICAckFrameCreator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ QUICAckFrameManager::QUICAckFrameCreator::push_back(QUICPacketNumber packet_numb
this->_latest_packet_received_time = Thread::get_hrtime();
}

// unorder packet should send ack immediately to accellerate the recovery
// unorder packet should send ack immediately to accelerate the recovery
if (this->_expect_next != packet_number) {
this->_should_send = true;
}
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICAckFrameCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class QUICAckFrameManager : public QUICFrameGenerator
bool _available = false; // packet_number has data to sent
bool _should_send = false; // ack frame should be sent immediately
bool _has_new_data = false; // new data after last sent
uint32_t _ack_eliciting_count = 0; // every two ack-eliciting packet should send ack immediatly
uint32_t _ack_eliciting_count = 0; // every two ack-eliciting packet should send ack immediately
uint16_t _max_ack_delay = 25;
QUICPacketNumber _largest_ack_number = 0;
QUICPacketNumber _expect_next = 0;
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICAltConnectionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ QUICAltConnectionManager::drop_cid(const QUICConnectionId &cid)
{
for (auto it = this->_alt_quic_connection_ids_remote.begin(); it != this->_alt_quic_connection_ids_remote.end(); ++it) {
if (it->id == cid) {
QUICACMVDebug("Dropping advertized CID %" PRIx32 " seq# %" PRIu64, it->id.h32(), it->seq_num);
QUICACMVDebug("Dropping advertised CID %" PRIx32 " seq# %" PRIu64, it->id.h32(), it->seq_num);
this->_retired_seq_nums.push(it->seq_num);
this->_rtable.erase(it->token);
this->_alt_quic_connection_ids_remote.erase(it);
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICAltConnectionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class QUICAltConnectionManager : public QUICFrameHandler, public QUICFrameGenera
/**
* Migrate to new CID
*
* cid need to match with one of alt CID that AltConnnectionManager prepared.
* cid need to match with one of alt CID that AltConnectionManager prepared.
*/
bool migrate_to(const QUICConnectionId &cid, QUICStatelessResetToken &new_reset_token);

Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICBidirectionalStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ QUICBidirectionalStream::is_cancelled() const
/**
* @brief Receive STREAM frame
* @detail When receive STREAM frame, reorder frames and write to buffer of read_vio.
* If the reordering or writting operation is heavy, split out them to read function,
* If the reordering or writing operation is heavy, split out them to read function,
* which is called by application via do_io_read() or reenable().
*/
QUICConnectionErrorUPtr
Expand Down
4 changes: 2 additions & 2 deletions iocore/net/quic/QUICConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ quic_new_ssl_ctx()
SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_3_VERSION);

#ifndef OPENSSL_IS_BORINGSSL
// FIXME: OpenSSL (1.1.1-alpha) enable this option by default. But this shoule be removed when OpenSSL disable this by default.
// FIXME: OpenSSL (1.1.1-alpha) enable this option by default. But this should be removed when OpenSSL disable this by default.
SSL_CTX_clear_options(ssl_ctx, SSL_OP_ENABLE_MIDDLEBOX_COMPAT);

SSL_CTX_set_max_early_data(ssl_ctx, UINT32_C(0xFFFFFFFF));

#else
// QUIC Transport Parameters are accesible with SSL_set_quic_transport_params and SSL_get_peer_quic_transport_params
// QUIC Transport Parameters are accessible with SSL_set_quic_transport_params and SSL_get_peer_quic_transport_params
#endif

#ifdef SSL_MODE_QUIC_HACK
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICCongestionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class QUICCongestionController
RECOVERY,
CONGESTION_AVOIDANCE,
SLOW_START,
APPPLICATION_LIMITED,
APPLICATION_LIMITED,
};

virtual ~QUICCongestionController() {}
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ class QUICConnection : public QUICFrameHandler, public QUICConnectionInfoProvide
virtual QUICStreamManager *stream_manager() = 0;
virtual void close_quic_connection(QUICConnectionErrorUPtr error) = 0;
virtual void reset_quic_connection() = 0;
virtual void handle_received_packet(UDPPacket *packeet) = 0;
virtual void handle_received_packet(UDPPacket *packet) = 0;
virtual void ping() = 0;
};
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class QUICContext
virtual QUICRTTProvider *rtt_provider() const;
virtual QUICPathManager *path_manager() const;

// regist a callback which will be called when specifed event happen.
// regist a callback which will be called when specified event happen.
void
regist_callback(std::shared_ptr<QUICCallback> cbs)
{
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICFlowController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ QUICFlowController::update(QUICOffset offset)
void
QUICFlowController::forward_limit(QUICOffset limit)
{
// MAX_(STREAM_)DATA might be unorderd due to delay
// MAX_(STREAM_)DATA might be unordered due to delay
// Just ignore if the size was smaller than the last one
if (this->_limit > limit) {
return;
Expand Down
6 changes: 3 additions & 3 deletions iocore/net/quic/QUICFrame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define LEFT_SPACE(pos) ((size_t)(buf + len - pos))
#define FRAME_SIZE(pos) (pos - buf)

// the pos will auto move forward . return true if the data vaild
// the pos will auto move forward . return true if the data valid
static bool
read_varint(uint8_t *&pos, size_t len, uint64_t &field, size_t &field_len)
{
Expand Down Expand Up @@ -3072,10 +3072,10 @@ QUICFrameFactory::create_stop_sending_frame(uint8_t *buf, QUICStreamId stream_id

QUICNewConnectionIdFrame *
QUICFrameFactory::create_new_connection_id_frame(uint8_t *buf, uint64_t sequence, uint64_t retire_prior_to,
QUICConnectionId connectoin_id, QUICStatelessResetToken stateless_reset_token,
QUICConnectionId connection_id, QUICStatelessResetToken stateless_reset_token,
QUICFrameId id, QUICFrameGenerator *owner)
{
new (buf) QUICNewConnectionIdFrame(sequence, retire_prior_to, connectoin_id, stateless_reset_token, id, owner);
new (buf) QUICNewConnectionIdFrame(sequence, retire_prior_to, connection_id, stateless_reset_token, id, owner);
return reinterpret_cast<QUICNewConnectionIdFrame *>(buf);
}

Expand Down
4 changes: 2 additions & 2 deletions iocore/net/quic/QUICFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class QUICAckFrame : public QUICFrame
QUICFrameGenerator *owner = nullptr);
std::set<PacketNumberRange> ranges() const;

// There's no reasont restrict copy, but we need to write the copy constructor. Otherwise it will crash on destruct.
// There's no reason to restrict copy, but we need to write the copy constructor. Otherwise it will crash on destruct.
QUICAckFrame(const QUICAckFrame &) = delete;

virtual ~QUICAckFrame();
Expand Down Expand Up @@ -876,7 +876,7 @@ class QUICFrameFactory
* Creates a NEW_CONNECTION_ID frame.
*/
static QUICNewConnectionIdFrame *create_new_connection_id_frame(uint8_t *buf, uint64_t sequence, uint64_t retire_prior_to,
QUICConnectionId connectoin_id,
QUICConnectionId connection_id,
QUICStatelessResetToken stateless_reset_token, QUICFrameId id = 0,
QUICFrameGenerator *owner = nullptr);

Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICGlobals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ QUIC::_register_stats()
{
quic_rsb = RecAllocateRawStatBlock(static_cast<int>(QUICStats::count));

// Transfered packet counts
// Transferred packet counts
RecRegisterRawStat(quic_rsb, RECT_PROCESS, "proxy.process.quic.total_packets_sent", RECD_INT, RECP_PERSISTENT,
static_cast<int>(QUICStats::total_packets_sent_stat), RecRawStatSyncSum);
// RecRegisterRawStat(quic_rsb, RECT_PROCESS, "proxy.process.quic.total_packets_retransmitted", RECD_INT, RECP_PERSISTENT,
Expand Down
8 changes: 4 additions & 4 deletions iocore/net/quic/QUICHandshake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ QUICHandshake::~QUICHandshake()
QUICConnectionErrorUPtr
QUICHandshake::start(const QUICTPConfig &tp_config, QUICPacketFactory *packet_factory, bool vn_exercise_enabled)
{
QUICVersion initital_version = QUIC_SUPPORTED_VERSIONS[0];
QUICVersion initial_version = QUIC_SUPPORTED_VERSIONS[0];
if (vn_exercise_enabled) {
initital_version = QUIC_EXERCISE_VERSION;
initial_version = QUIC_EXERCISE_VERSION;
}

this->_load_local_client_transport_parameters(tp_config);
packet_factory->set_version(initital_version);
packet_factory->set_version(initial_version);

return nullptr;
}
Expand All @@ -132,7 +132,7 @@ QUICHandshake::start(const QUICTPConfig &tp_config, const QUICInitialPacketR &in
this->_load_local_server_transport_parameters(tp_config, pref_addr);
packet_factory->set_version(this->_version_negotiator->negotiated_version());
} else {
ink_assert(!"Unsupported version initial packet should be droped QUICPakcetHandler");
ink_assert(!"Unsupported version initial packet should be dropped QUICPacketHandler");
}
} else {
return std::make_unique<QUICConnectionError>(QUICTransErrorCode::PROTOCOL_VIOLATION);
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICHandshakeProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct QUICHandshakeMsgs {
uint8_t *buf = nullptr; //< pointer to the buffer
size_t max_buf_len = 0; //< size of buffer
size_t offsets[5] = {0}; //< offset to the each encryption level - {initial, zero_rtt, handshake, one_rtt, total length}
uint16_t error_code = 0; //< CRYPTO_ERROR - TLS Alert Desciption + 0x100
uint16_t error_code = 0; //< CRYPTO_ERROR - TLS Alert Description + 0x100
};

class QUICHandshakeProtocol
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICKeyGenerator_boringssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ QUICKeyGenerator::_get_cipher_for_protected_packet(const SSL *ssl) const
}
}

// SSL_HANDSHAKE_MAC_SHA256, SSL_HANDSHAKE_MAC_SHA384 are defind in `ssl/internal.h` of BoringSSL
// SSL_HANDSHAKE_MAC_SHA256, SSL_HANDSHAKE_MAC_SHA384 are defined in `ssl/internal.h` of BoringSSL
/*
const EVP_MD *
QUICKeyGenerator::get_handshake_digest(const SSL *ssl)
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICKeyGenerator_openssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ QUICKeyGenerator::_get_cipher_for_protected_packet(const SSL *ssl) const
}
}

// SSL_HANDSHAKE_MAC_SHA256, SSL_HANDSHAKE_MAC_SHA384 are defind in `ssl/internal.h` of BoringSSL
// SSL_HANDSHAKE_MAC_SHA256, SSL_HANDSHAKE_MAC_SHA384 are defined in `ssl/internal.h` of BoringSSL
/*
const EVP_MD *
QUICKeyGenerator::get_handshake_digest(const SSL *ssl)
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICLossDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ QUICLossDetector::_set_loss_detection_timer()

// Don't arm the alarm if there are no packets with retransmittable data in flight.
// -- MODIFIED CODE --
// In psuedocode, `bytes_in_flight` is used, but we're tracking "retransmittable data in flight" by `_ack_eliciting_outstanding`
// In pseudocode, `bytes_in_flight` is used, but we're tracking "retransmittable data in flight" by `_ack_eliciting_outstanding`
if (this->_ack_eliciting_outstanding == 0) {
if (this->_loss_detection_timer) {
this->_loss_detection_alarm_at = 0;
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/QUICLossDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class QUICLossDetector : public Continuation, public QUICFrameHandler
class QUICRTTMeasure : public QUICRTTProvider
{
public:
// use `friend` so ld can acesss RTTMeasure.
// use `friend` so ld can access RTTMeasure.
// friend QUICLossDetector;

QUICRTTMeasure(const QUICLDConfig &ld_config);
Expand Down
4 changes: 2 additions & 2 deletions iocore/net/quic/QUICNewRenoCongestionController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ QUICNewRenoCongestionController::on_packet_acked(const QUICPacketInfo &acked_pac
// Slow start.
this->_context.trigger(QUICContext::CallbackEvent::CONGESTION_STATE_CHANGED, QUICCongestionController::State::SLOW_START);
this->_congestion_window += acked_packet.sent_bytes;
QUICCCDebug("slow start window chaged");
QUICCCDebug("slow start window changed");
} else {
// Congestion avoidance.
this->_context.trigger(QUICContext::CallbackEvent::CONGESTION_STATE_CHANGED,
Expand All @@ -106,7 +106,7 @@ QUICNewRenoCongestionController::on_packet_acked(const QUICPacketInfo &acked_pac
}
}

// addtional code
// additional code
// the original one is:
// CongestionEvent(sent_time):
void
Expand Down
Loading