[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/websocket f7f7ad6d45 052/114: when nowait, delay handsh
From: |
ELPA Syncer |
Subject: |
[elpa] externals/websocket f7f7ad6d45 052/114: when nowait, delay handshake after process move to open status |
Date: |
Wed, 15 Feb 2023 20:58:59 -0500 (EST) |
branch: externals/websocket
commit f7f7ad6d45664ac872541dcf9fdaa37f75fa6136
Author: Yuya Minami <yuya373@me.com>
Commit: Yuya Minami <yuya373@me.com>
when nowait, delay handshake after process move to open status
---
websocket.el | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/websocket.el b/websocket.el
index 9eb90bf302..04329243e9 100644
--- a/websocket.el
+++ b/websocket.el
@@ -714,6 +714,10 @@ describing the problem with the frame.
(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)))
@@ -723,11 +727,25 @@ describing the problem with the frame.
(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)))
@@ -735,9 +753,7 @@ describing the problem with the frame.
(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-debug websocket "Websocket opened")
- websocket))
+ (websocket-create-headers url key protocols
extensions))))
(defun websocket-process-headers (url headers)
"On opening URL, process the HEADERS sent from the server."
- [elpa] externals/websocket 9fec6e28ef 014/114: Merge pull request #34 from legoscia/permit-non-numeric-port, (continued)
- [elpa] externals/websocket 9fec6e28ef 014/114: Merge pull request #34 from legoscia/permit-non-numeric-port, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 5a965add21 017/114: Merge branch 'close-testing-fix', ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 542c6fec74 025/114: Add support for cookies handling for ws clients., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 6b43f7525f 031/114: Add test for fragmented header, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket bcbd5258b2 040/114: Add note to windows users for functional tests., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket d407c0ad0f 041/114: Update version to 1.6., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 8f55a95698 042/114: Fix indentation., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket f94d43b97c 046/114: Prevent emacs from asking users about killing server process on exit, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket fbd9e2263d 047/114: Merge pull request #47 from alpha22jp/master, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket a9b8e74fa1 048/114: Update version to 1.8, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket f7f7ad6d45 052/114: when nowait, delay handshake after process move to open status,
ELPA Syncer <=
- [elpa] externals/websocket 13520c8baa 054/114: add documentation for nowait, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 4ca406fb96 060/114: Merge branch 'custom-headers', ELPA Syncer, 2023/02/15
- [elpa] externals/websocket b3a0153c0b 063/114: remove long line lambda, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket e9d148fbb6 064/114: Merge pull request #52 from yuya373/fix-nowait, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 607355db44 067/114: rename to `websocket-ensure-handshake`, ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 0d96ba2ff5 069/114: Merge fix for 32-bit emacs., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket a5a3ddb5ca 072/114: Fix all signal calls., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket ef1e504fec 075/114: Fix tests broken by recent changes., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket da237af723 076/114: Fix confusing documentation string in `websocket-openp'., ELPA Syncer, 2023/02/15
- [elpa] externals/websocket 53bfd56e12 078/114: Upgrade version number to 1.11., ELPA Syncer, 2023/02/15