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

Fixes to the original code so that it works #1

Open
janftacnik opened this issue Apr 19, 2024 · 0 comments
Open

Fixes to the original code so that it works #1

janftacnik opened this issue Apr 19, 2024 · 0 comments

Comments

@janftacnik
Copy link

Hi Toshokan, I grabbed your code and it did not work for me.
I have made it work by finding and fixing 3 simple issues (two times you have forgotten to send ACK after receiving information and also parsing of name of the file to print did not accept space in itself). After my fixes it strted to work.
Here are notes about what I did, and I am including working version of code as well:

in File: /src/lib.rs

async fn receive_job<P: parse::Parse>(&mut self) -> Result<Option, LpdError>
Missing:
self.positive_ack().await?;

in:
lpd::ReceiveJobSubcommand::ReceiveDataFile(b, _) => {
self.positive_ack().await?;
job.df = Some(self.read_data_file(b).await?);
}

async fn read_control_file<P: parse::Parse>(&mut self, bytes: usize) -> Result<lpd::ControlFile, LpdError>
Missing:
 	self.positive_ack().await?;    

in:
where LpdError: From<P::Error>
{
self.positive_ack().await?;
let mut file = lpd::ControlFile::default();
let mut read_bytes = 0;
....

In file: /src/parse/raw/util.rs
pub fn octet_seq_parser(i: &str) -> IResult<&str, &str> {
is_not("\x0B\t\x0C\n")(i)

// originally is_not(" \x0B\t\x0C\n")(i)
// but there can be space in the name of the file !
}
lpd_fixed.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant