Modify restconf tests to run for both evhtp and fcgi: , curl -sik, etc

This commit is contained in:
Olof hagsand 2020-06-21 15:49:46 +02:00
parent 126cc209f4
commit 3af184c655
37 changed files with 340 additions and 274 deletions

View file

@ -86,11 +86,11 @@ APPSRC =
APPSRC += restconf_api.c # maybe empty
APPSRC += restconf_api_$(with_restconf).c # cant be .so since libevhtp is a.
APPSRC += restconf_err.c
APPSRC += restconf_root.c
APPSRC += restconf_$(with_restconf)_main.c
APPSRC += restconf_methods.c
APPSRC += restconf_methods_post.c
APPSRC += restconf_methods_get.c
APPSRC += restconf_root.c
APPSRC += restconf_main_$(with_restconf).c
# Fcgi-specific source including main
ifeq ($(with_restconf),fcgi)

View file

@ -138,8 +138,10 @@ restconf_reply_send(void *req0,
req->status = code;
if ((reason_phrase = restconf_code2reason(code)) == NULL)
reason_phrase="";
#if 1 /* XXX remove status header för evhtp? */
if (restconf_reply_header(req, "Status", "%d %s", code, reason_phrase) < 0)
goto done;
#endif
#if 1 /* Optional? */
if ((conn = evhtp_request_get_connection(req)) == NULL){
clicon_err(OE_DAEMON, EFAULT, "evhtp_request_get_connection");