comparison src/c/urweb.c @ 860:a738002d5b4d

Serving Hello via FastCGI
author Adam Chlipala <adamc@hcoop.net>
date Sat, 27 Jun 2009 14:44:00 -0400
parents 86ec89baee01
children 305bc0a431de
comparison
equal deleted inserted replaced
859:60240acd15b9 860:a738002d5b4d
1100 return n; 1100 return n;
1101 1101
1102 return uw_really_write(fd, ctx->page.start, ctx->page.front - ctx->page.start); 1102 return uw_really_write(fd, ctx->page.start, ctx->page.front - ctx->page.start);
1103 } 1103 }
1104 1104
1105 int uw_output(uw_context ctx, int (*output)(void *data, char *buf, size_t len), void *data) {
1106 int n = output(data, ctx->outHeaders.start, ctx->outHeaders.front - ctx->outHeaders.start);
1107
1108 if (n < 0)
1109 return n;
1110
1111 n = output(data, "\r\n", 2);
1112
1113 if (n < 0)
1114 return n;
1115
1116 return output(data, ctx->page.start, ctx->page.front - ctx->page.start);
1117 }
1118
1105 static void uw_check_headers(uw_context ctx, size_t extra) { 1119 static void uw_check_headers(uw_context ctx, size_t extra) {
1106 buf_check(&ctx->outHeaders, extra); 1120 buf_check(&ctx->outHeaders, extra);
1107 } 1121 }
1108 1122
1109 void uw_write_header(uw_context ctx, uw_Basis_string s) { 1123 void uw_write_header(uw_context ctx, uw_Basis_string s) {