XRootD
XrdXrootd::Bridge::Context Class Reference

#include <XrdXrootdBridge.hh>

+ Inheritance diagram for XrdXrootd::Bridge::Context:
+ Collaboration diagram for XrdXrootd::Bridge::Context:

Public Member Functions

 Context (XrdLink *lP, kXR_char *sid, kXR_unt16 req)
 Constructor and Destructor. More...
 
virtual ~Context ()
 
virtual int Send (const struct iovec *headP, int headN, const struct iovec *tailP, int tailN)
 

Public Attributes

XrdLinklinkP
 -> associated session link object (i.e. connection) More...
 
kXR_unt16 rCode
 associated "kXR" request code in host byte order More...
 
union {
kXR_char chr [2]
 associated stream ID as the original char[2] More...
 
kXR_unt16 num
 associated stream ID as a short More...
 
sID
 associated request stream ID More...
 

Detailed Description

Provide callback context.

The Context object is passed in all Result object callbacks and contains information describing the result context. No public members should be changed by any result callback method. The context object also includes a method that must be used to complete a pending sendfile() result.

Definition at line 225 of file XrdXrootdBridge.hh.

Constructor & Destructor Documentation

◆ Context()

XrdXrootd::Bridge::Context::Context ( XrdLink lP,
kXR_char sid,
kXR_unt16  req 
)
inline

Constructor and Destructor.

Definition at line 274 of file XrdXrootdBridge.hh.

275  : linkP(lP), rCode(req)
276  {memcpy(sID.chr, sid, sizeof(sID.chr));}
union XrdXrootd::Bridge::Context::@162 sID
associated request stream ID
kXR_unt16 rCode
associated "kXR" request code in host byte order
XrdLink * linkP
-> associated session link object (i.e. connection)

References sID.

◆ ~Context()

virtual XrdXrootd::Bridge::Context::~Context ( )
inlinevirtual

Definition at line 277 of file XrdXrootdBridge.hh.

277 {}

Member Function Documentation

◆ Send()

virtual int XrdXrootd::Bridge::Context::Send ( const struct iovec *  headP,
int  headN,
const struct iovec *  tailP,
int  tailN 
)
inlinevirtual

Complete a File() callback.

The Send() method must be called after the File() callback is invoked to complete data transmission using sendfile(). If Send() is not called the pending sendfile() call is not made and no data is sent to the client.

Parameters
headPa pointer to the iovec structure containing the data that must be sent before the sendfile() data. If there is none, the pointer can be null.
headNthe number of elements in the headP iovec structure array.
tailPa pointer to the iovec structure containing the data that must be sent after the sendfile() data. If there is none, the pointer can be null.
tailNthe number of elements in the tailP iovec structure array.
Returns
< 0 transmission error has occurred. This can be due to either connection failure or data source error (i.e. I/O error). = 0 data has been successfully sent. > 0 the supplied context was not generated by a valid File() callback. No data has been sent.
Parameters
headPpointer to leading data array
headNarray count
tailPpointer to trailing data array
tailNarray count

Reimplemented in XrdXrootdTransSend.

Definition at line 258 of file XrdXrootdBridge.hh.

265 {
266  (void)headP; (void)headN; (void)tailP; (void)tailN;
267  return 1;
268 }

Referenced by XrdHttpReq::File().

+ Here is the caller graph for this function:

Member Data Documentation

◆ linkP

XrdLink* XrdXrootd::Bridge::Context::linkP

-> associated session link object (i.e. connection)

Definition at line 229 of file XrdXrootdBridge.hh.

Referenced by XrdXrootdTransSend::Send().

◆ rCode

kXR_unt16 XrdXrootd::Bridge::Context::rCode

associated "kXR" request code in host byte order

Definition at line 230 of file XrdXrootdBridge.hh.

◆ 

union { ... } XrdXrootd::Bridge::Context::sID

associated request stream ID

Referenced by Context().


The documentation for this class was generated from the following file: