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

Fix a crash occuring when closing a non-connected websocket #239

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

scottinet
Copy link
Contributor

Description

This PR fixes a segfault case occuring when closing an unconnected WebSocket instance.

How to test

Run this Go program:

package main

import (
	"github.com/kuzzleio/sdk-go/protocol/websocket"
)

func main() {
	c := websocket.NewWebSocket("kuzzle", nil)
	c.Close()
}

Without this PR: segfault
With this PR: 👍

@codecov-io
Copy link

codecov-io commented Feb 28, 2019

Codecov Report

Merging #239 into 1-dev will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##            1-dev     #239      +/-   ##
==========================================
- Coverage   87.99%   87.95%   -0.04%     
==========================================
  Files         244      244              
  Lines        4491     4493       +2     
==========================================
  Hits         3952     3952              
- Misses        487      489       +2     
  Partials       52       52
Impacted Files Coverage Δ
protocol/websocket/web_socket.go 9.22% <0%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c777f4...a3345c6. Read the comment docs.

@alexandrebouthinon alexandrebouthinon merged commit ba323ed into 1-dev Feb 28, 2019
@alexandrebouthinon alexandrebouthinon deleted the fix-ws-crash-on-close branch February 28, 2019 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants