X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.h;h=f717cc8dee8f54fd3ce06f664243c52fce7f845e;hb=abbe8f79355cc7aa2ef906c626c1a43ea4762d88;hp=8fbc56347708fa11472c50454799ce1d0a9b3814;hpb=94014f46d4751492133f65b12f1dea1cfa36d021;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.h b/src/afb-hreq.h index 8fbc5634..f717cc8d 100644 --- a/src/afb-hreq.h +++ b/src/afb-hreq.h @@ -15,8 +15,10 @@ * limitations under the License. */ -struct AFB_session; +#pragma once + struct AFB_clientCtx; +struct json_object; struct afb_hreq { const char *cacheTimeout; @@ -30,6 +32,7 @@ struct afb_hreq { struct MHD_PostProcessor *postform; struct AFB_clientCtx *context; struct hreq_data *data; + struct json_object *json; int upgrade; }; @@ -61,9 +64,14 @@ extern struct afb_req afb_hreq_to_req(struct afb_hreq *hreq); extern struct AFB_clientCtx *afb_hreq_context(struct afb_hreq *hreq); -extern int afb_hreq_one_page_api_redirect(struct afb_hreq *hreq, void *data); +extern int afb_hreq_init_cookie(int port, const char *path, int maxage); + +extern void afb_hreq_reply_static(struct afb_hreq *hreq, unsigned status, size_t size, char *buffer, ...); + +extern void afb_hreq_reply_copy(struct afb_hreq *hreq, unsigned status, size_t size, char *buffer, ...); -extern int afb_hreq_websocket_switch(struct afb_hreq *hreq, void *data); +extern void afb_hreq_reply_free(struct afb_hreq *hreq, unsigned status, size_t size, char *buffer, ...); -extern int afb_hreq_rest_api(struct afb_hreq *hreq, void *data); +extern void afb_hreq_reply_empty(struct afb_hreq *hreq, unsigned status, ...); +extern int afb_hreq_init_download_path(const char *directory);