1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

CHttpJob: Drive response download via on_ready_read instead of blocking

This allows the event loop to service events while an HTTP download is
happening. Pretty cool :^)
This commit is contained in:
Andreas Kling 2019-08-04 18:55:52 +02:00
parent 72b69b82bb
commit b5aac9c44b
2 changed files with 25 additions and 28 deletions

View file

@ -16,6 +16,7 @@ public:
private:
void on_socket_connected();
void finish_up();
enum class State {
InStatus,
@ -29,4 +30,6 @@ private:
State m_state { State::InStatus };
int m_code { -1 };
HashMap<String, String> m_headers;
Vector<ByteBuffer> m_received_buffers;
size_t m_received_size { 0 };
};