Skip to content

Commit

Permalink
Attempt to pass request object to createStoreWritableStream
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-viney committed Feb 22, 2024
1 parent e092f83 commit 4192ec9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,10 @@ declare class Scp extends Network {
* The default implementation creates a memory Writable stream that for, big instances,
* could cause out of memory situations.
*/
createStoreWritableStream(acceptedPresentationContext: PresentationContext): Writable;
createStoreWritableStream(
acceptedPresentationContext: PresentationContext,
request: CStoreRequest
): Writable;

/**
* Allows the caller to create a Dataset from the Writable stream used to
Expand Down
5 changes: 4 additions & 1 deletion src/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ class Network extends AsyncEventEmitter {
if (this.dimse.getCommandFieldType() === CommandFieldType.CStoreRequest) {
if (!this.dimseStoreStream) {
this.dimseStream = undefined;
this.dimseStoreStream = this.createStoreWritableStream(presentationContext);
this.dimseStoreStream = this.createStoreWritableStream(
presentationContext,
this.dimse
);
}
} else {
if (!this.dimseStream) {
Expand Down
3 changes: 2 additions & 1 deletion src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ class Scp extends Network {
* could cause out of memory situations.
* @method
* @param {PresentationContext} acceptedPresentationContext - The accepted presentation context.
* @param {CStoreRequest} request - C-STORE request.
* @returns {Writable} The created store writable stream.
*/
// eslint-disable-next-line no-unused-vars
createStoreWritableStream(acceptedPresentationContext) {
createStoreWritableStream(acceptedPresentationContext, request) {
return super.createStoreWritableStream();
}

Expand Down

0 comments on commit 4192ec9

Please sign in to comment.