Skip to content
Snippets Groups Projects
Commit 638504c0 authored by Michael Davis's avatar Michael Davis
Browse files

[EOS-CTA] Cleans up debugging code

parent 64ff6404
Branches
Tags
No related merge requests found
......@@ -260,30 +260,7 @@ void XrdSsiPbRequestCallback<eos::wfe::Response>::operator()(const eos::wfe::Res
using namespace std;
std::cout << "MetadataCallback():" << std::endl;
eos::wfe::Response test;
test.set_rsp_type(eos::wfe::Response::EXCEPTION_RSP);
test.mutable_exception()->set_code(eos::wfe::Exception::PB_PARSE_ERR);
test.mutable_exception()->set_message("m_request.ParseFromArray() failed");
std::string test_str;
google::protobuf::util::MessageToJsonString(test, &test_str);
std::cerr << test_str << std::endl;
#if 0
switch(metadata.rsp_type())
{
case eos::wfe::Response::EXCEPTION_RSP:
cerr << "EXCEPTION" << endl;
if(metadata.has_exception()) cerr << "has_exception" << endl;
cout << "code = " << metadata.exception().code() << endl;
cout << "message = " << metadata.exception().message() << endl;
break;
case eos::wfe::Response::XATTR_RSP: cerr << "XATTR" << endl; break;
case eos::wfe::Response::TAPEREPLICA_RSP: cerr << "TAPEREPLICA" << endl; break;
default: cerr << "Unknown metadata type" << endl; break;
}
OutputJsonString(&metadata);
#endif
}
......@@ -315,13 +292,6 @@ int exceptionThrowingMain(int argc, const char *const *const argv)
OutputJsonString(&notification);
}
eos::wfe::Response test;
test.set_rsp_type(eos::wfe::Response::EXCEPTION_RSP);
test.mutable_exception()->set_code(eos::wfe::Exception::PB_PARSE_ERR);
test.mutable_exception()->set_message("m_request.ParseFromArray() failed");
OutputJsonString(&test);
XrdSsiPbRequestCallback<eos::wfe::Response> cb;
cb(test);
// Obtain a Service Provider
......@@ -335,14 +305,12 @@ int exceptionThrowingMain(int argc, const char *const *const argv)
cta_service.send(notification);
#if 0
// Wait for the response callback.
// Wait for the response callback.
std::cout << "Request sent, going to sleep..." << std::endl;
std::cout << "Request sent, going to sleep..." << std::endl;
// When test_ssi_service goes out-of-scope, the Service will try to shut down, but will wait
// for outstanding Requests to be processed
// When test_ssi_service goes out-of-scope, the Service will try to shut down, but will wait
// for outstanding Requests to be processed
int wait_secs = 5;
......@@ -352,8 +320,7 @@ int exceptionThrowingMain(int argc, const char *const *const argv)
sleep(1);
}
std::cout << "All done, exiting." << std::endl;
#endif
std::cout << "done, exiting." << std::endl;
// Send output to stdout or stderr?
......@@ -363,8 +330,6 @@ int exceptionThrowingMain(int argc, const char *const *const argv)
// Optional: Delete all global objects allocated by libprotobuf
sleep(5);
google::protobuf::ShutdownProtobufLibrary();
return 0;
......
......@@ -164,9 +164,6 @@ bool XrdSsiPbRequest<RequestType, MetadataType, AlertType>::ProcessResponse(cons
if(metadata_len > 0)
{
std::string dump_buffer(metadata_buffer, metadata_len);
std::cout << "Metadata len is " << metadata_len << std::endl;
DumpBuffer(dump_buffer);
// Deserialize the metadata
MetadataType metadata;
......
......@@ -23,8 +23,6 @@
#include "XrdSsiPbException.h"
#include "XrdSsiPbAlert.h"
#include "../frontend/test_util.h"
//! Error codes that the framework knows about
......@@ -119,7 +117,6 @@ void RequestProc<RequestType, MetadataType, AlertType>::Execute()
if(m_request.ParseFromArray(request_buffer, request_len))
{
#if 0
// Perform the requested action
ExecuteAction();
......@@ -134,7 +131,6 @@ void RequestProc<RequestType, MetadataType, AlertType>::Execute()
}
else
{
#endif
// Return an error to the client
HandleError(PB_PARSE_ERR, "m_request.ParseFromArray() failed");
......@@ -150,23 +146,6 @@ void RequestProc<RequestType, MetadataType, AlertType>::Execute()
{
throw XrdSsiPbException("m_metadata.SerializeToString() failed");
}
std::cout << "Metadata len is " << m_metadata_str.size() << std::endl;
DumpBuffer(m_metadata_str);
int bufsz = m_metadata.ByteSize();
std::cout << "Buf len is " << bufsz << std::endl;
char *buf = new char[bufsz];
m_metadata.SerializeToArray((void*)buf, bufsz);
std::string tmp_str(buf, bufsz);
m_metadata_str = tmp_str;
DumpBuffer(m_metadata_str);
// Parse the string we just serialized
std::cerr << "Parse the serialized string" << std::endl;
MetadataType test;
test.ParseFromString(m_metadata_str);
OutputJsonString(&test);
// Send the Metadata
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment