* Fixed: HTTP/1 multiple write requests in single session appended data between writes, eg PUT+PUT.

This commit is contained in:
Olof hagsand 2022-03-28 22:55:43 +02:00
parent 3d59077894
commit 9690e0d8f2
4 changed files with 8 additions and 0 deletions

View file

@ -73,6 +73,7 @@ c * This means that two variants are supported:
### Corrected Bugs
* Fixed: HTTP/1 multiple write requests in single session appended data between writes, eg PUT+PUT.
* Fixed: [Broken pipe error seen in client (cli) when backend restarts and CLICON_SOCK is recreated](https://github.com/clicon/clixon/issues/312)
* Fixed: [Xpath API do not support filter data by wildcard](https://github.com/clicon/clixon/issues/313)
* Fixed: SEGV in cli show yang

View file

@ -706,6 +706,7 @@ restconf_http1(restconf_conn *rc,
cvec_reset(sd->sd_outp_hdrs); /* Can be done in native_send_reply */
cbuf_reset(sd->sd_outp_buf);
cbuf_reset(sd->sd_inbuf);
cbuf_reset(sd->sd_indata);
if (rc->rc_exit){ /* Server-initiated exit */
SSL_free(rc->rc_ssl);
rc->rc_ssl = NULL;

View file

@ -329,6 +329,9 @@ expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml
new "Add OK entry"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml" $RCPROTO://localhost/restconf/data -d '<table xmlns="urn:example:clixon"><parameter><name>1</name></parameter></table>')" 0 "HTTP/$HVER 201"
new "Multiple requests: POST + POST" # XXX Do for HTTP/1 ALSO
expectpart "$(curl $CURLOPTS -H "Content-Type: application/yang-data+json" -X POST $RCPROTO://localhost/restconf/data/example:table -d '{"example:parameter":{"name":"local1","value":"nisse"}}' --next $CURLOPTS -H "Content-Type: application/yang-data+json" -X POST $RCPROTO://localhost/restconf/data/example:table -d '{"example:parameter":{"name":"local2","value":"laban"}}')" 0 "HTTP/$HVER 201" "localhost/restconf/data/example:table/parameter=local1" "localhost/restconf/data/example:table/parameter=local2"
if [ $RC -ne 0 ]; then
new "Kill restconf daemon"
stop_restconf

View file

@ -208,6 +208,9 @@ expectpart "$(curl $CURLOPTS -X DELETE $RCPROTO://localhost/restconf/data)" 0 "H
new "Multiple requests: GET + POST using --next"
expectpart "$(curl $CURLOPTS -H "Accept: application/yang-data+xml" -X GET $RCPROTO://localhost/restconf/data?content=config --next $CURLOPTS -H "Content-Type: application/yang-data+json" -X POST $RCPROTO://localhost/restconf/data -d '{"example:cont1":{"interface":{"name":"local0","type":"regular"}}}')" 0 "HTTP/$HVER 200" '<data/>' "HTTP/$HVER 201"
new "Multiple requests: POST + POST" # XXX Do for HTTP/1 ALSO
expectpart "$(curl $CURLOPTS -H "Content-Type: application/yang-data+json" -X POST $RCPROTO://localhost/restconf/data/example:cont1 -d '{"example:interface":{"name":"local1","type":"regular"}}' --next $CURLOPTS -H "Content-Type: application/yang-data+json" -X POST $RCPROTO://localhost/restconf/data/example:cont1 -d '{"example:interface":{"name":"local2","type":"regular"}}')" 0 "HTTP/$HVER 201" "localhost/restconf/data/example:cont1/interface=local1" "localhost/restconf/data/example:cont1/interface=local2"
#--------------- json type tests
new "restconf POST type x3 POST"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" -d '{"example:types":{"tint":42,"tdec64":"42.123","tbool":false,"tstr":"str"}}' $RCPROTO://localhost/restconf/data)" 0 "HTTP/$HVER 201" "Location: $RCPROTO://localhost/restconf/data/example:types"