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
b8823a0b
Commit
b8823a0b
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[ssi_af_ls] Constructs coded input stream directly from buffer
parent
065e101d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmdline/CtaAdminCmd.cpp
+17
-5
17 additions, 5 deletions
cmdline/CtaAdminCmd.cpp
xroot_ssi_pb/XrdSsiPbServiceClientSide.hpp
+1
-2
1 addition, 2 deletions
xroot_ssi_pb/XrdSsiPbServiceClientSide.hpp
with
18 additions
and
7 deletions
cmdline/CtaAdminCmd.cpp
+
17
−
5
View file @
b8823a0b
...
...
@@ -54,21 +54,33 @@ void RequestCallback<cta::xrd::Alert>::operator()(const cta::xrd::Alert &alert)
template
<
>
void
XrdSsiPbRequestType
::
DataCallback
(
XrdSsiRequest
::
PRD_Xeq
&
post_process
,
char
*
response_bufptr
,
int
response_buflen
)
{
google
::
protobuf
::
io
::
ArrayInputStream
raw_stream
(
response_bufptr
,
response_buflen
);
google
::
protobuf
::
io
::
CodedInputStream
coded_stream
(
&
raw_stream
);
google
::
protobuf
::
io
::
CodedInputStream
coded_stream
(
reinterpret_cast
<
const
uint8_t
*>
(
response_bufptr
),
response_buflen
);
cta
::
admin
::
ArchiveFileLsItem
line_item
;
uint32_t
bytesize
;
int
buf_len
;
do
{
do
{
const
char
*
buf_ptr
;
coded_stream
.
GetDirectBufferPointer
(
reinterpret_cast
<
const
void
**>
(
&
buf_ptr
),
&
buf_len
);
std
::
cout
<<
"buf_len = "
<<
buf_len
<<
std
::
endl
;
if
(
buf_len
<
static_cast
<
int
>
(
sizeof
(
uint32_t
)))
{
throw
std
::
runtime_error
(
"Not enough data to read size of next protobuf"
);
}
coded_stream
.
ReadLittleEndian32
(
&
bytesize
);
std
::
cout
<<
"Bytesize = "
<<
bytesize
<<
std
::
endl
;
const
char
*
buf_ptr
;
coded_stream
.
GetDirectBufferPointer
(
reinterpret_cast
<
const
void
**>
(
&
buf_ptr
),
&
buf_len
);
std
::
cout
<<
"buf_len = "
<<
buf_len
<<
std
::
endl
;
if
(
buf_len
<
static_cast
<
int
>
(
bytesize
))
{
throw
std
::
runtime_error
(
"Not enough data in stream"
);
}
line_item
.
ParseFromArray
(
buf_ptr
,
bytesize
);
coded_stream
.
Skip
(
bytesize
);
...
...
@@ -90,7 +102,7 @@ std::cout << "buf_len = " << buf_len << std::endl;
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
13
)
<<
std
::
right
<<
line_item
.
af
().
creation_time
()
<<
' '
<<
line_item
.
af
().
df
().
path
()
<<
std
::
endl
;
}
while
(
static_cast
<
int
>
(
bytesize
)
!=
buf_len
);
while
(
buf_len
!=
static_cast
<
int
>
(
bytesize
));
}
...
...
This diff is collapsed.
Click to expand it.
xroot_ssi_pb/XrdSsiPbServiceClientSide.hpp
+
1
−
2
View file @
b8823a0b
...
...
@@ -40,11 +40,10 @@ namespace XrdSsiPb {
// Constants
const
unsigned
int
DefaultResponseBufferSize
=
1024
;
//!< Default size for the response buffer in bytes
const
unsigned
int
DefaultResponseBufferSize
=
89
;
//!< Default size for the response buffer in bytes
const
unsigned
int
DefaultRequestTimeout
=
15
;
//!< Default XRootD request timeout in secs
// Better to get the default from XRD_REQUESTTIMEOUT if it is not set explicitly?
// Decide on order of precedence for setting request timeout
// What about setting stream timeout?
...
...
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