Improve handling of maximum PDU lengths in scpproxy and lower the negotiable size#708
Merged
Improve handling of maximum PDU lengths in scpproxy and lower the negotiable size#708
Conversation
- [findscu][storescp][storescu][scpproxy] Update max_pdu_length option accordingly
- modify association requests and acknowledgements so that they are not higher than the proxy's maximum PDU length - protect buffer allocations
Contributor
|
The test is failing because it is splitting 9000 bytes in several sends, and expects them to be split in three fragments (4K + 4K + about 1K). Now that the 4K have been reduced to 1K, it's no longer three fragments. So I propose to change 9000 to 2500 which is 1K + 1K + about 0.5K: diff --git a/ul/src/association/pdata.rs b/ul/src/association/pdata.rs
index 9a770dce..cde40326 100644
--- a/ul/src/association/pdata.rs
+++ b/ul/src/association/pdata.rs
@@ -776,7 +776,7 @@ mod tests {
fn test_write_large_pdata_and_finish() {
let presentation_context_id = 32;
- let my_data: Vec<_> = (0..9000).map(|x: u32| x as u8).collect();
+ let my_data: Vec<_> = (0..2500).map(|x: u32| x as u8).collect();
let mut buf = Vec::new();
{
@@ -822,7 +822,7 @@ mod tests {
);
assert_eq!(
data_3.data.len(),
- 9000 - (MINIMUM_PDU_SIZE - PDV_HEADER_SIZE) as usize * 2
+ 2500 - (MINIMUM_PDU_SIZE - PDV_HEADER_SIZE) as usize * 2
);
// check data consistency
@@ -834,7 +834,7 @@ mod tests {
);
assert_eq!(
data_1.data.len() + data_2.data.len() + data_3.data.len(),
- 9000
+ 2500
);
let data_1 = &data_1.data;
@@ -858,7 +858,7 @@ mod tests {
async fn test_async_write_large_pdata_and_finish() {
let presentation_context_id = 32;
- let my_data: Vec<_> = (0..9000).map(|x: u32| x as u8).collect();
+ let my_data: Vec<_> = (0..2500).map(|x: u32| x as u8).collect();
let mut buf = Vec::new();
{
@@ -905,7 +905,7 @@ mod tests {
);
assert_eq!(
data_3.data.len(),
- 9000 - (MINIMUM_PDU_SIZE - PDV_HEADER_SIZE) as usize * 2
+ 2500 - (MINIMUM_PDU_SIZE - PDV_HEADER_SIZE) as usize * 2
);
// check data consistency
@@ -917,7 +917,7 @@ mod tests {
);
assert_eq!(
data_1.data.len() + data_2.data.len() + data_3.data.len(),
- 9000
+ 2500
);
let data_1 = &data_1.data;(edit: full commit here: pgimeno4d@b717aee ) |
Owner
Author
|
Thanks for the input @pgimeno4d! I went with that suggestion in order to fix the tests. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MINIMUM_PDU_SIZEto 1018 and changes its documentation. Not sure if anyone will ever need to request a PDU length smaller than this. Resolves No such thing as a "minimum PDU size, specified by the standard" #703