Check-in [6dc367091c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Correct HTTP/1.1 comparison per comment from andrewsh.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6dc367091c92aa3c354014eb5b2468eee6d0774c
User & Date: andy 2014-05-02 21:14:48
Context
2014-05-10
02:38
Fix shebang per comment from andrewsh. Leaf check-in: 180aada6d2 user: andy tags: trunk
2014-05-02
21:14
Correct HTTP/1.1 comparison per comment from andrewsh. check-in: 6dc367091c user: andy tags: trunk
2014-04-21
00:01
Incorporate patch for HTTP/1.0 and connection: close from andrewsh. Reference http://wiki.tcl.tk/_/revision?N=27382&V=54#pagetoc0aa08018 for discussion. check-in: c62e5a1b5d user: andy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to wibble.tcl.

1
2
3
4
5
6
7
8
#!/usr/bin/env tclsh
# Wibble - a pure-Tcl Web server.
# Code: https://chiselapp.com/user/andy/repository/wibble/timeline
# Discussion: http://wiki.tcl.tk/23626
# Copyright 2009-2014 Andy Goth.  mailto/andrew.m.goth/at/gmail/dot/com
# Available under the Tcl/Tk license.  http://tcl.tk/software/tcltk/license.html

package require Tcl 8.6
|







1
2
3
4
5
6
7
8
/#!/usr/bin/env tclsh
# Wibble - a pure-Tcl Web server.
# Code: https://chiselapp.com/user/andy/repository/wibble/timeline
# Discussion: http://wiki.tcl.tk/23626
# Copyright 2009-2014 Andy Goth.  mailto/andrew.m.goth/at/gmail/dot/com
# Available under the Tcl/Tk license.  http://tcl.tk/software/tcltk/license.html

package require Tcl 8.6
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
        content "not implemented: [dict get $request uri]\n"
}

# Default send handler: send the response to the client using HTTP.
proc ::wibble::defaultsend {socket request response} {
    # Determine if the connection is persistent.
    set persist [expr {
        [dict get $request protocol] >= "http/1.1"
     && ![string equal -nocase [dict getnull $request header connection] close]
    }]

    # Get the content channel and/or size.
    set size 0
    if {[dict exists $response contentfile]} {
        set size [file size [dict get $response contentfile]]







|







1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
        content "not implemented: [dict get $request uri]\n"
}

# Default send handler: send the response to the client using HTTP.
proc ::wibble::defaultsend {socket request response} {
    # Determine if the connection is persistent.
    set persist [expr {
        [dict get $request protocol] >= "HTTP/1.1"
     && ![string equal -nocase [dict getnull $request header connection] close]
    }]

    # Get the content channel and/or size.
    set size 0
    if {[dict exists $response contentfile]} {
        set size [file size [dict get $response contentfile]]