diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-16 12:50:32 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-16 12:50:32 +0300 |
commit | d544a5a6d05a0fb3494ba063ea685b740825aa86 (patch) | |
tree | b5f4a8e412a15aa6907e889a55ef735fb6c633f3 /bbot/manifest.cxx | |
parent | ea5ab626990bd02001fe527359efbecd6e5a7dc0 (diff) |
Add supoort for task response result url value
Diffstat (limited to 'bbot/manifest.cxx')
-rw-r--r-- | bbot/manifest.cxx | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/bbot/manifest.cxx b/bbot/manifest.cxx index 35e472c..b183596 100644 --- a/bbot/manifest.cxx +++ b/bbot/manifest.cxx @@ -538,6 +538,16 @@ namespace bbot challenge = move (v); } + else if (n == "result-url") + { + if (result_url) + bad_name ("task response result url redefinition"); + + if (v.empty ()) + bad_value ("empty task response result url"); + + result_url = move (v); + } else if (!iu) bad_name ("unknown name '" + n + "' in task response manifest"); } @@ -550,16 +560,25 @@ namespace bbot session = move (*sess); - // If session is not empty then the challenge must present, otherwise it - // shouldn't. + // If session is not empty then the challenge and the result url must + // present, otherwise they shouldn't. // if (!session.empty ()) { if (!challenge) bad_value ("no task response challenge specified"); + + if (!result_url) + bad_value ("no task response result url specified"); + } + else + { + if (challenge) + bad_value ("unexpected task response challenge"); + + if (result_url) + bad_value ("unexpected task response result url"); } - else if (challenge) - bad_value ("unexpected task response challenge"); // If session is not empty then the task manifest must follow, otherwise it // shouldn't. @@ -595,6 +614,9 @@ namespace bbot if (challenge) s.next ("challenge", *challenge); + if (result_url) + s.next ("result-url", *result_url); + s.next ("", ""); // End of manifest. if (task) |