Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
ae3a0a79
Commit
ae3a0a79
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
Fixes XrdSsi receive metadata
parent
54dd8cad
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/TestSsiRequest.cpp
+9
-22
9 additions, 22 deletions
frontend/TestSsiRequest.cpp
frontend/TestSsiRequest.h
+13
-16
13 additions, 16 deletions
frontend/TestSsiRequest.h
frontend/TestSsiRequestProc.cpp
+1
-0
1 addition, 0 deletions
frontend/TestSsiRequestProc.cpp
with
23 additions
and
38 deletions
frontend/TestSsiRequest.cpp
+
9
−
22
View file @
ae3a0a79
...
...
@@ -10,14 +10,6 @@ bool TestSsiRequest::ProcessResponse(const XrdSsiErrInfo &eInfo, const XrdSsiRes
cerr
<<
"ProcessResponse() callback called with response type = "
<<
rInfo
.
State
()
<<
endl
;
// Resume handling callbacks if they were on hold
if
(
!
queue_on_hold
)
{
cerr
<<
"resuming..."
;
this
->
RestartDataResponse
(
XrdSsiRequest
::
RDR_All
);
}
if
(
eInfo
.
hasError
())
{
// Handle error using the passed eInfo object
...
...
@@ -42,19 +34,22 @@ bool TestSsiRequest::ProcessResponse(const XrdSsiErrInfo &eInfo, const XrdSsiRes
GetMetadata
(
myMetadataLen
);
if
(
rInfo
.
rType
==
XrdSsiRespInfo
::
isData
&&
myMetadataLen
==
0
)
if
(
rInfo
.
rType
==
XrdSsiRespInfo
::
isData
&&
myMetadataLen
>
0
)
{
cerr
<<
"Response
is metadata only
."
<<
endl
;
cerr
<<
"Response
has "
<<
myMetadataLen
<<
" bytes of metadata
."
<<
endl
;
// do something with metadata
#if 0
// clean up
Finished();
delete this;
#endif
}
else
if
(
rInfo
.
rType
==
XrdSsiRespInfo
::
isHandle
)
if
(
rInfo
.
rType
==
XrdSsiRespInfo
::
isHandle
)
{
cerr
<<
"Response is detached, handle = "
<<
endl
;
...
...
@@ -66,7 +61,8 @@ bool TestSsiRequest::ProcessResponse(const XrdSsiErrInfo &eInfo, const XrdSsiRes
delete
this
;
}
else
if
(
rInfo
.
rType
==
XrdSsiRespInfo
::
isData
)
{
// A proper data response type
...
...
@@ -85,16 +81,7 @@ XrdSsiRequest::PRD_Xeq TestSsiRequest::ProcessResponseData(const XrdSsiErrInfo &
{
using
namespace
std
;
// Simulate the scenario where we can't handle the queue at this time
queue_on_hold
=
false
;
if
(
queue_on_hold
)
{
cerr
<<
"Response queue is on hold..."
;
queue_on_hold
=
false
;
return
XrdSsiRequest
::
PRD_Hold
;
}
// If we can't handle the queue at this time, return XrdSsiRequest::PRD_Hold;
// GetResponseData() above places the data in the allocated buffer, then calls this method with
// the buffer type and length
...
...
This diff is collapsed.
Click to expand it.
frontend/TestSsiRequest.h
+
13
−
16
View file @
ae3a0a79
...
...
@@ -7,6 +7,16 @@ class TestSsiRequest : public XrdSsiRequest
{
public:
TestSsiRequest
(
const
std
::
string
&
buffer_str
,
uint16_t
tmo
=
0
)
:
request_buffer
(
buffer_str
.
c_str
()),
request_len
(
buffer_str
.
length
())
{
std
::
cerr
<<
"Creating TestSsiRequest object, setting tmo="
<<
tmo
<<
std
::
endl
;
this
->
SetTimeOut
(
tmo
);
}
virtual
~
TestSsiRequest
()
{
std
::
cerr
<<
"Deleting TestSsiRequest object"
<<
std
::
endl
;
}
// It is up to the implementation to create request data, save it in some manner, and provide it to
// the framework when GetRequest() is called. Optionally define the RelRequestBuffer() method to
// clean up when the framework no longer needs access to the data.
...
...
@@ -15,7 +25,7 @@ public:
// Query for Andy: shouldn't the return type for GetRequest be const?
virtual
char
*
GetRequest
(
int
&
d
len
)
override
{
d
len
=
req
BL
en
;
return
const_cast
<
char
*>
(
req
B
uff
);}
virtual
char
*
GetRequest
(
int
&
req
len
)
override
{
req
len
=
req
uest_l
en
;
return
const_cast
<
char
*>
(
req
uest_b
uff
er
);
}
// Requests are sent to the server asynchronously via the service object. The ProcessResponse() callback
// is used to inform the request object if the request completed or failed.
...
...
@@ -33,23 +43,10 @@ public:
virtual
void
Alert
(
XrdSsiRespInfoMsg
&
aMsg
)
override
;
// Constructor/Destructor
TestSsiRequest
(
const
std
::
string
&
buffer_str
,
uint16_t
tmo
=
0
)
:
reqBuff
(
buffer_str
.
c_str
()),
reqBLen
(
buffer_str
.
length
()),
queue_on_hold
(
true
)
{
std
::
cerr
<<
"Creating TestSsiRequest object, setting tmo="
<<
tmo
<<
std
::
endl
;
this
->
SetTimeOut
(
tmo
);
}
virtual
~
TestSsiRequest
()
{
std
::
cerr
<<
"Deleting TestSsiRequest object"
<<
std
::
endl
;
}
private
:
const
char
*
reqBuff
;
int
reqBLen
;
bool
queue_on_hold
;
const
char
*
request_buffer
;
int
request_len
;
};
#endif
This diff is collapsed.
Click to expand it.
frontend/TestSsiRequestProc.cpp
+
1
−
0
View file @
ae3a0a79
...
...
@@ -30,6 +30,7 @@ void RequestProc<xrdssi::test::Request, xrdssi::test::Result>::ExecuteAction()
template
<
>
void
RequestProc
<
xrdssi
::
test
::
Request
,
xrdssi
::
test
::
Result
>::
ExecuteMetadata
()
{
std
::
cerr
<<
"Sending metadata..."
<<
std
::
endl
;
const
std
::
string
metadata
(
"Have some metadata!"
);
SetMetadata
(
metadata
.
c_str
(),
metadata
.
size
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment