comparison src/c/driver.c @ 801:5f49a6b759cb

Fix nasty bugs with longjmp() looping for uw_set_input(); and bad variable indexes for nested JavaScript in jscomp
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 May 2009 18:13:09 -0400
parents 3e5d1c6ae30c
children 19fdeef40ada
comparison
equal deleted inserted replaced
800:e92cfac1608f 801:5f49a6b759cb
401 part += boundary_len; 401 part += boundary_len;
402 402
403 if (filename) { 403 if (filename) {
404 uw_Basis_file f = {filename, type, {part_len, after_sub_headers}}; 404 uw_Basis_file f = {filename, type, {part_len, after_sub_headers}};
405 405
406 uw_set_file_input(ctx, name, f); 406 if (uw_set_file_input(ctx, name, f)) {
407 } else 407 puts(uw_error_message(ctx));
408 uw_set_input(ctx, name, after_sub_headers); 408 goto done;
409 }
410 } else if (uw_set_input(ctx, name, after_sub_headers)) {
411 puts(uw_error_message(ctx));
412 goto done;
413 }
409 } 414 }
410 } 415 }
411 else { 416 else {
412 if (is_post) 417 if (is_post)
413 inputs = after_headers; 418 inputs = after_headers;
424 else 429 else
425 inputs = strchr(name, 0); 430 inputs = strchr(name, 0);
426 431
427 if (value = strchr(name, '=')) { 432 if (value = strchr(name, '=')) {
428 *value++ = 0; 433 *value++ = 0;
429 uw_set_input(ctx, name, value); 434 if (uw_set_input(ctx, name, value)) {
435 puts(uw_error_message(ctx));
436 goto done;
437 }
430 } 438 }
431 else 439 else if (uw_set_input(ctx, name, "")) {
432 uw_set_input(ctx, name, ""); 440 puts(uw_error_message(ctx));
441 goto done;
442 }
433 } 443 }
434 } 444 }
435 } 445 }
436 446
437 printf("Serving URI %s....\n", path); 447 printf("Serving URI %s....\n", path);