branch: externals/websocket commit 078f83902c0846c00ed8e3b6c5add7ff9b98d8f9 Merge: 31e122a9d7 06dcb68721 Author: Andrew Hyatt <ahy...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #68 from xhcoding/master Fix for QWebsocketServer. Splitting the handshake causes some servers to send a RST. --- websocket.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/websocket.el b/websocket.el index a8a0321540..56f768855e 100644 --- a/websocket.el +++ b/websocket.el @@ -744,15 +744,14 @@ to the websocket protocol. (when (and (eq 'connecting (websocket-ready-state websocket)) (memq (process-status conn) (list 'run (if nowait 'connect 'open)))) - (process-send-string conn - (format "GET %s HTTP/1.1\r\n" - (let ((path (url-filename url-struct))) - (if (> (length path) 0) path "/")))) (websocket-debug websocket "Sending handshake, key: %s, acceptance: %s" key (websocket-accept-string websocket)) (process-send-string conn - (websocket-create-headers - url key protocols extensions custom-header-alist))))) + (format "GET %s HTTP/1.1\r\n%s" + (let ((path (url-filename url-struct))) + (if (> (length path) 0) path "/")) + (websocket-create-headers + url key protocols extensions custom-header-alist)))))) (defun websocket-process-headers (url headers) "On opening URL, process the HEADERS sent from the server."