6#ifndef __XRD_TPC_STATE_HH__
7#define __XRD_TPC_STATE_HH__
37 m_recv_status_line(false),
38 m_recv_all_headers(false),
47 m_is_transfer_state(true)
56 m_recv_status_line(false),
57 m_recv_all_headers(false),
67 m_is_transfer_state(false),
68 tpcForwardCreds(tpcForwardCreds)
70 InstallHandlers(curl);
76 State (off_t start_offset,
Stream &stream,
CURL *curl,
bool push,
bool tpcForwardCreds) :
78 m_recv_status_line(false),
79 m_recv_all_headers(false),
81 m_start_offset(start_offset),
89 m_is_transfer_state(true),
90 tpcForwardCreds(tpcForwardCreds)
92 InstallHandlers(curl);
171 bool InstallHandlers(
CURL *curl);
176 void RecordFinalizeError(
int error_code,
const std::string &error_msg);
183 static size_t HeaderCB(
char *buffer,
size_t size,
size_t nitems,
185 int Header(
const std::string &header);
186 static size_t WriteCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
187 ssize_t
Write(
char *buffer,
size_t size);
188 static size_t ReadCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
189 int Read(
char *buffer,
size_t size);
192 bool m_recv_status_line;
193 bool m_recv_all_headers;
195 off_t m_start_offset;
198 off_t m_content_length;
202 struct curl_slist *m_headers;
203 std::vector<std::string> m_headers_copy;
204 std::string m_resp_protocol;
205 std::string m_error_buf;
206 int m_finalize_error_code = 0;
207 std::string m_finalize_error_buf;
208 bool m_is_transfer_state;
209 bool tpcForwardCreds =
false;
State(off_t start_offset, Stream &stream, CURL *curl, bool push, bool tpcForwardCreds)
int GetFinalizeErrorCode() const
int GetStatusCode() const
off_t BytesTransferred() const
bool BodyTransferInProgress() const
void SetErrorMessage(const std::string &error_msg)
void SetTransferParameters(off_t offset, size_t size)
std::string GetFinalizeErrorMessage() const
std::string GetErrorMessage() const
std::string GetConnectionDescription()
void SetupHeaders(XrdHttpExtReq &req)
void SetContentLength(const off_t content_length)
off_t GetContentLength() const
void SetErrorCode(int error_code)
State(CURL *curl, bool tpcForwardCreds)
int AvailableBuffers() const