diff options
author | deva <deva> | 2008-10-10 10:21:20 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-10 10:21:20 +0000 |
commit | a703bf6f8dd6cd5a75202266f769e3ef2e42bcb2 (patch) | |
tree | 120486db55ca92bc9f2c5dd43412c7d7add5487b /server/src/server.cc | |
parent | 9b697d2d3e34962385cd85a14d4cb14d5b1763ce (diff) |
Made resume a standalone tag istead of an attribute of the macro tag.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/server/src/server.cc b/server/src/server.cc index 92afbd0..2f2ee69 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -94,16 +94,20 @@ static std::string handleTransaction(Transaction *transaction, db->commit(transaction->user, transaction->cpr, *macro, commit.fields); - std::string resume = resume_parser(macro->attributes["resume"].c_str(), commit); - - // if(resume != "") { + std::string resume = resume_parser(macro->resume.attributes["format"].c_str(), commit); + + bool store_in_journal = + macro->resume.attributes.find("store_in_journal") != macro->resume.attributes.end() && + macro->resume.attributes["store_in_journal"] == "true"; + + if(resume != "" && store_in_journal) { journal_commit(transaction->cpr.c_str(), transaction->user.c_str(), Conf::journal_commit_addr.c_str(), Conf::journal_commit_port, resume.c_str(), resume.length()); - - db->putJournal(transaction->user, transaction->cpr, - *macro, resume, time(NULL)); - // } + } + + db->putResume(transaction->user, transaction->cpr, + *macro, resume, time(NULL), store_in_journal); i++; } @@ -205,7 +209,7 @@ static std::string handleTransaction(Transaction *transaction, if(completed) { answer += " <resume>"; answer += db->getResume(transaction->cpr, macro.attributes["name"], time(NULL) - Conf::db_max_ttl); - answer += " </resume>\n"; + answer += "</resume>\n"; } answer += " </macro>\n"; |