Bigpipe from demo project to master. I encountered confused thing when test ChanResult (chan.go, /demo/basic/model/bigpipe.go)
if I call Flush() at the end of function (chan.go, line 62)
...
ctx.Write(c.End)
//ctx.Flush()
return nil
//actually, ctx.Write call ResponseWriter.Write, ctx.Flish call ResponseWriter.Flush
...
browser show error "chuncked body did not terminate property with 0-siezd chunk"
if i remove ctx.Flush(), it works fine.
below is html output when call Flush(), it write c.End twice? (captured by Fillder)
HTTP/1.1 200 OK
Content-Type: text/html
Server: go web server
Set-Cookie: _go_session_=7HcT5D-WSiKIqRnVEHCOs52x3g0=; Path=/; HttpOnly
Date: Mon, 20 May 2013 08:16:01 GMT
Content-Length: 833
<!DOCTYPE html>
<head>
</head>
<body>
<div id="panel">
</div>
<script>
function p(s) {
var panel = document.getElementById('panel');
var n = document.createElement('div');
n.innerHTML = s + " -- at " + new Date().toTimeString();
panel.appendChild(n);
}
</script>
<script>
p("goroutine 0 delay 4")
</script>
<script>
p("goroutine 4 delay 4")
</script>
<script>
p("goroutine 1 delay 10")
</script>
<script>
p("goroutine 2 delay 10")
</script>
<script>
p("goroutine 3 delay 12")
</script>
<script>
p("end")
</script>
</body>
</html>
<script>
p("end")
</script>
</body>
</html>