6 #ifndef __XRD_TPC_STATE_HH__
7 #define __XRD_TPC_STATE_HH__
28 m_recv_status_line(false),
29 m_recv_all_headers(false),
38 m_is_transfer_state(true)
47 m_recv_status_line(false),
48 m_recv_all_headers(false),
58 m_is_transfer_state(false),
59 tpcForwardCreds(tpcForwardCreds)
61 InstallHandlers(curl);
67 State (off_t start_offset,
Stream &stream,
CURL *curl,
bool push,
bool tpcForwardCreds) :
69 m_recv_status_line(false),
70 m_recv_all_headers(false),
72 m_start_offset(start_offset),
80 m_is_transfer_state(true),
81 tpcForwardCreds(tpcForwardCreds)
83 InstallHandlers(curl);
94 void SetContentLength(
const off_t content_length) { m_content_length = content_length; }
149 bool InstallHandlers(
CURL *curl);
156 static size_t HeaderCB(
char *buffer,
size_t size,
size_t nitems,
158 int Header(
const std::string &header);
159 static size_t WriteCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
160 ssize_t Write(
char *buffer,
size_t size);
161 static size_t ReadCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
162 int Read(
char *buffer,
size_t size);
165 bool m_recv_status_line;
166 bool m_recv_all_headers;
168 off_t m_start_offset;
171 off_t m_content_length;
175 struct curl_slist *m_headers;
176 std::vector<std::string> m_headers_copy;
177 std::string m_resp_protocol;
178 std::string m_error_buf;
179 bool m_is_transfer_state;
180 bool tpcForwardCreds =
false;
State(off_t start_offset, Stream &stream, CURL *curl, bool push, bool tpcForwardCreds)
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 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