[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/web-server de9f6ba 8/8: Merge remote-tracking branch 'u
From: |
Stefan Monnier |
Subject: |
[elpa] externals/web-server de9f6ba 8/8: Merge remote-tracking branch 'upstream/web-server/main' into externals/web-server |
Date: |
Sat, 27 Mar 2021 14:45:27 -0400 (EDT) |
branch: externals/web-server
commit de9f6bafad442a361bb32c9a4d37a931123665e6
Merge: 4edcba2 3aa5084
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Merge remote-tracking branch 'upstream/web-server/main' into
externals/web-server
---
web-server.el | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/web-server.el b/web-server.el
index d05deeb..39c2c85 100644
--- a/web-server.el
+++ b/web-server.el
@@ -1,11 +1,11 @@
;;; web-server.el --- Emacs Web Server -*- lexical-binding: t -*-
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
;; Author: Eric Schulte <schulte.eric@gmail.com>
;; Maintainer: Eric Schulte <schulte.eric@gmail.com>
;; Version: 0.1.2
-;; Package-Requires: ((emacs "24.3"))
+;; Package-Requires: ((emacs "24.1") (cl-lib "0.6"))
;; Keywords: http, server, network
;; URL: https://github.com/eschulte/emacs-web-server
@@ -107,11 +107,11 @@ function MATCH and the `ws-response-header' convenience
function.
(ws-start
- \\='(((lambda (_) t) .
- (lambda (proc request)
- (ws-response-header proc 200 \\='(\"Content-type\" . \"text/plain\"))
- (process-send-string proc \"hello world\")
- t)))
+ \\=`(((lambda (_) t) .
+ (lambda (request)
+ (with-slots ((proc process)) request
+ (ws-response-header proc 200 \\='(\"Content-Type\" . \"text/plain\"))
+ (process-send-string proc \"hello world\")))))
8080)
"
@@ -365,8 +365,9 @@ Return non-nil only when parsing is complete."
;; and causes `ws-web-socket-parse-messages' to be
;; called again after it terminates
;; data --------- holds the data of parsed messages
-;; handler ------ holds the user-supplied function used called on the
-;; data of parsed messages
+;; handler ------ holds the user-supplied function of two arguments
+;; called on the process and the data of parsed
+;; messages
(defclass ws-message () ; web socket message object
((process :initarg :process :accessor ws-process :initform "")
(pending :initarg :pending :accessor ws-pending :initform "")
@@ -383,9 +384,9 @@ in the request handler. If no web-socket connection is
established (e.g., because REQUEST is not attempting to establish
a connection) then no actions are taken and nil is returned.
-Second argument HANDLER should be a function of one argument
-which will be called on all complete messages as they are
-received and parsed from the network."
+Second argument HANDLER should be a function of two arguments,
+the process and a string, which will be called on all complete
+messages as they are received and parsed from the network."
(with-slots (process headers) request
(when (assoc :SEC-WEBSOCKET-KEY headers)
;; Accept the connection
@@ -725,9 +726,9 @@ respectively."
"Perform the handshake defined in RFC6455."
(base64-encode-string (sha1 (concat (ws-trim key) ws-guid) nil nil 'binary)))
-;;; Enable the old accessors without the `ws-' namespace as obsolete.
-;;; Lets plan to remove these within a year of the date they were
-;;; marked obsolete, so that would be roughly 2021-03-12.
+;; Enable the old accessors without the `ws-' namespace as obsolete.
+;; Lets plan to remove these within a year of the date they were
+;; marked obsolete, so that would be roughly 2021-03-12.
(define-obsolete-function-alias 'active #'ws-active "2020-03-12")
(define-obsolete-function-alias 'body #'ws-body "2020-03-12")
(define-obsolete-function-alias 'boundary #'ws-boundary "2020-03-12")
- [elpa] externals/web-server updated (4edcba2 -> de9f6ba), Stefan Monnier, 2021/03/27
- [elpa] externals/web-server 9edf4b5 1/8: Remove obsolete function, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server de9f6ba 8/8: Merge remote-tracking branch 'upstream/web-server/main' into externals/web-server,
Stefan Monnier <=
- [elpa] externals/web-server 7b517ab 5/8: Tighter example in ws-start documentation, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server 3aa5084 7/8: drop Emacs dependency to 24.1 and depends ELPA's cl-lib, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server 98bc343 4/8: Flesh out documentation of message handler, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server 4d865cc 6/8: Silence warnings, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server 0e92425 2/8: Fix ws-start docstring, Stefan Monnier, 2021/03/27
- [elpa] externals/web-server eb5d0cb 3/8: Fix ws-web-socket-connect's docstring, Stefan Monnier, 2021/03/27