mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-01 00:01:52 +00:00
deploy: f73116e6698f8a711ec33477561858061a2ff28d
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3537,6 +3537,14 @@
|
||||
<a href="#3537" id="3537">3537</a>
|
||||
<a href="#3538" id="3538">3538</a>
|
||||
<a href="#3539" id="3539">3539</a>
|
||||
<a href="#3540" id="3540">3540</a>
|
||||
<a href="#3541" id="3541">3541</a>
|
||||
<a href="#3542" id="3542">3542</a>
|
||||
<a href="#3543" id="3543">3543</a>
|
||||
<a href="#3544" id="3544">3544</a>
|
||||
<a href="#3545" id="3545">3545</a>
|
||||
<a href="#3546" id="3546">3546</a>
|
||||
<a href="#3547" id="3547">3547</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! Implements a socket that can change its communication path while in use, actively searching for the best way to communicate.
|
||||
//!
|
||||
//! Based on tailscale/wgengine/magicsock
|
||||
@@ -4240,11 +4248,19 @@
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>quic_packets_count = <span class="number">0</span>;
|
||||
<span class="kw">if </span>meta.len > meta.stride {
|
||||
<span class="macro">trace!</span>(%meta.len, %meta.stride, <span class="string">"GRO packet received"</span>);
|
||||
<span class="comment">// TODO: Add a metric for this
|
||||
</span>}
|
||||
<span class="macro">inc!</span>(MagicsockMetrics, recv_gro_packets);
|
||||
}
|
||||
|
||||
<span class="comment">// find disco and stun packets and forward them to the actor
|
||||
</span><span class="kw">for </span>packet <span class="kw">in </span>buf[..meta.len].chunks_mut(meta.stride) {
|
||||
<span class="kw">if </span>packet.len() < meta.stride {
|
||||
<span class="macro">trace!</span>(
|
||||
len = %packet.len(),
|
||||
%meta.stride,
|
||||
<span class="string">"Last GRO datagram smaller than stride"</span>,
|
||||
);
|
||||
}
|
||||
|
||||
<span class="kw">let </span>packet_is_quic = <span class="kw">if </span>stun::is(packet) {
|
||||
<span class="macro">trace!</span>(src = %meta.addr, len = %meta.stride, <span class="string">"UDP recv: stun packet"</span>);
|
||||
<span class="kw">let </span>packet2 = Bytes::copy_from_slice(packet);
|
||||
|
||||
@@ -138,6 +138,9 @@
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>iroh_metrics::{
|
||||
core::{Counter, Metric},
|
||||
struct_iterable::Iterable,
|
||||
@@ -164,6 +167,8 @@
|
||||
<span class="kw">pub </span>recv_data_ipv6: Counter,
|
||||
<span class="doccomment">/// Number of QUIC datagrams received.
|
||||
</span><span class="kw">pub </span>recv_datagrams: Counter,
|
||||
<span class="doccomment">/// Number of datagrams received using GRO
|
||||
</span><span class="kw">pub </span>recv_gro_packets: Counter,
|
||||
|
||||
<span class="comment">// Disco packets
|
||||
</span><span class="kw">pub </span>send_disco_udp: Counter,
|
||||
@@ -230,6 +235,7 @@
|
||||
recv_data_ipv4: Counter::new(<span class="string">"recv_data_ipv4"</span>),
|
||||
recv_data_ipv6: Counter::new(<span class="string">"recv_data_ipv6"</span>),
|
||||
recv_datagrams: Counter::new(<span class="string">"recv_datagrams"</span>),
|
||||
recv_gro_packets: Counter::new(<span class="string">"recv_gro_packets"</span>),
|
||||
|
||||
<span class="comment">// Disco packets
|
||||
</span>send_disco_udp: Counter::new(<span class="string">"disco_send_udp"</span>),
|
||||
|
||||
Reference in New Issue
Block a user