mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-06 16:14:11 +00:00
fix #283, build regression because of flow-stat with usize
This commit is contained in:
+1
-1
@@ -176,7 +176,7 @@ async fn flow_report_task(context: SharedContext) -> io::Result<()> {
|
||||
let tx = flow_stat.tcp().tx() + flow_stat.udp().tx();
|
||||
let rx = flow_stat.tcp().rx() + flow_stat.udp().rx();
|
||||
|
||||
let buf: [u64; 2] = [tx, rx];
|
||||
let buf: [u64; 2] = [tx as u64, rx as u64];
|
||||
let buf = unsafe { slice::from_raw_parts(buf.as_ptr() as *const _, 16) };
|
||||
|
||||
match time::timeout(timeout, stream.write_all(buf)).await {
|
||||
|
||||
@@ -374,7 +374,7 @@ impl AsyncRead for ProxyStream {
|
||||
{
|
||||
if self.is_proxied() {
|
||||
if let Poll::Ready(Ok(n)) = p {
|
||||
self.context().local_flow_statistic().tcp().incr_rx(n as u64);
|
||||
self.context().local_flow_statistic().tcp().incr_rx(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ impl AsyncWrite for ProxyStream {
|
||||
{
|
||||
if self.is_proxied() {
|
||||
if let Poll::Ready(Ok(n)) = p {
|
||||
self.context().local_flow_statistic().tcp().incr_tx(n as u64);
|
||||
self.context().local_flow_statistic().tcp().incr_tx(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ impl ProxyAssociation {
|
||||
|
||||
#[cfg(feature = "local-flow-stat")]
|
||||
{
|
||||
context.local_flow_statistic().udp().incr_tx(send_len as u64);
|
||||
context.local_flow_statistic().udp().incr_tx(send_len);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -482,7 +482,7 @@ impl ProxyAssociation {
|
||||
|
||||
#[cfg(feature = "local-flow-stat")]
|
||||
{
|
||||
context.local_flow_statistic().udp().incr_rx(recv_n as u64);
|
||||
context.local_flow_statistic().udp().incr_rx(recv_n);
|
||||
}
|
||||
|
||||
Ok((addr, payload))
|
||||
|
||||
Reference in New Issue
Block a user