emacs-elpa-diffs
[Top][All Lists]
Advanced

[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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]