Remove redundant *serverConn from requestBody.
Already there via the *stream.
diff --git a/server.go b/server.go
index 21438f5..d640811 100644
--- a/server.go
+++ b/server.go
@@ -1177,7 +1177,6 @@
}
bodyOpen := rp.stream.state == stateOpen
body := &requestBody{
- sc: sc,
stream: rp.stream,
needsContinue: needsContinue,
}
@@ -1368,6 +1367,7 @@
// called from handler goroutines
func (sc *serverConn) sendWindowUpdate(st *stream, n int) {
+ sc.serveG.checkNotOn() // NOT
if st == nil {
panic("no stream")
}
@@ -1402,7 +1402,6 @@
}
type requestBody struct {
- sc *serverConn
stream *stream
closed bool
pipe *pipe // non-nil if we have a HTTP entity message body
@@ -1422,15 +1421,14 @@
func (b *requestBody) Read(p []byte) (n int, err error) {
if b.needsContinue {
b.needsContinue = false
- b.sc.write100ContinueHeaders(b.stream)
+ b.stream.conn.write100ContinueHeaders(b.stream)
}
if b.pipe == nil {
return 0, io.EOF
}
n, err = b.pipe.Read(p)
if n > 0 {
- b.sc.sendWindowUpdate(b.stream, n)
- // TODO: tell b.sc to send back 'n' flow control quota credits to the sender
+ b.stream.conn.sendWindowUpdate(b.stream, n)
}
return
}