oc_collection: error code on batch request
This change makes it so that any success status of a batch update
response over one or more linked resources overrides failure codes
from any other linked resources.
@@ -415,7 +415,9 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
if (method_not_found ||
response_buffer.code >=
oc_status_code(OC_STATUS_BAD_REQUEST)) {
+ if (code == 0) {
code = response_buffer.code;
+ }
memcpy(&links_array, &prev_link, sizeof(CborEncoder));
goto next;
} else {
