<p dir="auto">by <strong>sebastien.paolacci</strong>:</p>
<pre class="notranslate">Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Ask for an os.File representation of a timeout-protected connection
2. Issue a timeout-able framework call (e.g con.{accept, read, write})
3. Wait.

What is the expected output?
Effective timeout: "resource temporarily unavailable".

What do you see instead?
Call will block forever.


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
linux/amd64

Which revision are you using?  (hg identify)
r60.3, tip.

Please provide any additional information below.
Discussed on golang-nuts
(<a href="http://groups.google.com/group/golang-nuts/browse_thread/thread/c88f08fa652497da#)" rel="nofollow">http://groups.google.com/group/golang-nuts/browse_thread/thread/c88f08fa652497da#)</a>,
issue filled for the record.

package main 

import ( 
        "flag" 
        "net" 
        "fmt" 
        "syscall" 
) 

const TIMEOUT = 1e8 

func main() { 
        unblock := flag.Bool("unblock", false, "revert socket blocking mode") 
        flag.Parse() 

        addr, _ := net.ResolveTCPAddr("tcp", "12345") 
        l, err := net.ListenTCP("tcp", addr) 
        if err != nil { 
                panic(err) 
        } 
        if err := l.SetTimeout(TIMEOUT); err != nil { 
                panic(err) 
        } 

        f, _ := l.File() 
        fmt.Printf("observing '%v'\n", f) 

        if *unblock { 
                syscall.SetNonblock(f.Fd(), true) 
        } 

        fmt.Printf("should timeout in %v seconds...\n", float64(TIMEOUT)/1e9) 
        con, err := l.Accept() // Will hang forever if the '-unblock' flag is not set.
        fmt.Println(con, err) 
}</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/2458/0/timeout.patch" rel="nofollow">timeout.patch</a> (4183 bytes)</li>
</ol>
<pre class="notranslate">Go has a RFC 6265 compliant cookie parser in net/http that is used for the builtin http
server. Which means commas aren't allowed in cookie values (what the rfc specified in
the BNF as "cookie-octet").

Despite not being RFC compliant, all browsers that I'm aware of allow commas. When
replatforming an existing system to Golang, I'm unable to read in cookies set by the
another server (nginx) or set cookies in a way that mimics the legacy app.

I'd like to see net/http/cookie.go do less validation on cookie values so that it
matches the behavior of firefox and chrome, because this will make it easier to replace
legacy systems with Go.

I can produce a patch. The relevant lines of code in the go parser are:
<a href="http://golang.org/src/pkg/net/http/cookie.go#L308" rel="nofollow">http://golang.org/src/pkg/net/http/cookie.go#L308</a>
<a href="http://golang.org/src/pkg/net/http/cookie.go#L350" rel="nofollow">http://golang.org/src/pkg/net/http/cookie.go#L350</a>


Existing browser implementations:
<a href="http://mxr.mozilla.org/mozilla-central/source/netwerk/cookie/nsCookieService.cpp#3095" rel="nofollow">http://mxr.mozilla.org/mozilla-central/source/netwerk/cookie/nsCookieService.cpp#3095</a>

<a href="http://src.chromium.org/viewvc/chrome/trunk/src/net/cookies/parsed_cookie.cc#l143" rel="nofollow">http://src.chromium.org/viewvc/chrome/trunk/src/net/cookies/parsed_cookie.cc#l143</a>

Which compiler are you using (5g, 6g, 8g, gccgo)?
Affects all compilers

Which operating system are you using?
Affects all OS's

Which version are you using?  (run 'go version')
go 1.2</pre>