Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch aku-the-big-httpd-testsuite-cleanup Excluding Merge-Ins
This is equivalent to a diff from 6ae00eec07 to 367088a3b3
2019-06-05
| ||
05:02 | Integrated testsuite fixups Merged latest work from trunk Regenerated documentation. - Fixed outdated references to feedback.inc Use `modules/common-text/feedback.inc` now. check-in: e3ae2af3f4 user: aku tags: hypnotoad | |
2019-06-04
| ||
20:08 | Added demonstrations of passing configuration parameters and seeing the data reflected in behavior in httpd Closed-Leaf check-in: 367088a3b3 user: hypnotoad tags: aku-the-big-httpd-testsuite-cleanup | |
19:50 | Removing hardcoded path, and registering the paths in the appropriate manner in the httpd tests check-in: 357caec02f user: hypnotoad tags: aku-the-big-httpd-testsuite-cleanup | |
07:34 | Starting to investigate the issue with `scgi-client-0006` I was unable to help myself and started a cleanup of the tests first. - Fixed up indentation all over the place. - Moved all the various expected replies (404, 200, 500) into constructor procedures. This not only made the individual tests clearer, but also easier to properly indent. - Removed the custom `httpd::test::compare` (HTC). Switched to regular tcltest glob matching, plus string map for basic templating of some expected results (200... variants). - The thing with the `norm-eol` I had to add (*) makes me suspect that HTC hid a possible bug in the proxy coding around the handling of line endings. (Of course, my norm-eol now works around the same thing, if in a different manner). (Ad *) See marker `AKU` in the code. - Moved the cgi helper application into an `assets` directory. No need for dynamic creation and deletion. Just tweak the `path` it is looked for. With all this I can now easy see that `scgi-client-0006` returns a 500 server error to us, instead of the expected file. check-in: 91d4900a3d user: aku tags: aku-the-big-httpd-testsuite-cleanup | |
2019-06-03
| ||
23:44 | Update to clay, practcl, and httpd brought over from the clay project. clay - fixes a typo in the ensemble generator - Removed a call to cron::object_destroy (we don't always run with cron) - Added a tool-like event manager - Removed where the amalgamater was adding dictargs twice - Added a "short" uuid for local projects httpd - updates to clay - Test fixes - Remove CSS templating from the vanilla httpd - Some behind the scenes tweaks to accomodate the cuneiform module when httpd is used in external packages practcl - updates to clay - Static packages are now advertised in the tclpreinitscript, eliminating the need for the master process to throw a bootstrap to new threads check-in: 6ae00eec07 user: hypnotoad tags: hypnotoad | |
2019-05-30
| ||
18:22 | Updated clay to mirror the latest version on http://fossil.etoyoc.com/fossil/clay (0.8) * Adds support for short UUIDs * Adds support for the embedded md5 generator in odielibc * Integrates dictargs into the clay syntax Update practcl * Embedded clay version is now 0.8 * Fixes a bug in installModule for an empty directory * Fixes a longstanding issue with bootstrapping child interps and threads from kits check-in: 0aa60d1fa8 user: hypnotoad tags: hypnotoad | |
Changes to modules/clay/build/event.tcl.
|
Changes to modules/clay/build/metaclass.tcl.
︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - | proc ::clay::define::destructor rawbody { set body { # Run the destructor once and only once set self [self] my variable DestroyEvent if {$DestroyEvent} return set DestroyEvent 1 |
︙ | |||
191 192 193 194 195 196 197 | 190 191 192 193 194 195 196 | - - - - - - - - - - - - - - - - - - - - | # (if missing) when the object changes class via the [emph morph] method. ### proc ::clay::define::Variable {name {default {}}} { set class [current_class] set name [string trimright $name :/] $class clay set variable/ $name $default } |
Changes to modules/clay/build/object.tcl.
︙ | |||
457 458 459 460 461 462 463 464 465 466 467 468 469 470 | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | + + + + + + + + + + + + + + + + + + | } foreach class $clayorder { if {[$class clay exists {*}$args]} { return $class } } return {} } refcount { my variable refcount if {![info exists refcount]} { return 0 } return $refcount } refcount_incr { my variable refcount incr refcount } refcount_decr { my variable refcount incr refcount -1 if {$refcount <= 0} { ::clay::object_destroy [self] } } replace { set clay [lindex $args 0] } source { source [lindex $args 0] } |
︙ |
Changes to modules/clay/clay.man.
︙ | |||
443 444 445 446 447 448 449 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - - - - - - - - - - - - - - - - + + + + + + + + + + + + + | [example {property variable NAME {default DEFAULT}}] [para] Variables registered in the variable property are also initialized (if missing) when the object changes class via the [emph morph] method. |
︙ |
Changes to modules/clay/clay.tcl.
︙ | |||
1025 1026 1027 1028 1029 1030 1031 | 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | - | proc ::clay::define::destructor rawbody { set body { # Run the destructor once and only once set self [self] my variable DestroyEvent if {$DestroyEvent} return set DestroyEvent 1 |
︙ | |||
1088 1089 1090 1091 1092 1093 1094 | 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | - - - - - - - - - - - - - - - - | } } proc ::clay::define::Variable {name {default {}}} { set class [current_class] set name [string trimright $name :/] $class clay set variable/ $name $default } |
︙ | |||
1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 | 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 | + + + + + + + + + + + + + + + + + + | } foreach class $clayorder { if {[$class clay exists {*}$args]} { return $class } } return {} } refcount { my variable refcount if {![info exists refcount]} { return 0 } return $refcount } refcount_incr { my variable refcount incr refcount } refcount_decr { my variable refcount incr refcount -1 if {$refcount <= 0} { ::clay::object_destroy [self] } } replace { set clay [lindex $args 0] } source { source [lindex $args 0] } |
︙ | |||
1905 1906 1907 1908 1909 1910 1911 | 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 | + + - + - - + - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + | ### # END: object.tcl ### ### # START: event.tcl ### if {[info commands ::cron::object_destroy] eq {}} { # Provide a noop if we aren't running with the cron scheduler |
︙ |
Added modules/httpd/assets/test_cgi.tcl.
|
Changes to modules/httpd/build/cgi.tcl.
︙ | |||
90 91 92 93 94 95 96 97 98 99 100 101 102 103 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + | ### # Send any POST/PUT/etc content ### my ChannelCopy $chana $chanb -size $length } else { chan flush $chanb } my clay refcount_incr chan event $chanb readable [info coroutine] yield } method ProxyReply {chana chanb args} { my log ProxyReply [list args $args] |
︙ | |||
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | + | chan puts $chanb $replybuffer ### # Output the body. With no -size flag, channel will copy until EOF ### chan configure $chana -translation binary -blocking 0 -buffering full -buffersize 4096 chan configure $chanb -translation binary -blocking 0 -buffering full -buffersize 4096 my ChannelCopy $chana $chanb -chunk 4096 my clay refcount_decr } ### # For most CGI applications a directory list is vorboten ### method DirectoryListing {local_file} { my error 403 {Not Allowed} tailcall my DoOutput } } |
Changes to modules/httpd/build/core.tcl.
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ### # A metaclass for MIME handling behavior across a live socket ### clay::define ::httpd::mime { method ChannelCopy {in out args} { try { my clay refcount_incr |
︙ | |||
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | + + | } } return $pathlist } method wait {mode sock} { my clay refcount_incr if {[info coroutine] eq {}} { chan event $sock $mode [list set ::httpd::lock_$sock $mode] vwait ::httpd::lock_$sock } else { chan event $sock $mode [info coroutine] yield } chan event $sock $mode {} my clay refcount_decr } } |
Changes to modules/httpd/build/dispatch.tcl.
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - - - - + + + - - - - - | } } ::clay::define ::httpd::content.cache { method Dispatch {} { my variable chan |
︙ |
Changes to modules/httpd/build/file.tcl.
︙ | |||
127 128 129 130 131 132 133 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - | tailcall my DoOutput } if {$chan eq {}} return my wait writable $chan if {![info exists reply_file]} { tailcall my DoOutput } |
Changes to modules/httpd/build/plugin.tcl.
︙ | |||
199 200 201 202 203 204 205 | 199 200 201 202 203 204 205 206 207 208 209 210 | - + | } $pageobj clay mixinmap {*}$mixinmap if {[dict exists $reply delegate]} { $pageobj clay delegate {*}[dict get $reply delegate] } $pageobj dispatch $sock $reply set output [$pageobj output] |
Changes to modules/httpd/build/proxy.tcl.
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 | - - - + + + - - - | if {$sock eq {}} { my error 404 {Not Found} tailcall my DoOutput } my log HttpAccess {} chan event $sock writable [info coroutine] yield |
Changes to modules/httpd/build/reply.man.
︙ | |||
129 130 131 132 133 134 135 136 137 138 139 140 141 142 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | + + + + + | Terminate the transaction, and close the socket. [call method [cmd HttpHeaders] [arg sock] [arg ?debug?]] Stream MIME headers from the socket [arg sock], stopping at an empty line. Returns the stream as a block of text. [call method [cmd ChannelRegister] [arg chan]] Registers a channel that will need to be flushed and closed when the object's destructor invokes the close method. [call method [cmd dispatch] [arg newsock] [arg datastate]] Take over control of the socket [arg newsock], and store that as the [arg chan] variable for the object. This method runs through all of the steps of reading HTTP headers, generating content, and closing the connection. (See class writetup). |
︙ | |||
264 265 266 267 268 269 270 | 269 270 271 272 273 274 275 276 277 278 279 280 | - - - - - - - - - - - - - - - - - - - - - - | a timeout error to the request if it has, as well as destroy the object and close the [arg chan] socket. [call method [cmd timestamp]] Return the current system time in the format: [example {%a, %d %b %Y %T %Z}] |
Changes to modules/httpd/build/reply.tcl.
︙ | |||
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | + | # } # } # # }] ### ::clay::define ::httpd::reply { superclass ::httpd::mime Variable ChannelRegister {} Delegate <server> { description {The server object which spawned this reply} } ### # A dictionary which will converted into the MIME headers of the reply |
︙ | |||
121 122 123 124 125 126 127 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + - + | REMOTE_ADDR {} REMOTE_HOST {} USER_AGENT {} SESSION {} } constructor {ServerObj args} { |
︙ | |||
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | + + | # ensemble # [para] # All other fields are passed along to the [method clay] structure of the object. ### method dispatch {newsock datastate} { my variable chan request try { my clay refcount_incr set chan $newsock my ChannelRegister $chan chan event $chan readable {} chan configure $chan -translation {auto crlf} -buffering line if {[dict exists $datastate mixin]} { set mixinmap [dict get $datastate mixin] } else { set mixinmap {} } |
︙ | |||
219 220 221 222 223 224 225 226 227 228 229 230 231 232 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | + + + | } my Session_Load my Log_Dispatched my Dispatch } on error {err errdat} { my error 500 $err [dict get $errdat -errorinfo] my DoOutput } finally { my close my clay refcount_decr } } method Dispatch {} { # Invoke the URL implementation. my content my DoOutput |
︙ | |||
334 335 336 337 338 339 340 | 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - | append result $reply_body } else { append result [my reply output] } chan puts -nonewline $chan $result my log HttpAccess {} } |
︙ | |||
419 420 421 422 423 424 425 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | } return $postdata } # Manage session data method Session_Load {} {} |
︙ |
Changes to modules/httpd/build/scgi.tcl.
︙ | |||
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + - + | my counter url_hit try { # Read the SCGI request on byte at a time until we reach a ":" dict set query http HTTP_HOST {} dict set query http CONTENT_LENGTH 0 dict set query http REQUEST_URI / dict set query http REMOTE_ADDR $ip dict set query http DOCUMENT_ROOT [my clay get server/ doc_root] set size {} while 1 { set char [::coroutine::util::read $sock 1] if {[chan eof $sock]} { catch {close $sock} return } if {$char eq ":"} break append size $char } # With length in hand, read the netstring encoded headers set inbuffer [::coroutine::util::read $sock [expr {$size+1}]] |
︙ | |||
161 162 163 164 165 166 167 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + | try { set pageobj [::httpd::reply create ::httpd::object::$uuid [self]] dict set reply mixin protocol ::httpd::protocol.scgi $pageobj dispatch $sock $reply } on error {err errdat} { my debug [list ip: $ip error: $err errorinfo: [dict get $errdat -errorinfo]] my log BadRequest $uuid [list ip: $ip error: $err errorinfo: [dict get $errdat -errorinfo]] |
Changes to modules/httpd/build/server.tcl.
︙ | |||
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + | # normal cases, an object of class [cmd ::http::reply] is created, and that class's # [cmd dispatch] method. # This action passes control of the socket to # the reply object. The reply object manages the rest of the transaction, including # closing the socket. ### method Connect {uuid sock ip} { ::clay::cleanup yield [info coroutine] chan event $sock readable {} chan configure $sock \ -blocking 0 \ -translation {auto crlf} \ -buffering line my counter url_hit |
︙ | |||
158 159 160 161 162 163 164 | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + + | # Check open connections for a time out event. ### method CheckTimeout {} { foreach obj [info commands ::httpd::object::*] { try { $obj timeOutCheck } on error {} { |
︙ |
Changes to modules/httpd/httpd.man.
︙ | |||
226 227 228 229 230 231 232 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - + - + - - - - + + + + + + + + + + + | } }] [para] |
︙ | |||
356 357 358 359 360 361 362 | 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | - - - - - - - - - - - - - - - - - - - - - - - | POST or PUSH. Returns an empty string otherwise. [call method [cmd "Session_Load"]] Manage session data |
︙ |
Changes to modules/httpd/httpd.tcl.
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } namespace eval ::httpd { } namespace eval ::scgi { } clay::define ::httpd::mime { method ChannelCopy {in out args} { try { my clay refcount_incr |
︙ | |||
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | + + + - + + + + + + + + + + + + - - - - - - + + + + + + + + + - + + + | lappend pathlist $part } } } return $pathlist } method wait {mode sock} { my clay refcount_incr if {[info coroutine] eq {}} { chan event $sock $mode [list set ::httpd::lock_$sock $mode] vwait ::httpd::lock_$sock } else { chan event $sock $mode [info coroutine] yield } chan event $sock $mode {} my clay refcount_decr } } ### # END: core.tcl ### ### # START: reply.tcl ### ::clay::define ::httpd::reply { superclass ::httpd::mime Variable ChannelRegister {} Delegate <server> { description {The server object which spawned this reply} } Dict reply {} Dict request { CONTENT_LENGTH 0 COOKIE {} HTTP_HOST {} REFERER {} REQUEST_URI {} REMOTE_ADDR {} REMOTE_HOST {} USER_AGENT {} SESSION {} } constructor {ServerObj args} { |
︙ | |||
381 382 383 384 385 386 387 388 389 390 391 392 393 394 | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | + + + | } my Session_Load my Log_Dispatched my Dispatch } on error {err errdat} { my error 500 $err [dict get $errdat -errorinfo] my DoOutput } finally { my close my clay refcount_decr } } method Dispatch {} { # Invoke the URL implementation. my content my DoOutput } |
︙ | |||
473 474 475 476 477 478 479 | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | - | append result $reply_body } else { append result [my reply output] } chan puts -nonewline $chan $result my log HttpAccess {} } |
︙ | |||
542 543 544 545 546 547 548 | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | - - - - - - - - - - - | my variable chan chan configure $chan -translation binary -blocking 0 -buffering full -buffersize 4096 set postdata [::coroutine::util::read $chan $length] } return $postdata } method Session_Load {} {} |
︙ | |||
782 783 784 785 786 787 788 789 790 791 792 793 794 795 | 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | + | dict set result SERVER_SOFTWARE [my clay get server/ string] if {[string match 127.* $ip]} { dict set result LOCALHOST [expr {[lindex [split [dict getnull $result HTTP_HOST] :] 0] eq "localhost"}] } return $result } method Connect {uuid sock ip} { ::clay::cleanup yield [info coroutine] chan event $sock readable {} chan configure $sock \ -blocking 0 \ -translation {auto crlf} \ -buffering line my counter url_hit |
︙ | |||
824 825 826 827 828 829 830 | 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 | - + + | incr counters($which) } method CheckTimeout {} { foreach obj [info commands ::httpd::object::*] { try { $obj timeOutCheck } on error {} { |
︙ | |||
1088 1089 1090 1091 1092 1093 1094 | 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | - - - - + + + - - - - - | set HTTP_STATUS [my reply get Status] my puts [subst $msg] } } ::clay::define ::httpd::content.cache { method Dispatch {} { my variable chan |
︙ | |||
1238 1239 1240 1241 1242 1243 1244 | 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 | - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - | tailcall my DoOutput } if {$chan eq {}} return my wait writable $chan if {![info exists reply_file]} { tailcall my DoOutput } |
︙ | |||
1417 1418 1419 1420 1421 1422 1423 | 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 | - - - + + + - - - | if {$sock eq {}} { my error 404 {Not Found} tailcall my DoOutput } my log HttpAccess {} chan event $sock writable [info coroutine] yield |
︙ | |||
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 | 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 | + | ### # Send any POST/PUT/etc content ### my ChannelCopy $chana $chanb -size $length } else { chan flush $chanb } my clay refcount_incr chan event $chanb readable [info coroutine] yield } method ProxyReply {chana chanb args} { my log ProxyReply [list args $args] chan event $chana readable {} set replyhead [my HttpHeaders $chana] |
︙ | |||
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | + | chan puts $chanb $replybuffer ### # Output the body. With no -size flag, channel will copy until EOF ### chan configure $chana -translation binary -blocking 0 -buffering full -buffersize 4096 chan configure $chanb -translation binary -blocking 0 -buffering full -buffersize 4096 my ChannelCopy $chana $chanb -chunk 4096 my clay refcount_decr } method DirectoryListing {local_file} { my error 403 {Not Allowed} tailcall my DoOutput } } |
︙ | |||
1684 1685 1686 1687 1688 1689 1690 | 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 | - + | return } if {$char eq ":"} break append size $char } # With length in hand, read the netstring encoded headers set inbuffer [::coroutine::util::read $sock [expr {$size+1}]] |
︙ | |||
1716 1717 1718 1719 1720 1721 1722 | 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | - + | try { set pageobj [::httpd::reply create ::httpd::object::$uuid [self]] dict set reply mixin protocol ::httpd::protocol.scgi $pageobj dispatch $sock $reply } on error {err errdat} { my debug [list ip: $ip error: $err errorinfo: [dict get $errdat -errorinfo]] my log BadRequest $uuid [list ip: $ip error: $err errorinfo: [dict get $errdat -errorinfo]] |
︙ | |||
1887 1888 1889 1890 1891 1892 1893 | 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 | - + | } $pageobj clay mixinmap {*}$mixinmap if {[dict exists $reply delegate]} { $pageobj clay delegate {*}[dict get $reply delegate] } $pageobj dispatch $sock $reply set output [$pageobj output] |
Changes to modules/httpd/httpd.test.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 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 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - + + + - - - - + + + + + + + + - + + - - - - - + + + + + + - + - - + - - - - - - + - - + - - - - - - + - - - + + - - - - - - + - - + - - - + + - - - - - - - - - - - - - - - - + + - - - + - - - - - - - - - - - + + - - + - + - - + + - - - - - + + - - - + + - + - - - + + + - - + - - - - - + + + + + + + + + + + + + + + + + - + - - + - - - - - - + - - - + + - - - - - - + - - - + + - - - - - - + - - + - - - + + - - - - - - - - - - - - - - - - + + - - - + - - - - - - - - - - - + + - - + + + + + - + - + - - - - - - - - - - - - - - - - - - - + - - + - - - - - - - + + - + - - + - - - - - - + + - - - - - + + - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + - + - - - - - + + + + + + - + - + - + + + - - - - + + + + + - + - - + - - - - - - + - - - - - + + - - - - - - + - - - - + + - - - - - - + - - - + - - - + + - - - - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - - - - - + + + + - - - + - - - - - + + + + + + - | } else { set TCLLIBMOD [file join $MODDIR .. .. tcllib modules] } source [file join $TCLLIBMOD devtools testutilities.tcl] testsNeedTcl 8.6 ;# tool requires 8.6 testsNeedTcltest 2 |
︙ |
Changes to modules/practcl/practcl.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ### # Amalgamated package for practcl # Do not edit directly, tweak the source in src/ and rerun # build.tcl ### package require Tcl 8.6 package provide practcl 0.16.3 namespace eval ::practcl {} ### # START: httpwget/wget.tcl ### |
︙ | |||
1006 1007 1008 1009 1010 1011 1012 | 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | - | proc ::clay::define::destructor rawbody { set body { # Run the destructor once and only once set self [self] my variable DestroyEvent if {$DestroyEvent} return set DestroyEvent 1 |
︙ | |||
1069 1070 1071 1072 1073 1074 1075 | 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | - - - - - - - - - - - - - - - - | } } proc ::clay::define::Variable {name {default {}}} { set class [current_class] set name [string trimright $name :/] $class clay set variable/ $name $default } |
︙ | |||
1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 | 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 | + + + + + + + + + + + + + + + + + + | } foreach class $clayorder { if {[$class clay exists {*}$args]} { return $class } } return {} } refcount { my variable refcount if {![info exists refcount]} { return 0 } return $refcount } refcount_incr { my variable refcount incr refcount } refcount_decr { my variable refcount incr refcount -1 if {$refcount <= 0} { ::clay::object_destroy [self] } } replace { set clay [lindex $args 0] } source { source [lindex $args 0] } |
︙ | |||
1858 1859 1860 1861 1862 1863 1864 | 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 | + + - + - - + - - - + - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + | } } ::clay::object clay branch array ::clay::object clay branch mixin ::clay::object clay branch option ::clay::object clay branch dict clay ::clay::object clay set variable DestroyEvent 0 if {[info commands ::cron::object_destroy] eq {}} { # Provide a noop if we aren't running with the cron scheduler |
︙ |