| 192 | |
| 193 | |
| 194 | Future<size_t> PollSocketImpl::sendfile(int_fd fd, off_t offset, size_t size) |
| 195 | { |
| 196 | CHECK(size > 0); // TODO(benh): Just return 0 if `size` is 0? |
| 197 | |
| 198 | // Need to hold a copy of `this` so that the underlying socket |
| 199 | // doesn't end up getting reused before we return. |
| 200 | auto self = shared(this); |
| 201 | |
| 202 | return windows::sendfile(self->get(), fd, offset, size) |
| 203 | .then([self](size_t length) { return length; }); |
| 204 | } |
| 205 | |
| 206 | } // namespace internal { |
| 207 | } // namespace network { |