Skip to content

Commit

Permalink
use const address for wrapper flush (#1723)
Browse files Browse the repository at this point in the history
rukai authored Aug 22, 2024
1 parent 8c69a10 commit 56148bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions shotover/src/transforms/mod.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ use anyhow::{anyhow, Result};
use async_trait::async_trait;
use futures::Future;
use std::fmt::Debug;
use std::net::SocketAddr;
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
use std::pin::Pin;
use std::slice::IterMut;
use std::sync::Arc;
@@ -237,7 +237,7 @@ impl<'shorter, 'longer: 'shorter> ChainState<'longer> {
ChainState {
requests,
transforms: [].iter_mut(),
local_addr: "127.0.0.1:8000".parse().unwrap(),
local_addr: DUMMY_ADDRESS,
flush: false,
close_client_connection: false,
}
@@ -258,7 +258,7 @@ impl<'shorter, 'longer: 'shorter> ChainState<'longer> {
requests: vec![],
transforms: [].iter_mut(),
// The connection is closed so we need to just fake an address here
local_addr: "127.0.0.1:10000".parse().unwrap(),
local_addr: DUMMY_ADDRESS,
flush: true,
close_client_connection: false,
}
@@ -281,6 +281,8 @@ impl<'shorter, 'longer: 'shorter> ChainState<'longer> {
}
}

const DUMMY_ADDRESS: SocketAddr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, 0));

/// This trait is the primary extension point for Shotover-proxy.
/// A [`Transform`] is a struct that implements the Transform trait and enables you to modify and observe database
/// queries or frames.

0 comments on commit 56148bf

Please sign in to comment.