mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 11:21:34 +00:00
LibHTTP: Support Transfer-Encoding: chunked
We advertise ourselves to servers as supporting HTTP/1.1; we should put our money where our mouth is, and start supporting some of its features.
This commit is contained in:
parent
6b1ed26e6a
commit
0fbcb3c5b6
Notes:
sideshowbarker
2024-07-19 06:42:58 +09:00
Author: https://github.com/alimpfard
Commit: 0fbcb3c5b6
Pull-request: https://github.com/SerenityOS/serenity/pull/2197
Reviewed-by: https://github.com/awesomekling
2 changed files with 99 additions and 3 deletions
|
@ -27,6 +27,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <LibCore/NetworkJob.h>
|
||||
#include <LibCore/TCPSocket.h>
|
||||
#include <LibHTTP/HttpRequest.h>
|
||||
|
@ -66,6 +67,7 @@ protected:
|
|||
InHeaders,
|
||||
InBody,
|
||||
Finished,
|
||||
AfterChunkedEncodingTrailer,
|
||||
};
|
||||
|
||||
HttpRequest m_request;
|
||||
|
@ -75,6 +77,8 @@ protected:
|
|||
Vector<ByteBuffer> m_received_buffers;
|
||||
size_t m_received_size { 0 };
|
||||
bool m_sent_data { 0 };
|
||||
Optional<ssize_t> m_current_chunk_remaining_size;
|
||||
Optional<size_t> m_current_chunk_total_size;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue