Skip to content

Commit

Permalink
remove close notifier methods (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangas authored and jonny-improbable committed Aug 5, 2019
1 parent fdc3ed8 commit d3a3431
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
8 changes: 0 additions & 8 deletions go/grpcweb/grpc_web_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func (w *grpcWebResponse) Flush() {
}
}

func (w *grpcWebResponse) CloseNotify() <-chan bool {
return w.wrapped.(http.CloseNotifier).CloseNotify()
}

// prepareHeaders runs all required header copying and transformations to
// prepare the header of the wrapped response writer.
func (w *grpcWebResponse) prepareHeaders() {
Expand Down Expand Up @@ -163,7 +159,3 @@ func (w *base64ResponseWriter) Flush() {
w.newEncoder()
w.wrapped.(http.Flusher).Flush()
}

func (w *base64ResponseWriter) CloseNotify() <-chan bool {
return w.wrapped.(http.CloseNotifier).CloseNotify()
}
22 changes: 8 additions & 14 deletions go/grpcweb/websocket_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ import (
)

type webSocketResponseWriter struct {
writtenHeaders bool
wsConn *websocket.Conn
headers http.Header
flushedHeaders http.Header
closeNotifyChan chan bool
writtenHeaders bool
wsConn *websocket.Conn
headers http.Header
flushedHeaders http.Header
}

func newWebSocketResponseWriter(wsConn *websocket.Conn) *webSocketResponseWriter {
return &webSocketResponseWriter{
writtenHeaders: false,
headers: make(http.Header),
flushedHeaders: make(http.Header),
wsConn: wsConn,
closeNotifyChan: make(chan bool, 1),
writtenHeaders: false,
headers: make(http.Header),
flushedHeaders: make(http.Header),
wsConn: wsConn,
}
}

Expand Down Expand Up @@ -90,10 +88,6 @@ func (w *webSocketResponseWriter) Flush() {
// no-op
}

func (w *webSocketResponseWriter) CloseNotify() <-chan bool {
return w.closeNotifyChan
}

type webSocketWrappedReader struct {
wsConn *websocket.Conn
respWriter *webSocketResponseWriter
Expand Down

0 comments on commit d3a3431

Please sign in to comment.