mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibCore: Make CHttpJob::response() return a CHttpResponse*
We know that the CNetworkResponse inside a CHttpJob is always going to be a CHttpResponse, so we can return a casted pointer to be nice. :^)
This commit is contained in:
parent
2a21675b01
commit
40b7d814c3
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibCore/CHttpRequest.h>
|
||||
#include <LibCore/CHttpResponse.h>
|
||||
#include <LibCore/CNetworkJob.h>
|
||||
|
||||
class CTCPSocket;
|
||||
|
@ -15,6 +16,9 @@ public:
|
|||
virtual void start() override;
|
||||
virtual void shutdown() override;
|
||||
|
||||
CHttpResponse* response() { return static_cast<CHttpResponse*>(CNetworkJob::response()); }
|
||||
const CHttpResponse* response() const { return static_cast<const CHttpResponse*>(CNetworkJob::response()); }
|
||||
|
||||
private:
|
||||
void on_socket_connected();
|
||||
void finish_up();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue