Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Aug 8, 2024
1 parent b94b360 commit 3ac28c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/codec/qcmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ pub fn spawn(socket: socket2::Socket, mut shutdown_rx: crate::ShutdownRx) -> cra
tracing::debug!("sending QCMP ping reply");

// Update the iovec with the actual length of the pong
iov.iov_len = buf.buf.len();
iov.iov_len = buf.len;

// Note we don't have to do anything else with the msghdr
// as the recv has already filled in the socket address
Expand Down
22 changes: 16 additions & 6 deletions src/components/proxy/packet_router/reference.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! The reference implementation is used for non-Linux targets
impl super::DownstreamReceiveWorkerConfig {
pub async fn spawn(self) -> eyre::Result<tokio::sync::oneshot::Receiver<crate::Result<()>>> {
pub async fn spawn(
self,
_shutdown: crate::ShutdownRx,
) -> eyre::Result<tokio::sync::oneshot::Receiver<crate::Result<()>>> {
let Self {
worker_id,
upstream_receiver,
Expand Down Expand Up @@ -38,12 +41,16 @@ impl super::DownstreamReceiveWorkerConfig {
crate::metrics::errors_total(
crate::metrics::WRITE,
&error.to_string(),
None,
&crate::metrics::EMPTY,
)
.inc();
}
Ok((data, asn_info, send_addr)) => {
let (result, _) = send_socket.send_to(data, send_addr).await;
Ok(crate::components::proxy::SendPacket {
destination,
asn_info,
data,
}) => {
let (result, _) = send_socket.send_to(data, destination).await;
let asn_info = asn_info.as_ref();
match result {
Ok(size) => {
Expand Down Expand Up @@ -100,8 +107,11 @@ impl super::DownstreamReceiveWorkerConfig {
};

if let Some(last_received_at) = last_received_at {
crate::metrics::packet_jitter(crate::metrics::READ, None)
.set((packet.received_at - last_received_at).nanos());
crate::metrics::packet_jitter(
crate::metrics::READ,
&crate::metrics::EMPTY,
)
.set((packet.received_at - last_received_at).nanos());
}
last_received_at = Some(packet.received_at);

Expand Down
6 changes: 3 additions & 3 deletions src/components/proxy/sessions/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl super::SessionPool {
crate::metrics::errors_total(
crate::metrics::WRITE,
"downstream channel closed",
None,
&crate::metrics::EMPTY,
)
.inc();
break;
Expand All @@ -35,7 +35,7 @@ impl super::SessionPool {
data,
asn_info,
}) => {
tracing::trace!(%dest, length = data.len(), "sending packet upstream");
tracing::trace!(%destination, length = data.len(), "sending packet upstream");
let (result, _) = socket2.send_to(data, destination).await;
let asn_info = asn_info.as_ref();
match result {
Expand Down Expand Up @@ -80,7 +80,7 @@ impl super::SessionPool {
match result {
Err(error) => {
tracing::trace!(%error, "error receiving packet");
crate::metrics::errors_total(crate::metrics::WRITE, &error.to_string(), None).inc();
crate::metrics::errors_total(crate::metrics::WRITE, &error.to_string(), &crate::metrics::EMPTY).inc();
},
Ok((_size, recv_addr)) => pool.process_received_upstream_packet(buf, recv_addr, port, &mut last_received_at).await,
}
Expand Down

0 comments on commit 3ac28c0

Please sign in to comment.