mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibProtocol+Userland: Support unbuffered protocol requests
LibWeb will need to use unbuffered requests to support server-sent events. Connection for such events remain open and the remote end sends data as HTTP bodies at its leisure. The browser needs to be able to handle this data as it arrives, as the request essentially never finishes. To support this, this make Protocol::Request operate in one of two modes: buffered or unbuffered. The existing mechanism for setting up a buffered request was a bit awkward; you had to set specific callbacks, but be sure not to set some others, and then set a flag. The new mechanism is to set the mode and the callbacks that the mode needs in one API.
This commit is contained in:
parent
086ddd481d
commit
168d28c15f
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/trflynn89
Commit: 168d28c15f
Pull-request: https://github.com/SerenityOS/serenity/pull/24452
Issue: https://github.com/SerenityOS/serenity/issues/23847
14 changed files with 189 additions and 129 deletions
|
@ -25,11 +25,10 @@ public:
|
|||
static ErrorOr<NonnullRefPtr<RequestServerRequestAdapter>> try_create(NonnullRefPtr<Protocol::Request>);
|
||||
virtual ~RequestServerRequestAdapter() override;
|
||||
|
||||
virtual void set_should_buffer_all_input(bool) override;
|
||||
virtual void set_buffered_request_finished_callback(Protocol::Request::BufferedRequestFinished) override;
|
||||
virtual void set_unbuffered_request_callbacks(Protocol::Request::HeadersReceived, Protocol::Request::DataReceived, Protocol::Request::RequestFinished) override;
|
||||
virtual bool stop() override;
|
||||
|
||||
virtual void stream_into(Stream&) override;
|
||||
|
||||
private:
|
||||
RequestServerRequestAdapter(NonnullRefPtr<Protocol::Request>);
|
||||
NonnullRefPtr<Protocol::Request> m_request;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue