try to avoid unnecessary copy
[src/app-framework-binder.git] / src / afb-hreq.h
index 5c09e4e..82e6b65 100644 (file)
  * limitations under the License.
  */
 
-struct AFB_session;
+#pragma once
+
 struct AFB_clientCtx;
 struct json_object;
+struct hreq_data;
+struct afb_hsrv;
 
 struct afb_hreq {
+       struct afb_hsrv *hsrv;
        const char *cacheTimeout;
        struct MHD_Connection *connection;
        int method;
+       int reqid;
+       int scanned;
+       int suspended;
+       int replied;
        const char *version;
        const char *url;
        size_t lenurl;
@@ -65,11 +73,12 @@ extern struct AFB_clientCtx *afb_hreq_context(struct afb_hreq *hreq);
 
 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_static(struct afb_hreq *hreq, unsigned status, size_t size, const char *buffer, ...);
 
-extern void afb_hreq_reply_copy(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, const char *buffer, ...);
 
 extern void afb_hreq_reply_free(struct afb_hreq *hreq, unsigned status, size_t size, char *buffer, ...);
 
 extern void afb_hreq_reply_empty(struct afb_hreq *hreq, unsigned status, ...);
 
+extern int afb_hreq_init_download_path(const char *directory);