Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix to [80f25418a1c32b8d] so that it works as CGI again. Also omit a parameter to wappInt-handle-request that is no longer used. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
44f07d88044facb064644c692f1a2beb |
User & Date: | drh 2019-07-31 14:30:10.354 |
Context
2019-08-01
| ||
16:46 | Load all environment variables that start with an upper-case ASCII letter as wapp-param values in CGI mode, rather than only loading selected variables. (check-in: 68331516e9 user: drh tags: trunk) | |
2019-07-31
| ||
14:30 | Fix to [80f25418a1c32b8d] so that it works as CGI again. Also omit a parameter to wappInt-handle-request that is no longer used. (check-in: 44f07d8804 user: drh tags: trunk) | |
14:24 | If the $argv0 variable is not set, use "/" for SCRIPT_FILENAME and DOCUMENT_ROOT. Ticket [1d0112d75bfbffc8]. (check-in: d52654e48f user: drh tags: trunk) | |
Changes
Changes to wapp.tcl.
︙ | ︙ | |||
493 494 495 496 497 498 499 | } if {$len>0} { # Still need to read the query content dict set W .toread $len } else { # There is no query content, so handle the request immediately set wapp $W | | | | 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | } if {$len>0} { # Still need to read the query content dict set W .toread $len } else { # There is no query content, so handle the request immediately set wapp $W wappInt-handle-request $chan } } } else { # If .toread is set, that means we are reading the query content. # Continue reading until .toread reaches zero. set got [read $chan [dict get $W .toread]] dict append W CONTENT $got dict set W .toread [expr {[dict get $W .toread]-[string length $got]}] if {[dict get $W .toread]<=0} { # Handle the request as soon as all the query content is received set wapp $W wappInt-handle-request $chan } } } # Decode the HTTP request header. # # This routine is always running inside of a [catch], so if |
︙ | ︙ | |||
622 623 624 625 626 627 628 | # instance finishes. Yes, this means that WAPP IS SINGLE THREADED. Only # a single page rendering instance my be running at a time. There can # be multiple HTTP requests inbound at once, but only one my be processed # at a time once the request is full read and parsed. # set wappIntPending {} set wappIntLock 0 | | | | | | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | # instance finishes. Yes, this means that WAPP IS SINGLE THREADED. Only # a single page rendering instance my be running at a time. There can # be multiple HTTP requests inbound at once, but only one my be processed # at a time once the request is full read and parsed. # set wappIntPending {} set wappIntLock 0 proc wappInt-handle-request {chan} { global wappIntPending wappIntLock fileevent $chan readable {} if {$wappIntLock} { # Another instance of request is already running, so defer this one lappend wappIntPending [list wappInt-handle-request $chan] return } set wappIntLock 1 catch [list wappInt-handle-request-unsafe $chan] set wappIntLock 0 if {[llength $wappIntPending]>0} { # If there are deferred requests, then launch the oldest one after idle [lindex $wappIntPending 0] set wappIntPending [lrange $wappIntPending 1 end] } } proc wappInt-handle-request-unsafe {chan} { global wapp dict set wapp .reply {} dict set wapp .mimetype {text/html; charset=utf-8} dict set wapp .reply-code {200 Ok} dict set wapp .csp {default-src 'self'} # Set up additional CGI environment values |
︙ | ︙ | |||
831 832 833 834 835 836 837 | } if {$len>0} { fconfigure stdin -translation binary dict set wapp CONTENT [read stdin $len] } dict set wapp WAPP_MODE cgi fconfigure stdout -translation binary | | | 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | } if {$len>0} { fconfigure stdin -translation binary dict set wapp CONTENT [read stdin $len] } dict set wapp WAPP_MODE cgi fconfigure stdout -translation binary wappInt-handle-request-unsafe stdout } # Process new text received on an inbound SCGI request # proc wappInt-scgi-readable {chan} { if {[catch [list wappInt-scgi-readable-unsafe $chan] msg]} { puts stderr "$msg\n$::errorInfo" |
︙ | ︙ | |||
872 873 874 875 876 877 878 | if {$len>0} { # Still need to read the query content dict set W .toread $len } else { # There is no query content, so handle the request immediately dict set W SERVER_ADDR [dict get $W .remove_addr] set wapp $W | | | | 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | if {$len>0} { # Still need to read the query content dict set W .toread $len } else { # There is no query content, so handle the request immediately dict set W SERVER_ADDR [dict get $W .remove_addr] set wapp $W wappInt-handle-request $chan } } else { # If .toread is set, that means we are reading the query content. # Continue reading until .toread reaches zero. set got [read $chan [dict get $W .toread]] dict append W CONTENT $got dict set W .toread [expr {[dict get $W .toread]-[string length $got]}] if {[dict get $W .toread]<=0} { # Handle the request as soon as all the query content is received dict set W SERVER_ADDR [dict get $W .remove_addr] set wapp $W wappInt-handle-request $chan } } } # Start up the wapp framework. Parameters are a list passed as the # single argument. # |
︙ | ︙ |