xrootd
Loading...
Searching...
No Matches
XrdSsiResponder.hh
Go to the documentation of this file.
1#ifndef __XRDSSIRESPONDER_HH__
2#define __XRDSSIRESPONDER_HH__
3/******************************************************************************/
4/* */
5/* X r d S s i R e s p o n d e r . h h */
6/* */
7/* (c) 2013 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* Produced by Andrew Hanushevsky for Stanford University under contract */
9/* DE-AC02-76-SFO0515 with the Department of Energy */
10/* */
11/* This file is part of the XRootD software suite. */
12/* */
13/* XRootD is free software: you can redistribute it and/or modify it under */
14/* the terms of the GNU Lesser General Public License as published by the */
15/* Free Software Foundation, either version 3 of the License, or (at your */
16/* option) any later version. */
17/* */
18/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21/* License for more details. */
22/* */
23/* You should have received a copy of the GNU Lesser General Public License */
24/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26/* */
27/* The copyright holder's institutional names and contributor's names may not */
28/* be used to endorse or promote products derived from this software without */
29/* specific prior written permission of the institution or contributor. */
30/******************************************************************************/
31
32#include <cstdlib>
33#include <cstring>
34
36
37//-----------------------------------------------------------------------------
64//-----------------------------------------------------------------------------
65
66class XrdSsiStream;
67
69{
70public:
71friend class XrdSsiRequest;
72friend class XrdSsiRRAgent;
73
74//-----------------------------------------------------------------------------
79//-----------------------------------------------------------------------------
80
81static const int MaxDirectXfr = 2097152; //< Max (metadata+data) direct xfr
82
83//-----------------------------------------------------------------------------
89//-----------------------------------------------------------------------------
90
92
93//-----------------------------------------------------------------------------
101//-----------------------------------------------------------------------------
102
104
105protected:
106
107//-----------------------------------------------------------------------------
114//-----------------------------------------------------------------------------
115
117
118//-----------------------------------------------------------------------------
130//-----------------------------------------------------------------------------
131
132virtual void Finished( XrdSsiRequest &rqstR,
133 const XrdSsiRespInfo &rInfo,
134 bool cancel=false) = 0;
135
136//-----------------------------------------------------------------------------
145//-----------------------------------------------------------------------------
146
147 char *GetRequest(int &dlen);
148
149//-----------------------------------------------------------------------------
153//-----------------------------------------------------------------------------
154
156
157//-----------------------------------------------------------------------------
160//-----------------------------------------------------------------------------
161
168
169//-----------------------------------------------------------------------------
178//-----------------------------------------------------------------------------
179
180static const int MaxMetaDataSZ = 2097152;
181
182 Status SetMetadata(const char *buff, int blen);
183
184//-----------------------------------------------------------------------------
192//-----------------------------------------------------------------------------
193
194 Status SetErrResponse(const char *eMsg, int eNum);
195
196//-----------------------------------------------------------------------------
200//-----------------------------------------------------------------------------
201
202inline Status SetNilResponse() {return SetResponse((const char *)0,0);}
203
204//-----------------------------------------------------------------------------
212//-----------------------------------------------------------------------------
213
214 Status SetResponse(const char *buff, int blen);
215
216//-----------------------------------------------------------------------------
223//-----------------------------------------------------------------------------
224
225 Status SetResponse(long long fsize, int fdnum);
226
227//-----------------------------------------------------------------------------
234//-----------------------------------------------------------------------------
235
237
238//-----------------------------------------------------------------------------
241//-----------------------------------------------------------------------------
242
244
245//-----------------------------------------------------------------------------
248//-----------------------------------------------------------------------------
249
250protected:
251
253
254private:
255
256// The spMutex protects the reqP pointer. It is a hiearchical mutex in that it
257// may be obtained prior to obtaining the mutex protecting the request without
258// fear of a deadlock (the reverse is not possible). If reqP is zero then
259// this responder is not bound to a request.
260//
263long long rsvd1; // Reserved fields for extensions with ABI compliance
264long long rsvd2;
265long long rsvd3;
266};
267#endif
Definition XrdSsiAtomics.hh:110
Definition XrdSsiRRAgent.hh:38
Definition XrdSsiRequest.hh:71
Definition XrdSsiRespInfo.hh:87
Definition XrdSsiResponder.hh:69
long long rsvd3
Definition XrdSsiResponder.hh:265
Status SetMetadata(const char *buff, int blen)
Status SetResponse(long long fsize, int fdnum)
Status SetNilResponse()
Definition XrdSsiResponder.hh:202
char * GetRequest(int &dlen)
static const int MaxDirectXfr
Definition XrdSsiResponder.hh:81
bool UnBindRequest()
void BindRequest(XrdSsiRequest &rqstR)
Status SetResponse(XrdSsiStream *strmP)
long long rsvd1
Definition XrdSsiResponder.hh:263
long long rsvd2
Definition XrdSsiResponder.hh:264
XrdSsiRequest * reqP
Definition XrdSsiResponder.hh:262
void ReleaseRequestBuffer()
Status
Definition XrdSsiResponder.hh:162
@ notActive
Failure: Request is no longer active.
Definition XrdSsiResponder.hh:166
@ notPosted
Definition XrdSsiResponder.hh:163
@ wasPosted
Success: The response was successfully posted.
Definition XrdSsiResponder.hh:162
XrdSsiMutex spMutex
Definition XrdSsiResponder.hh:261
Status SetErrResponse(const char *eMsg, int eNum)
virtual void Finished(XrdSsiRequest &rqstR, const XrdSsiRespInfo &rInfo, bool cancel=false)=0
Status SetResponse(const char *buff, int blen)
static const int MaxMetaDataSZ
2MB metadata limit
Definition XrdSsiResponder.hh:180
void Alert(XrdSsiRespInfoMsg &aMsg)
virtual ~XrdSsiResponder()
Definition XrdSsiStream.hh:54
Definition XrdSsiRespInfo.hh:44