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

Refactor_clamd.ts #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactor_clamd.ts #10

wants to merge 1 commit into from

Conversation

casalsgh
Copy link

Optimized chunked data transfer: Instead of pausing and resuming the socket for each chunk, a chunkTransform function is introduced using Transform stream to handle chunked data transfer efficiently.

Simplified stream handling: The readStream is now directly piped to the chunkTransform stream and then to the socket. The end event is properly handled to ensure the socket is closed when the stream ends.

Enhanced error handling: The readStream error event is explicitly handled to reject the promise and close the socket. The socket error event is also handled to reject the promise with the encountered error.

Streamlined buffer scanning: The scanBuffer function now directly creates a readable stream from the buffer and passes it to the scanStream function, eliminating the need for maintaining the start variable.

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

Successfully merging this pull request may close these issues.

1 participant