Skip to content

Conversation

@Ruakij
Copy link

@Ruakij Ruakij commented Jul 22, 2023

When the user has aborted the connection, we should detect it and stop reading & packing the current file we are working on.

I wasnt sure what the best way is to bubble the failure to addFileFromStream, so i just set everything to 0 and checked that.
Feel free to change that.

Because we have already written some data to the outputStream, i consider it dirty. Maybe we should add that to the function documentation?

// Before potentially reading the next chunk, check if user aborted the connection.
// Ignored (not aborted), when ignore_user_abort is set.
if (connection_aborted() === 1 && ignore_user_abort() === 0) {
return array(0, 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about throwing an exception here? The first element is expected to be an Count64 instance.

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.

3 participants