We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 440766a commit cd9a7deCopy full SHA for cd9a7de
src/decode.rs
@@ -1,5 +1,5 @@
1
use std::{
2
- io::Write,
+ io::{BufRead, BufReader, Write},
3
mem,
4
net::{Ipv4Addr, TcpStream},
5
sync::{Arc, Mutex},
@@ -372,6 +372,20 @@ pub fn make_decoder(
372
373
stream_in.send(PlayerMsg::Connected).ok();
374
375
+ let mut data_stream = BufReader::new(data_stream);
376
+
377
+ // Read until we encounter the end of headers (a blank line: "\r\n\r\n")
378
+ {
379
+ let mut line = String::new();
380
+ loop {
381
+ line.clear();
382
+ let bytes_read = data_stream.read_line(&mut line)?;
383
+ if bytes_read == 0 || line == "\r\n" {
384
+ break;
385
+ }
386
387
388
389
let mss = MediaSourceStream::new(
390
Box::new(ReadOnlySource::new(SlimBuffer::with_capacity(
391
threshold as usize * 1024,
0 commit comments