Commit 568df6c0 authored by Sven Liefgen's avatar Sven Liefgen
Browse files

Fmt

parent f88fc02d
Pipeline #4766 passed with stages
in 3 minutes and 19 seconds
......@@ -716,13 +716,24 @@ impl<C: 'static + Coder> BoundSocket<C> {
}
fn send<Sync: Bit, Try: Bit>(&mut self, buf: &[u8]) -> io::Result<()> {
if buf.len() > self.inner.maximum_payload_size.lock().unwrap().get::<byte>() as usize {
if buf.len()
> self
.inner
.maximum_payload_size
.lock()
.unwrap()
.get::<byte>() as usize
{
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"Data to be sent ({} bytes is too long, as MTU is {}.)",
buf.len(),
self.inner.maximum_payload_size.lock().unwrap().get::<byte>()
self.inner
.maximum_payload_size
.lock()
.unwrap()
.get::<byte>()
),
));
}
......@@ -1261,10 +1272,10 @@ fn send_packet<C: Coder>(s: &mut SendSocket<C>, mut packet: Packet) -> bool {
// debug(DEBUG_DATATRANSMITTER, "Pacing interval passed");
s.inner.prrt_transmit_pace.lock().unwrap().track_pause();
let wait_successful = s.inner.receiver.wait_for_space(
*mtu,
&s.inner.application_constraints,
);
let wait_successful = s
.inner
.receiver
.wait_for_space(*mtu, &s.inner.application_constraints);
s.inner.prrt_transmit_pace.lock().unwrap().track_resume();
if !wait_successful {
// debug(DEBUG_DATATRANSMITTER, "Wait for space interrupted");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment