Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
21f50576
Commit
21f50576
authored
Nov 09, 2011
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: add a disabled failing test for Issue 2357
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5372044
parent
d5a5855b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
src/pkg/net/http/serve_test.go
src/pkg/net/http/serve_test.go
+25
-0
No files found.
src/pkg/net/http/serve_test.go
View file @
21f50576
...
...
@@ -1077,6 +1077,31 @@ func TestClientWriteShutdown(t *testing.T) {
}
}
// Tests that chunked server responses that write 1 byte at a time are
// buffered before chunk headers are added, not after chunk headers.
func
TestServerBufferedChunking
(
t
*
testing
.
T
)
{
if
true
{
t
.
Logf
(
"Skipping known broken test; see Issue 2357"
)
return
}
conn
:=
new
(
testConn
)
conn
.
readBuf
.
Write
([]
byte
(
"GET / HTTP/1.1
\r\n\r\n
"
))
done
:=
make
(
chan
bool
)
ls
:=
&
oneConnListener
{
conn
}
go
Serve
(
ls
,
HandlerFunc
(
func
(
rw
ResponseWriter
,
req
*
Request
)
{
defer
close
(
done
)
rw
.
Header
()
.
Set
(
"Content-Type"
,
"text/plain"
)
// prevent sniffing, which buffers
rw
.
Write
([]
byte
{
'x'
})
rw
.
Write
([]
byte
{
'y'
})
rw
.
Write
([]
byte
{
'z'
})
}))
<-
done
if
!
bytes
.
HasSuffix
(
conn
.
writeBuf
.
Bytes
(),
[]
byte
(
"
\r\n\r\n
3
\r\n
xyz
\r\n
0
\r\n\r\n
"
))
{
t
.
Errorf
(
"response didn't end with a single 3 byte 'xyz' chunk; got:
\n
%q"
,
conn
.
writeBuf
.
Bytes
())
}
}
// goTimeout runs f, failing t if f takes more than ns to complete.
func
goTimeout
(
t
*
testing
.
T
,
ns
int64
,
f
func
())
{
ch
:=
make
(
chan
bool
,
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment