diff options
author | 2009-06-27 14:44:00 -0400 | |
---|---|---|
committer | 2009-06-27 14:44:00 -0400 | |
commit | 688973e51e94d2c24185f0899227dfe7dd3dd93b (patch) | |
tree | 29f02cb11e27dc4394b44909fbaf79bda111f322 /src/c/urweb.c | |
parent | 74103b6a0ede67d270bb6850ae12578df62032fd (diff) |
Serving Hello via FastCGI
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r-- | src/c/urweb.c | 14 |
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); } |