Skip to content

HTTP Conn needs a timeout #213

@gopherbot

Description

@gopherbot

by david.titarenco:

What steps will reproduce the problem?

func HelloServer(c *http.Conn, req *http.Request) {
        for {
                io.WriteString(c, "This is the song that never ends. );
                c.Flush();
        }
}

What is the expected output? What do you see instead?
As a rule of thumb, HTTP servers (and most network servers in general) have
timeouts to prevent infinite-length connections. A timeout goroutine is
necessary to prevent high-volume fd saturation.

What is your $GOOS?  $GOARCH?
GOARCH=386
GOROOT=/home/go
GOOS=linux

Which revision are you sync'ed to?  (hg log -l 1)
4065:ce0a8285caf5

Please provide any additional information below.
I'm working on an implementation of this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions