Skip to content

Commit

Permalink
remove conn on failure to write
Browse files Browse the repository at this point in the history
  • Loading branch information
ivcosla committed Jun 23, 2019
1 parent a60206d commit a9bff3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/apps/skychat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ func messageHandler(w http.ResponseWriter, req *http.Request) {
})
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
connsMu.Lock()
delete(chatConns, pk)
connsMu.Unlock()
return
}

}

func sseHandler(w http.ResponseWriter, req *http.Request) {
Expand Down

0 comments on commit a9bff3c

Please sign in to comment.