Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove close notifier methods #478

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -161,7 +157,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