summaryrefslogtreecommitdiff
path: root/src/c/urweb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r--src/c/urweb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index fd056a33..f5f11a2b 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1102,6 +1102,20 @@ int uw_print(uw_context ctx, int fd) {
return uw_really_write(fd, ctx->page.start, ctx->page.front - ctx->page.start);
}
+int uw_output(uw_context ctx, int (*output)(void *data, char *buf, size_t len), void *data) {
+ int n = output(data, ctx->outHeaders.start, ctx->outHeaders.front - ctx->outHeaders.start);
+
+ if (n < 0)
+ return n;
+
+ n = output(data, "\r\n", 2);
+
+ if (n < 0)
+ return n;
+
+ return output(data, ctx->page.start, ctx->page.front - ctx->page.start);
+}
+
static void uw_check_headers(uw_context ctx, size_t extra) {
buf_check(&ctx->outHeaders, extra);
}