Skip to content

Commit 2c68a81

Browse files
committed
[storescu] Fix misinterpretation of AE address as plain socket address in some cases
- Use `establish_with` instead of `establish` when connecting to SCP with the sync API without TLS - Use `establish_with_async` instead of `establish_async` when connecting to SCP with the async API without TLS
1 parent 5ad3e70 commit 2c68a81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

storescu/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn run(app: App) -> Result<(), Error> {
398398
store_sync::inner(scu, dicom_files, &progress_bar, fail_first, verbose, never_transcode, ignore_sop_class)?;
399399

400400
} else {
401-
let scu = scu_options.establish(&addr).map_err(Box::from).context(ScuSnafu)?;
401+
let scu = scu_options.establish_with(&addr).map_err(Box::from).context(ScuSnafu)?;
402402
store_sync::inner(scu, dicom_files, &progress_bar, fail_first, verbose, never_transcode, ignore_sop_class)?;
403403
}
404404
Ok(())
@@ -505,7 +505,7 @@ async fn run_async() -> Result<(), Error> {
505505
.await
506506
} else {
507507
let scu = scu_options
508-
.establish_async(&addr)
508+
.establish_with_async(&addr)
509509
.await
510510
.map_err(Box::from)
511511
.context(ScuSnafu)?;

ul/tests/association.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async fn test_tls_connection_async() -> Result<()> {
207207
.tls_config((*server_tls_config).clone());
208208

209209
// Spawn server task
210-
let server_handle = tokio::spawn(async move {
210+
let server_handle: tokio::task::JoinHandle<Result<_>> = tokio::spawn(async move {
211211
let (stream, _) = listener.accept().await.map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync + 'static>)?;
212212
let mut association = server_options.establish_tls_async(stream).await.map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync + 'static>)?;
213213

0 commit comments

Comments
 (0)