6 #ifndef __XRD_TPC_STATE_HH__
7 #define __XRD_TPC_STATE_HH__
26 m_recv_status_line(false),
27 m_recv_all_headers(false),
36 m_is_transfer_state(true)
45 m_recv_status_line(false),
46 m_recv_all_headers(false),
55 m_is_transfer_state(false),
56 tpcForwardCreds(tpcForwardCreds)
58 InstallHandlers(curl);
64 State (off_t start_offset,
Stream &stream,
CURL *curl,
bool push,
bool tpcForwardCreds) :
66 m_recv_status_line(false),
67 m_recv_all_headers(false),
69 m_start_offset(start_offset),
76 m_is_transfer_state(true),
77 tpcForwardCreds(tpcForwardCreds)
79 InstallHandlers(curl);
90 void SetContentLength(
const off_t content_length) { m_content_length = content_length; }
145 bool InstallHandlers(
CURL *curl);
152 static size_t HeaderCB(
char *buffer,
size_t size,
size_t nitems,
154 int Header(
const std::string &header);
155 static size_t WriteCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
156 ssize_t Write(
char *buffer,
size_t size);
157 static size_t ReadCB(
void *buffer,
size_t size,
size_t nitems,
void *userdata);
158 int Read(
char *buffer,
size_t size);
161 bool m_recv_status_line;
162 bool m_recv_all_headers;
164 off_t m_start_offset;
167 off_t m_content_length;
170 struct curl_slist *m_headers;
171 std::vector<std::string> m_headers_copy;
172 std::string m_resp_protocol;
173 std::string m_error_buf;
174 bool m_is_transfer_state;
175 bool tpcForwardCreds =
false;
State(off_t start_offset, Stream &stream, CURL *curl, bool push, bool tpcForwardCreds)
int GetStatusCode() const
off_t BytesTransferred() const
void CopyHeaders(XrdHttpExtReq &req)
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 SetContentLength(const off_t content_length)
off_t GetContentLength() const
void SetErrorCode(int error_code)
State(CURL *curl, bool tpcForwardCreds)
int AvailableBuffers() const