14 std::string *session_token, uint64_t *current_revision, std::string ¤t_root_hash) {
15 if (buffer.
data.size() == 0 || session_token == NULL) {
27 const std::string status = result->string_value;
31 reply->
root(),
"session_token", JSON_STRING);
34 if(rev!=NULL) { *current_revision = (uint64_t) rev->int_value; }
36 if(hash!=NULL) { current_root_hash = hash->string_value; }
39 *session_token = token->string_value;
42 }
else if (status ==
"path_busy") {
44 reply->
root(),
"time_remaining", JSON_STRING);
45 if (time_remaining != NULL) {
47 time_remaining->string_value);
50 }
else if (status ==
"error") {
65 std::string *session_token) {
66 if (buffer.
data.size() == 0 || session_token == NULL) {
78 const std::string status = result->string_value;
82 reply->
root(),
"session_token", JSON_STRING);
86 *session_token = token->string_value;
89 }
else if (status ==
"path_busy") {
91 reply->
root(),
"time_remaining", JSON_INT);
92 if (time_remaining != NULL) {
94 time_remaining->int_value);
97 }
else if (status ==
"error") {
100 if (reason != NULL) {
114 if (buffer.
data.size() == 0) {
125 if (result != NULL) {
126 const std::string status = result->string_value;
127 if (status ==
"ok") {
130 }
else if (status ==
"invalid_token") {
132 }
else if (status ==
"error") {
135 if (reason != NULL) {
LeaseReply ParseAcquireReplyWithRevision(const CurlBuffer &buffer, std::string *session_token, uint64_t *current_revision, std::string ¤t_root_hash)
static JSON * SearchInObject(const JSON *json_object, const std::string &name, const json_type type)
static JsonDocument * Create(const std::string &text)
static LeaseReply ParseDropReply(const CurlBuffer &buffer, int llvl)
static LeaseReply ParseAcquireReply(const CurlBuffer &buffer, std::string *session_token, int llvl)
const JSON * root() const
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)