mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-19 03:06:28 +00:00
Fix meshms restful newsince with empty conversation
This commit is contained in:
parent
95cce9109f
commit
75dfcff213
@ -178,6 +178,13 @@ static int restful_meshms_(httpd_request *r, const char *remainder)
|
|||||||
handler = restful_meshms_messagelist_json;
|
handler = restful_meshms_messagelist_json;
|
||||||
remainder = "";
|
remainder = "";
|
||||||
}
|
}
|
||||||
|
else if (strcmp(remainder, "/newsince/messagelist.json") == 0){
|
||||||
|
handler = restful_meshms_newsince_messagelist_json;
|
||||||
|
remainder = "";
|
||||||
|
r->u.msglist.token.which_ply = MY_PLY;
|
||||||
|
r->u.msglist.token.offset = 0;
|
||||||
|
r->u.msglist.token.their_ack = 0;
|
||||||
|
}
|
||||||
else if ( str_startswith(remainder, "/newsince/", &end)
|
else if ( str_startswith(remainder, "/newsince/", &end)
|
||||||
&& strn_to_meshms_token(end, &r->u.msglist.token, &end)
|
&& strn_to_meshms_token(end, &r->u.msglist.token, &end)
|
||||||
&& strcmp(end, "messagelist.json") == 0
|
&& strcmp(end, "messagelist.json") == 0
|
||||||
|
@ -288,6 +288,24 @@ test_MeshmsListMessagesNoIdentity() {
|
|||||||
assertJqGrep --ignore-case http.body '.meshms_status_message' 'identity.*unknown'
|
assertJqGrep --ignore-case http.body '.meshms_status_message' 'identity.*unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doc_MeshmsEmptyNewSince="HTTP RESTful list MeshMS since token with no messages"
|
||||||
|
setup_MeshmsEmptyNewSince() {
|
||||||
|
IDENTITY_COUNT=2
|
||||||
|
set_extra_config() {
|
||||||
|
executeOk_servald config set api.restful.newsince_timeout 1s
|
||||||
|
}
|
||||||
|
setup
|
||||||
|
}
|
||||||
|
test_MeshmsEmptyNewSince() {
|
||||||
|
executeOk curl \
|
||||||
|
--silent --fail --show-error \
|
||||||
|
--output messagelist.json \
|
||||||
|
--dump-header http.headers \
|
||||||
|
--basic --user harry:potter \
|
||||||
|
"http://$addr_localhost:$PORTA/restful/meshms/$SIDA1/$SIDA2/newsince/messagelist.json"
|
||||||
|
tfw_preserve messagelist.json
|
||||||
|
}
|
||||||
|
|
||||||
doc_MeshmsListMessagesNewSince="HTTP RESTful list MeshMS messages in one conversation since token as JSON"
|
doc_MeshmsListMessagesNewSince="HTTP RESTful list MeshMS messages in one conversation since token as JSON"
|
||||||
setup_MeshmsListMessagesNewSince() {
|
setup_MeshmsListMessagesNewSince() {
|
||||||
IDENTITY_COUNT=2
|
IDENTITY_COUNT=2
|
||||||
|
Loading…
Reference in New Issue
Block a user