-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not return control frames like ping.
Recurse to the next frame like in master. modified: src/WebSockets.jl Reintroduce recursion on control frames:376. Returning control codes would crash String(msg). Multi-frame messages are also possible. Add WebSocketClosedError messages :47, for underlying exceptions. Propagate unrecognized errors. Remove INFO message when closing. Readguarded() informs better. Added functions: readguarded return tuple: data and success indication incomplete messages are always empty writeguarded return success indication subprotocol(request) common for Httpserver and HTTP target(request) common for Httpserver and HTTP origin(request) common for Httpserver and HTTP modified: src/HTTP.jl make upgrade(ws) call websocket handler with full request. Origin can now be determined, as per recommendations. call showerror with catch_stacktrace(). backtrace was less interesting. add method target(request) add method origin(request) add method subprotocol(request) add ServerWS WebsocketHandler serve(::ServerWS, etc..) The intententions is user code brevity, access to HTTP keyword options, more similar interface with HttpServer, can save the user from distinguishing Stream and Message. modified: src/HttpServer.jl add method target(request) add method origin(request) add method subprotocol(request) improve inline doc for WebSocketHandler modified: examples/chat_explore.jl demonstrate new functions, improve readability modified: benchmark/functions_benchmark.jl capture WebSocketClosedError with readguarded(ws) modified: logutils/log_httpserver.jl explicitly import Request and Response from HttpServer modified: test/functions_server.jl rephrase inline docs, use subprotocol(request) modified: test/runtests.jl not rely on pong returning read(ws) call
- Loading branch information
Showing
8 changed files
with
486 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.