| 855 | } |
| 856 | |
| 857 | bool HttpOutgoingMessage::ChunkedWritableStream::canEndWritable() |
| 858 | { |
| 859 | if (finalChunkWritten) |
| 860 | { |
| 861 | return true; |
| 862 | } |
| 863 | if (finalChunkStarted) |
| 864 | { |
| 865 | return false; |
| 866 | } |
| 867 | |
| 868 | SC_HTTP_ASSERT_RELEASE(destination != nullptr); |
| 869 | finalChunkStarted = true; |
| 870 | Result finalWrite = destination->write(AsyncBufferView("0\r\n\r\n"), {[this](AsyncBufferView::ID writtenBufferID) |
| 871 | { onFinalChunkWritten(writtenBufferID); }}); |
| 872 | if (not finalWrite) |
| 873 | { |
| 874 | eventError.emit(finalWrite); |
| 875 | finalChunkWritten = true; |
| 876 | destination->end(); |
| 877 | return true; |
| 878 | } |
| 879 | return false; |
| 880 | } |
| 881 | |
| 882 | void HttpOutgoingMessage::ChunkedWritableStream::onChunkHeaderWritten(AsyncBufferView::ID) |
| 883 | { |
nothing calls this directly
no test coverage detected