mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +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
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