Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Do not throw errors when the HTTP client closes the connections without sending a request. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0c4fbdfef0ebdfcb27e6ee29d44ec108 |
User & Date: | drh 2018-01-08 23:19:50.291 |
Context
2018-01-26
| ||
21:26 | Update the built-in SQLite to the 3.22.0 release. (check-in: a700937563 user: drh tags: trunk) | |
2018-01-08
| ||
23:19 | Do not throw errors when the HTTP client closes the connections without sending a request. (check-in: 0c4fbdfef0 user: drh tags: trunk) | |
23:02 | Do not try to translate binary HTTP replies into UTF-8 as is done for text replies. (check-in: c2a8732d7f user: drh tags: trunk) | |
Changes
Changes to wapp.tcl.
︙ | ︙ | |||
335 336 337 338 339 340 341 | dict append W .header \n$line } if {[string length [dict get $W .header]]>100000} { error "HTTP request header too big - possible DOS attack" } } elseif {$n==0} { # We have reached the blank line that terminates the header. | | > > > | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | dict append W .header \n$line } if {[string length [dict get $W .header]]>100000} { error "HTTP request header too big - possible DOS attack" } } elseif {$n==0} { # We have reached the blank line that terminates the header. if {[wappInt-parse-header $chan]} { catch {close $chan} return } set len 0 if {[dict exists $W CONTENT_LENGTH]} { set len [dict get $W CONTENT_LENGTH] } if {$len>0} { # Still need to read the query content dict set W .toread $len |
︙ | ︙ | |||
371 372 373 374 375 376 377 | # # This routine is always running inside of a [catch], so if # any problems arise, simply raise an error. # proc wappInt-parse-header {chan} { upvar #0 wappInt-$chan W set hdr [split [dict get $W .header] \n] | | < < < | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | # # This routine is always running inside of a [catch], so if # any problems arise, simply raise an error. # proc wappInt-parse-header {chan} { upvar #0 wappInt-$chan W set hdr [split [dict get $W .header] \n] if {$hdr==""} {return 1} set req [lindex $hdr 0] dict set W REQUEST_METHOD [set method [lindex $req 0]] if {[lsearch {GET HEAD POST} $method]<0} { error "unsupported request method: \"[dict get $W REQUEST_METHOD]\"" } set uri [lindex $req 1] set split_uri [split $uri ?] |
︙ | ︙ | |||
408 409 410 411 412 413 414 415 416 417 418 419 420 421 | CONTENT-TYPE {set name CONTENT_TYPE} HOST {set name HTTP_HOST} COOKIE {set name HTTP_COOKIE} default {set name .hdr:$name} } dict set W $name $value } } # Invoke application-supplied methods to generate a reply to # a single HTTP request. # # This routine always runs within [catch], so handle exceptions by # invoking [error]. | > | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | CONTENT-TYPE {set name CONTENT_TYPE} HOST {set name HTTP_HOST} COOKIE {set name HTTP_COOKIE} default {set name .hdr:$name} } dict set W $name $value } return 0 } # Invoke application-supplied methods to generate a reply to # a single HTTP request. # # This routine always runs within [catch], so handle exceptions by # invoking [error]. |
︙ | ︙ |