- Added newline after restconf evhtp GET reply

This commit is contained in:
Olof hagsand 2020-08-24 22:29:33 +02:00
parent 3e054fedc3
commit 1a2e074539
4 changed files with 63 additions and 19 deletions

View file

@ -162,17 +162,16 @@ restconf_reply_send(void *req0,
#endif
/* If body, add a content-length header */
if (cb != NULL && cbuf_len(cb))
if (cb != NULL && cbuf_len(cb)){
cprintf(cb, "\r\n");
if (restconf_reply_header(req, "Content-Length", "%d", cbuf_len(cb)) < 0)
goto done;
}
/* create evbuffer* : bufferevent_write_buffer/ drain,
ie send everything , except body */
evhtp_send_reply_start(req, req->status);
/* Write a body if cbuf is nonzero */
if (cb != NULL && cbuf_len(cb)){
/* Suboptimal, copy from cbuf to evbuffer */
if ((eb = evbuffer_new()) == NULL){
clicon_err(OE_CFG, errno, "evbuffer_new");