19 #ifndef SRC_XRDCL_XRDCLASYNCMSGWRITER_HH_
20 #define SRC_XRDCL_XRDCLASYNCMSGWRITER_HH_
51 const std::string &strmname,
54 AnyObject &chdata ) : writestage( WriteStart ),
55 xrdTransport( xrdTransport ),
59 substrmnb( substrmnb ),
72 writestage = WriteStart;
94 std::pair<Message *, MsgHandler *> toBeSent;
96 outmsg = toBeSent.first;
97 outhandler = toBeSent.second;
101 outmsgsize = outmsg->
GetSize();
108 if( !st.
IsOK() )
return st;
109 outsign.reset( signature );
112 outmsgsize += outsign->GetSize();
117 writestage = WriteSign;
136 writestage = WriteRequest;
149 writestage = WriteRawData;
157 if( outhandler->
IsRaw() )
162 outmsgsize += wrtcnt;
164 "(%p) body.", strmname.c_str(), wrtcnt, outmsg );
169 writestage = WriteDone;
223 TransportHandler &xrdTransport;
225 const std::string &strmname;
235 MsgHandler *outhandler;
236 std::unique_ptr<Message> outsign;
const char * XrdSysE2T(int errcode)
Utility class encapsulating writing request logic.
XRootDStatus Write()
Write the request into the socket.
AsyncMsgWriter(TransportHandler &xrdTransport, Socket &socket, const std::string &strmname, Stream &strm, uint16_t substrmnb, AnyObject &chdata)
void Reset()
Reset the state of the object (makes it ready to read out next msg)
void SetCursor(uint32_t cursor)
Set the cursor.
uint32_t GetSize() const
Get the size of the message.
static Log * GetLog()
Get default log.
void Error(uint64_t topic, const char *format,...)
Report an error.
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
The message representation used throughout the system.
const std::string & GetObfuscatedDescription() const
Get the description of the message with authz parameter obfuscated.
virtual XRootDStatus WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
virtual bool IsRaw() const
virtual XRootDStatus Send(const char *buffer, size_t size, int &bytesWritten)
void OnMessageSent(uint16_t subStream, Message *msg, uint32_t bytesSent)
std::pair< Message *, MsgHandler * > OnReadyToWrite(uint16_t subStream)
Perform the handshake and the authentication for each physical stream.
virtual Status GetSignature(Message *toSign, Message *&sign, AnyObject &channelData)=0
Get signature for given message.
const uint16_t stOK
Everything went OK.
const uint64_t AsyncSockMsg
const uint16_t suAlreadyDone
uint16_t code
Error type, or additional hints on what to do.
bool IsOK() const
We're fine.
uint32_t errNo
Errno, if any.