Last Comment Bug 712188 - Return correct websocket close code when browser navigates away from page.
: Return correct websocket close code when browser navigates away from page.
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: Networking: WebSockets (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Jason Duell [:jduell] (needinfo me)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-19 17:24 PST by Jason Duell [:jduell] (needinfo me)
Modified: 2012-05-30 07:21 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Return correct websocket close code when brower navigates away from page (742 bytes, patch)
2011-12-19 17:24 PST, Jason Duell [:jduell] (needinfo me)
bugs: review+
Details | Diff | Splinter Review

Description Jason Duell [:jduell] (needinfo me) 2011-12-19 17:24:52 PST
Created attachment 583028 [details] [diff] [review]
Return correct websocket close code when brower navigates away from page

Right now we close with 1000 (CLOSE_NORMAL) if Cancel is called.  But the IETF spec provides a code (1002: GOING_AWAY) for exactly this case.

No easy way to test this automatically (we'd have to rig pywebsocket to report failure/success: doesn't seem worth the considerable effort and code fork)--I will test by hand.

We could provide an error string here if we want in addition to the code, but spec says it's optional, and I don't think we need it.
Comment 1 Jason Duell [:jduell] (needinfo me) 2012-01-05 12:15:44 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed6e4d7917fb
Comment 2 Ed Morley [:emorley] 2012-01-06 15:58:22 PST
https://hg.mozilla.org/mozilla-central/rev/ed6e4d7917fb
Comment 3 Eric Shepherd [:sheppy] 2012-04-24 06:00:56 PDT
Noted here:

https://developer.mozilla.org/en/WebSockets/WebSockets_reference/CloseEvent#Gecko_notes

Also mentioned on Firefox 12 for developers.

Note You need to log in before you can comment on or make changes to this bug.