branch: externals/websocket commit 1608341a1ca9c3803ee38713ff27e73e6b7ceb5e Author: Yuya Minami <yuya...@me.com> Commit: Yuya Minami <yuya...@me.com>
Revert "when nowait, delay handshake after process move to open status" This reverts commit f7f7ad6d45664ac872541dcf9fdaa37f75fa6136. --- websocket.el | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/websocket.el b/websocket.el index 6fa4d9bf6e..7a1da162d1 100644 --- a/websocket.el +++ b/websocket.el @@ -718,10 +718,6 @@ Default nil. (websocket-calculate-accept key)))) (unless conn (error "Could not establish the websocket connection to %s" url)) (process-put conn :websocket websocket) - (when nowait - (process-put conn :key key) - (process-put conn :protocols protocols) - (process-put conn :extensions extensions)) (set-process-filter conn (lambda (process output) (let ((websocket (process-get process :websocket))) @@ -731,25 +727,11 @@ Default nil. (lambda (process change) (let ((websocket (process-get process :websocket))) (websocket-debug websocket "State change to %s" change) - (when (eq 'open (process-status process)) - (websocket-handshake websocket - (process-get process :key) - (process-get process :protocols) - (process-get process :extensions))) (when (and (member (process-status process) '(closed failed exit signal)) (not (eq 'closed (websocket-ready-state websocket)))) (websocket-try-callback 'websocket-on-close 'on-close websocket))))) (set-process-query-on-exit-flag conn nil) - (unless nowait - (websocket-handshake websocket key protocols extensions)) - (websocket-debug websocket "Websocket opened") - websocket)) - -(defun websocket-handshake (websocket key protocols extensions) - (let* ((url (websocket-url websocket)) - (url-struct (url-generic-parse-url url)) - (conn (websocket-conn websocket))) (process-send-string conn (format "GET %s HTTP/1.1\r\n" (let ((path (url-filename url-struct))) @@ -757,7 +739,9 @@ Default nil. (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)))) + (websocket-create-headers url key protocols extensions)) + (websocket-debug websocket "Websocket opened") + websocket)) (defun websocket-process-headers (url headers) "On opening URL, process the HEADERS sent from the server."