Skip to content

Add an optional argument to HttpServerResponse.sendFile() to control whether the response is ended #5025

Description

@oxsdd

Add an optional argument to HttpServerResponse.sendFile() that indicates whether the response should be ended.

Currently, sendFile always ends the response. This prevents sending data from more than one file.

This would be similar in nature to Pipe.endOnComplete().

This option would be also be available on the sendFile(filename, offset) and sendFile(filename, offset, length) variants as well, so partial files could also be sent.

Use case: We have an S3 storage service where multipart objects are stored in multiple files. We can send single part S3 objects with sendFile. But, when sending multipart objects (ranges), we must compose Pipe futures with endOnComplete(false), which does not take advantage of the zero-copy IO features of Linux.

I would not be able to contribute, but would be able to test the feature.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions