comparison src/c/driver.c @ 741:f7e2026dd5ae

Returning a blob as page result
author Adam Chlipala <adamc@hcoop.net>
date Sun, 26 Apr 2009 09:02:17 -0400
parents b302b6e35f93
children 43553c93dd8c
comparison
equal deleted inserted replaced
740:b302b6e35f93 741:f7e2026dd5ae
192 back += r; 192 back += r;
193 *back = 0; 193 *back = 0;
194 194
195 if (s = strstr(buf, "\r\n\r\n")) { 195 if (s = strstr(buf, "\r\n\r\n")) {
196 failure_kind fk; 196 failure_kind fk;
197 int is_post = 0; 197 int is_post = 0, do_normal_send = 1;
198 char *boundary = NULL; 198 char *boundary = NULL;
199 size_t boundary_len; 199 size_t boundary_len;
200 char *cmd, *path, *headers, path_copy[uw_bufsize+1], *inputs, *after_headers; 200 char *cmd, *path, *headers, path_copy[uw_bufsize+1], *inputs, *after_headers;
201 201
202 //printf("All: %s\n", buf); 202 //printf("All: %s\n", buf);
431 while (1) { 431 while (1) {
432 uw_write_header(ctx, "HTTP/1.1 200 OK\r\n"); 432 uw_write_header(ctx, "HTTP/1.1 200 OK\r\n");
433 433
434 strcpy(path_copy, path); 434 strcpy(path_copy, path);
435 fk = uw_begin(ctx, path_copy); 435 fk = uw_begin(ctx, path_copy);
436 if (fk == SUCCESS) { 436 if (fk == SUCCESS || fk == RETURN_BLOB) {
437 uw_commit(ctx); 437 uw_commit(ctx);
438 break; 438 break;
439 } else if (fk == BOUNDED_RETRY) { 439 } else if (fk == BOUNDED_RETRY) {
440 if (retries_left) { 440 if (retries_left) {
441 printf("Error triggers bounded retry: %s\n", uw_error_message(ctx)); 441 printf("Error triggers bounded retry: %s\n", uw_error_message(ctx));