Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ObjectStreamProcessResult::IncompleteMessage to Continue #149

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions moqt-server/src/modules/message_handlers/object_datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tokio::sync::Mutex;
#[derive(Debug, PartialEq)]
pub enum ObjectDatagramProcessResult {
Success(ObjectDatagram),
IncompleteMessage,
Continue,
Failure(TerminationErrorCode, String),
}

Expand Down Expand Up @@ -49,7 +49,7 @@ pub(crate) async fn try_read_object(

// Check if the data is exist
if payload_length == 0 {
return ObjectDatagramProcessResult::IncompleteMessage;
return ObjectDatagramProcessResult::Continue;
}

// check subscription and judge if it is invalid timing
Expand Down Expand Up @@ -92,7 +92,7 @@ pub(crate) async fn try_read_object(
tracing::warn!("{:#?}", err);
// Reset the cursor position because data for an object has not yet arrived
read_cur.set_position(0);
ObjectDatagramProcessResult::IncompleteMessage
ObjectDatagramProcessResult::Continue
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions moqt-server/src/modules/message_handlers/object_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::io::Cursor;
#[derive(Debug, PartialEq)]
pub enum ObjectStreamProcessResult {
Success(StreamObject),
IncompleteMessage,
Continue,
Failure(TerminationErrorCode, String),
}

Expand All @@ -31,7 +31,7 @@ pub async fn try_read_object(

// Check if the data is exist
if payload_length == 0 {
return ObjectStreamProcessResult::IncompleteMessage;
return ObjectStreamProcessResult::Continue;
}

let mut read_cur = Cursor::new(&buf[..]);
Expand All @@ -51,7 +51,7 @@ pub async fn try_read_object(
// Reset the cursor position because data for an object has not yet arrived
read_cur.set_position(0);

ObjectStreamProcessResult::IncompleteMessage
ObjectStreamProcessResult::Continue
}
}
}
Expand All @@ -69,7 +69,7 @@ pub async fn try_read_object(
// // Reset the cursor position because data for an object has not yet arrived
read_cur.set_position(0);

ObjectStreamProcessResult::IncompleteMessage
ObjectStreamProcessResult::Continue
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions moqt-server/src/modules/message_handlers/stream_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use tokio::sync::Mutex;
#[derive(Debug, PartialEq)]
pub enum StreamHeaderProcessResult {
Success(StreamHeader),
IncompleteMessage,
Continue,
Failure(TerminationErrorCode, String),
}

Expand Down Expand Up @@ -59,7 +59,7 @@ pub async fn try_read_header(

// Check if the data stream type is exist
if payload_length == 0 {
return StreamHeaderProcessResult::IncompleteMessage;
return StreamHeaderProcessResult::Continue;
}

// check subscription and judge if it is invalid timing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl DatagramReceiver {

match result {
ObjectDatagramProcessResult::Success(datagram_object) => Ok(Some(datagram_object)),
ObjectDatagramProcessResult::IncompleteMessage => Ok(None),
ObjectDatagramProcessResult::Continue => Ok(None),
ObjectDatagramProcessResult::Failure(code, reason) => {
let msg = std::format!("object_stream_read failure: {:?}", reason);
tracing::error!(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl UniStreamReceiver {

match result {
StreamHeaderProcessResult::Success(stream_header) => Ok(Some(stream_header)),
StreamHeaderProcessResult::IncompleteMessage => Ok(None),
StreamHeaderProcessResult::Continue => Ok(None),
StreamHeaderProcessResult::Failure(code, reason) => {
let msg = std::format!("stream_header_read failure: {:?}", reason);
Err((code, msg))
Expand Down Expand Up @@ -433,7 +433,7 @@ impl UniStreamReceiver {

match result {
ObjectStreamProcessResult::Success(stream_object) => Ok(Some(stream_object)),
ObjectStreamProcessResult::IncompleteMessage => Ok(None),
ObjectStreamProcessResult::Continue => Ok(None),
ObjectStreamProcessResult::Failure(code, reason) => {
let msg = std::format!("object_stream_read failure: {:?}", reason);
Err((code, msg))
Expand Down
Loading