Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
Fixy fixy wixy more
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry committed Nov 3, 2022
1 parent 6993625 commit aaba4a4
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions serverConn.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (sc *serverConn) writePing() {

fr.SetBody(ping)

if sc.state == connStateOpen {
if !isClosed(sc.writer) {
sc.writer <- fr
}
}
Expand Down Expand Up @@ -533,7 +533,9 @@ func (sc *serverConn) writeReset(strm uint32, code ErrorCode) {

r.SetCode(code)

sc.writer <- fr
if !isClosed(sc.writer) {
sc.writer <- fr
}

if sc.debug {
sc.logger.Printf(
Expand All @@ -554,7 +556,9 @@ func (sc *serverConn) writeGoAway(strm uint32, code ErrorCode, message string) {

fr.SetBody(ga)

sc.writer <- fr
if !isClosed(sc.writer) {
sc.writer <- fr
}

if strm != 0 {
atomic.StoreUint32(&sc.closeRef, sc.lastID)
Expand Down Expand Up @@ -828,7 +832,9 @@ func (sc *serverConn) handleEndRequest(strm *Stream) {

fasthttpResponseHeaders(h, &sc.enc, &ctx.Response)

sc.writer <- fr
if !isClosed(sc.writer) {
sc.writer <- fr
}

if hasBody {
if ctx.Response.IsBodyStream() {
Expand Down Expand Up @@ -983,7 +989,9 @@ func (sc *serverConn) writeData(strm *Stream, body []byte) {

fr.SetBody(data)

sc.writer <- fr
if !isClosed(sc.writer) {
sc.writer <- fr
}
}
}

Expand Down Expand Up @@ -1033,7 +1041,9 @@ func (sc *serverConn) handleSettings(st *Settings) {

fr.SetBody(stRes)

sc.writer <- fr
if !isClosed(sc.writer) {
sc.writer <- fr
}
}

func fasthttpResponseHeaders(dst *Headers, hp *HPACK, res *fasthttp.Response) {
Expand Down

0 comments on commit aaba4a4

Please sign in to comment.