aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/slweb/handler.h2
-rw-r--r--include/slweb/http.h9
-rw-r--r--include/slweb/server.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/include/slweb/handler.h b/include/slweb/handler.h
index 4ac7f76..ca221aa 100644
--- a/include/slweb/handler.h
+++ b/include/slweb/handler.h
@@ -5,7 +5,7 @@
#include <stddef.h>
typedef int (*handler_fn)(const struct http_payload *p,
- struct http_response *r, void *user);
+ struct http_response *r, struct http_future *f, void *user);
struct handler_cfg
{
diff --git a/include/slweb/http.h b/include/slweb/http.h
index ac1f51a..8ff1920 100644
--- a/include/slweb/http.h
+++ b/include/slweb/http.h
@@ -81,12 +81,19 @@ struct http_response
void (*free)(void *);
};
+struct http_future
+{
+ void *(*f)(void *);
+ void *user;
+};
+
struct http_cfg
{
int (*read)(void *buf , size_t n, void *user);
int (*write)(const void *buf, size_t n, void *user);
int (*payload)(const struct http_payload *p, struct http_response *r,
- void *user);
+ struct http_future *f, void *user);
+ int (*async)(const struct http_future *f, void *user);
int (*length)(unsigned long long len, const struct http_cookie *c,
struct http_response *r, void *user);
const char *tmpdir;
diff --git a/include/slweb/server.h b/include/slweb/server.h
index 74f06ae..fa7db01 100644
--- a/include/slweb/server.h
+++ b/include/slweb/server.h
@@ -11,5 +11,6 @@ int server_write(const void *buf, size_t n, struct server_client *c);
int server_close(struct server *s);
int server_client_close(struct server *s, struct server_client *c);
void server_client_write_pending(struct server_client *c, bool write);
+int server_async(struct server *s, int (*f)(void *), void *user);
#endif /* SERVER_H */