lib/curl/Request: move code to SetupEasy()
This commit is contained in:
parent
b709401814
commit
f7346c1d78
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
|
||||
* Copyright 2008-2021 Max Kellermann <max.kellermann@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -48,6 +48,17 @@
|
|||
CurlRequest::CurlRequest(CurlGlobal &_global,
|
||||
CurlResponseHandler &_handler)
|
||||
:global(_global), handler(_handler)
|
||||
{
|
||||
SetupEasy();
|
||||
}
|
||||
|
||||
CurlRequest::~CurlRequest() noexcept
|
||||
{
|
||||
FreeEasy();
|
||||
}
|
||||
|
||||
void
|
||||
CurlRequest::SetupEasy()
|
||||
{
|
||||
error_buffer[0] = 0;
|
||||
|
||||
|
@ -65,11 +76,6 @@ CurlRequest::CurlRequest(CurlGlobal &_global,
|
|||
easy.SetOption(CURLOPT_HTTPAUTH, (long) CURLAUTH_ANY);
|
||||
}
|
||||
|
||||
CurlRequest::~CurlRequest() noexcept
|
||||
{
|
||||
FreeEasy();
|
||||
}
|
||||
|
||||
void
|
||||
CurlRequest::Start()
|
||||
{
|
||||
|
|
|
@ -154,6 +154,8 @@ public:
|
|||
void Done(CURLcode result) noexcept;
|
||||
|
||||
private:
|
||||
void SetupEasy();
|
||||
|
||||
/**
|
||||
* Frees the current "libcurl easy" handle, and everything
|
||||
* associated with it.
|
||||
|
|
Loading…
Reference in New Issue