We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Pulling the cable on a device while a request is processing results in a panic at tokio-modbus/src/service/rtu.rs:60:
tokio-modbus/src/service/rtu.rs:60
async fn call(&mut self, req: Request) -> Result<Response, Error> { let disconnect = req == Request::Disconnect; let req_adu = self.next_request_adu(req, disconnect); let req_hdr = req_adu.hdr; self.service.send(req_adu).await?; let res_adu = self.service.next().await.unwrap()?; // This is where it panics match res_adu.pdu { ResponsePdu(Ok(res)) => verify_response_header(req_hdr, res_adu.hdr).and(Ok(res)), ResponsePdu(Err(err)) => Err(Error::new(ErrorKind::Other, err)), } }
This seems to be a regression from v0.3.5 where it would instead return a broken pipe error.
It looks like it should be a pretty easy fix. Just map the None to some error and return that.
None
The text was updated successfully, but these errors were encountered:
@Foelsgaard thanks for reporting! Hopefully I'll be able to fix that soon.
Sorry, something went wrong.
@flosse Great! Thank you so much! :)
flosse
Successfully merging a pull request may close this issue.
Pulling the cable on a device while a request is processing results in a panic at
tokio-modbus/src/service/rtu.rs:60
:This seems to be a regression from v0.3.5 where it would instead return a broken pipe error.
It looks like it should be a pretty easy fix. Just map the
None
to some error and return that.The text was updated successfully, but these errors were encountered: