Commit da91b5f2 authored by Chong Yidong's avatar Chong Yidong
Browse files

Merge open-protocol-stream into open-network-stream.

* lisp/subr.el (open-network-stream): Move to net/network-stream.el.

* lisp/gnus/proto-stream.el: Move to net/network-stream.el.

* lisp/net/network-stream.el: Move from gnus/proto-stream.el.
Change prefix to network-stream throughout.
(open-protocol-stream): Merge into open-network-stream, leaving
open-protocol-stream as an alias.  Handle nil BUFFER args.

* lisp/gnus/nnimap.el (nnimap-open-connection-1): Pass explicit :end-of-command
parameter to open-protocol-stream.

* lisp/emacs-lisp/package.el (package--with-work-buffer): Recognize
https URLs.

* lisp/url/url-gw.el (url-open-stream): Use new open-network-stream
functionality to perform encryption.
parent 1d2e369d
...@@ -773,6 +773,12 @@ sc.el, x-menu.el, rnews.el, rnewspost.el ...@@ -773,6 +773,12 @@ sc.el, x-menu.el, rnews.el, rnewspost.el
* Lisp changes in Emacs 24.1 * Lisp changes in Emacs 24.1
** `open-network-stream' can now be used to open an encrypted stream.
It now accepts an optional `:type' parameter for initiating a TLS
connection, directly or via STARTTLS. To do STARTTLS, additional
parameters (`:end-of-command', `:success', `:capabilities-command')
must also be supplied.
** Code can now use lexical scoping by default instead of dynamic scoping. ** Code can now use lexical scoping by default instead of dynamic scoping.
The `lexical-binding' variable lets code use lexical scoping for local The `lexical-binding' variable lets code use lexical scoping for local
variables. It is typically set via file-local variables, in which case it variables. It is typically set via file-local variables, in which case it
......
2011-04-02 Chong Yidong <cyd@stupidchicken.com>
* emacs-lisp/package.el (package--with-work-buffer): Recognize
https URLs.
* net/network-stream.el: Move from gnus/proto-stream.el. Change
prefix to network-stream throughout.
(open-protocol-stream): Merge into open-network-stream, leaving
open-protocol-stream as an alias. Handle nil BUFFER args.
* subr.el (open-network-stream): Move to net/network-stream.el.
2011-04-02 Glenn Morris <rgm@gnu.org> 2011-04-02 Glenn Morris <rgm@gnu.org>
   
* find-dired.el (find-exec-terminator): New option. * find-dired.el (find-exec-terminator): New option.
...@@ -210,14 +222,14 @@ ...@@ -210,14 +222,14 @@
* textmodes/css.el: * textmodes/css.el:
* startup.el: * startup.el:
* uniquify.el: * uniquify.el:
* minibuffer.el: * minibuffer.el:
* newcomment.el: * newcomment.el:
* reveal.el: * reveal.el:
* server.el: * server.el:
* mpc.el: * mpc.el:
* emacs-lisp/smie.el: * emacs-lisp/smie.el:
* doc-view.el: * doc-view.el:
* dired.el: * dired.el:
* abbrev.el: Use lexical binding. * abbrev.el: Use lexical binding.
   
2011-04-01 Eli Zaretskii <eliz@gnu.org> 2011-04-01 Eli Zaretskii <eliz@gnu.org>
......
...@@ -652,7 +652,7 @@ FILE is the name of a file relative to that base location. ...@@ -652,7 +652,7 @@ FILE is the name of a file relative to that base location.
This macro retrieves FILE from LOCATION into a temporary buffer, This macro retrieves FILE from LOCATION into a temporary buffer,
and evaluates BODY while that buffer is current. This work and evaluates BODY while that buffer is current. This work
buffer is killed afterwards. Return the last value in BODY." buffer is killed afterwards. Return the last value in BODY."
`(let* ((http (string-match "\\`http:" ,location)) `(let* ((http (string-match "\\`https?:" ,location))
(buffer (buffer
(if http (if http
(url-retrieve-synchronously (concat ,location ,file)) (url-retrieve-synchronously (concat ,location ,file))
......
2011-04-02 Chong Yidong <cyd@stupidchicken.com>
* proto-stream.el: Move to Emacs core, at net/network-stream.el.
* nnimap.el (nnimap-open-connection-1): Pass explicit :end-of-command
parameter to open-protocol-stream.
2011-04-01 Julien Danjou <julien@danjou.info> 2011-04-01 Julien Danjou <julien@danjou.info>
   
* mm-view.el (mm-display-inline-fontify): Do not fontify with * mm-view.el (mm-display-inline-fontify): Do not fontify with
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-and-compile (eval-and-compile
(require 'nnheader)) (require 'nnheader)
;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
;; `make-network-stream'.
(unless (fboundp 'open-protocol-stream)
(require 'proto-stream)))
(eval-when-compile (eval-when-compile
(require 'cl)) (require 'cl))
...@@ -45,7 +49,6 @@ ...@@ -45,7 +49,6 @@
(require 'tls) (require 'tls)
(require 'parse-time) (require 'parse-time)
(require 'nnmail) (require 'nnmail)
(require 'proto-stream)
(autoload 'auth-source-forget+ "auth-source") (autoload 'auth-source-forget+ "auth-source")
(autoload 'auth-source-search "auth-source") (autoload 'auth-source-search "auth-source")
...@@ -365,6 +368,7 @@ textual parts.") ...@@ -365,6 +368,7 @@ textual parts.")
:return-list t :return-list t
:shell-command nnimap-shell-program :shell-command nnimap-shell-program
:capability-command "1 CAPABILITY\r\n" :capability-command "1 CAPABILITY\r\n"
:end-of-command "\r\n"
:success " OK " :success " OK "
:starttls-function :starttls-function
(lambda (capabilities) (lambda (capabilities)
......
...@@ -27,13 +27,16 @@ ...@@ -27,13 +27,16 @@
;; For Emacs <22.2 and XEmacs. ;; For Emacs <22.2 and XEmacs.
(eval-and-compile (eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
;; `make-network-stream'.
(unless (fboundp 'open-protocol-stream)
(require 'proto-stream)))
(require 'nnheader) (require 'nnheader)
(require 'nnoo) (require 'nnoo)
(require 'gnus-util) (require 'gnus-util)
(require 'gnus) (require 'gnus)
(require 'proto-stream)
(require 'gnus-group) ;; gnus-group-name-charset (require 'gnus-group) ;; gnus-group-name-charset
(nnoo-declare nntp) (nnoo-declare nntp)
......
;;; proto-stream.el --- negotiating TLS, STARTTLS and other connections ;;; network-stream.el --- open network processes, possibly with encryption
;; Copyright (C) 2010-2011 Free Software Foundation, Inc. ;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
...@@ -22,20 +22,14 @@ ...@@ -22,20 +22,14 @@
;;; Commentary: ;;; Commentary:
;; This library is meant to provide the glue between modules that want ;; This library provides the function `open-network-stream', which provides a
;; to establish a network connection to a server for protocols such as ;; higher-level interface for opening TCP network processes than the built-in
;; IMAP, NNTP, SMTP and POP3. ;; function `make-network-process'. In addition to plain connections, it
;; supports TLS/SSL and STARTTLS connections.
;; The main problem is that there's more than a couple of interfaces
;; towards doing this. You have normal, plain connections, which are
;; no trouble at all, but you also have TLS/SSL connections, and you
;; have STARTTLS. Negotiating this for each protocol can be rather
;; tedious, so this library provides a single entry point, and hides
;; much of the ugliness.
;; Usage example: ;; Usage example:
;; (open-protocol-stream ;; (open-network-stream
;; "*nnimap*" buffer address port ;; "*nnimap*" buffer address port
;; :type 'network ;; :type 'network
;; :capability-command "1 CAPABILITY\r\n" ;; :capability-command "1 CAPABILITY\r\n"
...@@ -55,14 +49,24 @@ ...@@ -55,14 +49,24 @@
(proc type &optional priority-string trustfiles keyfiles)) (proc type &optional priority-string trustfiles keyfiles))
;;;###autoload ;;;###autoload
(defun open-protocol-stream (name buffer host service &rest parameters) (defun open-network-stream (name buffer host service &rest parameters)
"Open a network stream to HOST, possibly with encryption. "Open a TCP connection to HOST, optionally with encryption.
Normally, return a network process object; with a non-nil Normally, return a network process object; with a non-nil
:return-list parameter, return a list instead (see below). :return-list parameter, return a list instead (see below).
Input and output work as for subprocesses; `delete-process'
closes it.
NAME is the name for the process. It is modified if necessary to
make it unique.
BUFFER is a buffer or buffer name to associate with the process.
Process output goes at end of that buffer. BUFFER may be nil,
meaning that the process is not associated with any buffer.
HOST is the name or IP address of the host to connect to.
SERVICE is the name of the service desired, or an integer specifying
a port number to connect to.
The first four parameters, NAME, BUFFER, HOST, and SERVICE, have The remaining PARAMETERS should be a sequence of keywords and
the same meanings as in `open-network-stream'. The remaining values:
PARAMETERS should be a sequence of keywords and values:
:type specifies the connection type, one of the following: :type specifies the connection type, one of the following:
nil or `network' nil or `network'
...@@ -92,7 +96,6 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -92,7 +96,6 @@ PARAMETERS should be a sequence of keywords and values:
or `tls' (TLS-encrypted). or `tls' (TLS-encrypted).
:end-of-command specifies a regexp matching the end of a command. :end-of-command specifies a regexp matching the end of a command.
If non-nil, it defaults to \"\\n\".
:success specifies a regexp matching a message indicating a :success specifies a regexp matching a message indicating a
successful STARTTLS negotiation. For instance, the default successful STARTTLS negotiation. For instance, the default
...@@ -106,6 +109,8 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -106,6 +109,8 @@ PARAMETERS should be a sequence of keywords and values:
This function should take one parameter, the response to the This function should take one parameter, the response to the
capability command, and should return the command to switch on capability command, and should return the command to switch on
STARTTLS if the server supports STARTTLS, and nil otherwise." STARTTLS if the server supports STARTTLS, and nil otherwise."
(unless (featurep 'make-network-process)
(error "Emacs was compiled without networking support"))
(let ((type (plist-get parameters :type)) (let ((type (plist-get parameters :type))
(return-list (plist-get parameters :return-list))) (return-list (plist-get parameters :return-list)))
(if (and (not return-list) (if (and (not return-list)
...@@ -113,21 +118,24 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -113,21 +118,24 @@ PARAMETERS should be a sequence of keywords and values:
(and (memq type '(nil network)) (and (memq type '(nil network))
(not (and (plist-get parameters :success) (not (and (plist-get parameters :success)
(plist-get parameters :capability-command)))))) (plist-get parameters :capability-command))))))
;; The simplest case is equivalent to `open-network-stream'. ;; The simplest case: wrapper around `make-network-process'.
(open-network-stream name buffer host service) (make-network-process :name name :buffer buffer
;; For everything else, refer to proto-stream-open-*. :host host :service service)
(unless (plist-get parameters :end-of-command) (let ((work-buffer (or buffer
(setq parameters (append '(:end-of-command "\r\n") parameters))) (generate-new-buffer " *stream buffer*")))
(let* ((connection-function (fun (cond ((eq type 'plain) 'network-stream-open-plain)
(cond ((memq type '(nil network starttls))
((eq type 'plain) 'proto-stream-open-plain) 'network-stream-open-starttls)
((memq type '(nil network starttls)) ((memq type '(tls ssl)) 'network-stream-open-tls)
'proto-stream-open-starttls) ((eq type 'shell) 'network-stream-open-shell)
((memq type '(tls ssl)) 'proto-stream-open-tls) (t (error "Invalid connection type %s" type))))
((eq type 'shell) 'proto-stream-open-shell) result)
(t (error "Invalid connection type %s" type)))) (unwind-protect
(result (funcall connection-function (setq result (funcall fun name work-buffer host service parameters))
name buffer host service parameters))) (unless buffer
(and (processp (car result))
(set-process-buffer (car result) nil))
(kill-buffer work-buffer)))
(if return-list (if return-list
(list (car result) (list (car result)
:greeting (nth 1 result) :greeting (nth 1 result)
...@@ -135,16 +143,20 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -135,16 +143,20 @@ PARAMETERS should be a sequence of keywords and values:
:type (nth 3 result)) :type (nth 3 result))
(car result)))))) (car result))))))
(defun proto-stream-open-plain (name buffer host service parameters) ;;;###autoload
(defalias 'open-protocol-stream 'open-network-stream)
(defun network-stream-open-plain (name buffer host service parameters)
(let ((start (with-current-buffer buffer (point))) (let ((start (with-current-buffer buffer (point)))
(stream (open-network-stream name buffer host service))) (stream (make-network-process :name name :buffer buffer
:host host :service service)))
(list stream (list stream
(proto-stream-get-response stream start (network-stream-get-response stream start
(plist-get parameters :end-of-command)) (plist-get parameters :end-of-command))
nil nil
'plain))) 'plain)))
(defun proto-stream-open-starttls (name buffer host service parameters) (defun network-stream-open-starttls (name buffer host service parameters)
(let* ((start (with-current-buffer buffer (point))) (let* ((start (with-current-buffer buffer (point)))
(require-tls (eq (plist-get parameters :type) 'starttls)) (require-tls (eq (plist-get parameters :type) 'starttls))
(starttls-function (plist-get parameters :starttls-function)) (starttls-function (plist-get parameters :starttls-function))
...@@ -152,11 +164,10 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -152,11 +164,10 @@ PARAMETERS should be a sequence of keywords and values:
(capability-command (plist-get parameters :capability-command)) (capability-command (plist-get parameters :capability-command))
(eoc (plist-get parameters :end-of-command)) (eoc (plist-get parameters :end-of-command))
;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE) ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE)
(stream (open-network-stream name buffer host service)) (stream (make-network-process :name name :buffer buffer
(greeting (proto-stream-get-response stream start eoc)) :host host :service service))
(capabilities (when capability-command (greeting (network-stream-get-response stream start eoc))
(proto-stream-command stream (capabilities (network-stream-command stream capability-command eoc))
capability-command eoc)))
(resulting-type 'plain) (resulting-type 'plain)
starttls-command) starttls-command)
...@@ -179,9 +190,9 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -179,9 +190,9 @@ PARAMETERS should be a sequence of keywords and values:
;; care about the identity of the peer. ;; care about the identity of the peer.
(cons "--insecure" starttls-extra-arguments)))) (cons "--insecure" starttls-extra-arguments))))
(setq stream (starttls-open-stream name buffer host service))) (setq stream (starttls-open-stream name buffer host service)))
(proto-stream-get-response stream start eoc)) (network-stream-get-response stream start eoc))
(when (string-match success-string (when (string-match success-string
(proto-stream-command stream starttls-command eoc)) (network-stream-command stream starttls-command eoc))
;; The server said it was OK to begin STARTTLS negotiations. ;; The server said it was OK to begin STARTTLS negotiations.
(if (fboundp 'open-gnutls-stream) (if (fboundp 'open-gnutls-stream)
(gnutls-negotiate stream nil) (gnutls-negotiate stream nil)
...@@ -192,11 +203,13 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -192,11 +203,13 @@ PARAMETERS should be a sequence of keywords and values:
;; We didn't successfully negotiate STARTTLS; if TLS ;; We didn't successfully negotiate STARTTLS; if TLS
;; isn't demanded, reopen an unencrypted connection. ;; isn't demanded, reopen an unencrypted connection.
(unless require-tls (unless require-tls
(setq stream (open-network-stream name buffer host service)) (setq stream
(proto-stream-get-response stream start eoc))) (make-network-process :name name :buffer buffer
:host host :service service))
(network-stream-get-response stream start eoc)))
;; Re-get the capabilities, which may have now changed. ;; Re-get the capabilities, which may have now changed.
(setq capabilities (setq capabilities
(proto-stream-command stream capability-command eoc)))) (network-stream-command stream capability-command eoc))))
;; If TLS is mandatory, close the connection if it's unencrypted. ;; If TLS is mandatory, close the connection if it's unencrypted.
(and require-tls (and require-tls
...@@ -205,70 +218,69 @@ PARAMETERS should be a sequence of keywords and values: ...@@ -205,70 +218,69 @@ PARAMETERS should be a sequence of keywords and values:
;; Return value: ;; Return value:
(list stream greeting capabilities resulting-type))) (list stream greeting capabilities resulting-type)))
(defun proto-stream-command (stream command eoc) (defun network-stream-command (stream command eoc)
(let ((start (with-current-buffer (process-buffer stream) (point-max)))) (when command
(process-send-string stream command) (let ((start (with-current-buffer (process-buffer stream) (point-max))))
(proto-stream-get-response stream start eoc))) (process-send-string stream command)
(network-stream-get-response stream start eoc))))
(defun proto-stream-get-response (stream start end-of-command)
(with-current-buffer (process-buffer stream) (defun network-stream-get-response (stream start end-of-command)
(save-excursion (when end-of-command
(goto-char start) (with-current-buffer (process-buffer stream)
(while (and (memq (process-status stream) (save-excursion
'(open run)) (goto-char start)
(not (re-search-forward end-of-command nil t))) (while (and (memq (process-status stream) '(open run))
(accept-process-output stream 0 50) (not (re-search-forward end-of-command nil t)))
(goto-char start)) (accept-process-output stream 0 50)
(if (= start (point)) (goto-char start))
;; The process died; return nil. ;; Return the data we got back, or nil if the process died.
nil (unless (= start (point))
;; Return the data we got back. (buffer-substring start (point)))))))
(buffer-substring start (point))))))
(defun network-stream-open-tls (name buffer host service parameters)
(defun proto-stream-open-tls (name buffer host service parameters)
(with-current-buffer buffer (with-current-buffer buffer
(let ((start (point-max)) (let* ((start (point-max))
(stream (use-builtin-gnutls (fboundp 'open-gnutls-stream))
(funcall (if (fboundp 'open-gnutls-stream) (stream
'open-gnutls-stream (funcall (if use-builtin-gnutls
'open-tls-stream) 'open-gnutls-stream
name buffer host service)) 'open-tls-stream)
(eoc (plist-get parameters :end-of-command))) name buffer host service))
(eoc (plist-get parameters :end-of-command)))
(if (null stream) (if (null stream)
(list nil nil nil 'plain) (list nil nil nil 'plain)
;; If we're using tls.el, we have to delete the output from ;; If we're using tls.el, we have to delete the output from
;; openssl/gnutls-cli. ;; openssl/gnutls-cli.
(unless (fboundp 'open-gnutls-stream) (when (and (null use-builtin-gnutls) eoc)
(proto-stream-get-response stream start eoc) (network-stream-get-response stream start eoc)
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward eoc nil t) (when (re-search-forward eoc nil t)
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
(delete-region (point-min) (line-beginning-position)))) (delete-region (point-min) (line-beginning-position))))
(proto-stream-capability-open start stream parameters 'tls))))) (let* ((capability-command (plist-get parameters :capability-command)))
(list stream
(network-stream-get-response stream start eoc)
(network-stream-command stream capability-command eoc)
'tls))))))
(defun proto-stream-open-shell (name buffer host service parameters) (defun network-stream-open-shell (name buffer host service parameters)
(require 'format-spec) (require 'format-spec)
(proto-stream-capability-open
(with-current-buffer buffer (point))
(let ((process-connection-type nil))
(start-process name buffer shell-file-name
shell-command-switch
(format-spec
(plist-get parameters :shell-command)
(format-spec-make
?s host
?p service))))
parameters 'plain))
(defun proto-stream-capability-open (start stream parameters stream-type)
(let* ((capability-command (plist-get parameters :capability-command)) (let* ((capability-command (plist-get parameters :capability-command))
(eoc (plist-get parameters :end-of-command)) (eoc (plist-get parameters :end-of-command))
(greeting (proto-stream-get-response stream start eoc))) (start (with-current-buffer buffer (point)))
(list stream greeting (stream (let ((process-connection-type nil))
(and capability-command (start-process name buffer shell-file-name
(proto-stream-command stream capability-command eoc)) shell-command-switch
stream-type))) (format-spec
(plist-get parameters :shell-command)
(format-spec-make
?s host
?p service))))))
(list stream
(network-stream-get-response stream start eoc)
(network-stream-command stream capability-command eoc)
'plain)))
(provide 'proto-stream) (provide 'network-stream)
;;; proto-stream.el ends here ;;; network-stream.el ends here
...@@ -1792,28 +1792,6 @@ Signal an error if the program returns with a non-zero exit status." ...@@ -1792,28 +1792,6 @@ Signal an error if the program returns with a non-zero exit status."
(forward-line 1)) (forward-line 1))
(nreverse lines))))) (nreverse lines)))))
;; open-network-stream is a wrapper around make-network-process.
(when (featurep 'make-network-process)
(defun open-network-stream (name buffer host service)
"Open a TCP connection for a service to a host.
Returns a subprocess-object to represent the connection.
Input and output work as for subprocesses; `delete-process' closes it.
NAME is the name for the process. It is modified if necessary to make
it unique.
BUFFER is the buffer (or buffer name) to associate with the
process. Process output goes at end of that buffer. BUFFER may
be nil, meaning that this process is not associated with any buffer.
HOST is the name or IP address of the host to connect to.
SERVICE is the name of the service desired, or an integer specifying
a port number to connect to.
This is a wrapper around `make-network-process', and only offers a
subset of its functionality."
(make-network-process :name name :buffer buffer
:host host :service service)))
;; compatibility ;; compatibility
(make-obsolete (make-obsolete
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
;; Fixme: support SSH explicitly or via a url-gateway-rlogin-program? ;; Fixme: support SSH explicitly or via a url-gateway-rlogin-program?
(autoload 'socks-open-network-stream "socks") (autoload 'socks-open-network-stream "socks")
(autoload 'open-ssl-stream "ssl")
(autoload 'open-tls-stream "tls")
(defgroup url-gateway nil (defgroup url-gateway nil
"URL gateway variables." "URL gateway variables."
...@@ -219,13 +217,6 @@ Might do a non-blocking connection; use `process-status' to check." ...@@ -219,13 +217,6 @@ Might do a non-blocking connection; use `process-status' to check."
host)) host))
'native 'native
url-gateway-method)) url-gateway-method))
;;; ;; This hack is for OS/2 Emacs so that it will not do bogus CRLF
;;; ;; conversions while trying to be 'helpful'
;;; (tcp-binary-process-output-services (if (stringp service)
;;; (list service)
;;; (list service
;;; (int-to-string service))))
;; An attempt to deal with denied connections, and attempt ;; An attempt to deal with denied connections, and attempt
;; to reconnect ;; to reconnect
(cur-retries 0) (cur-retries 0)
...@@ -243,19 +234,15 @@ Might do a non-blocking connection; use `process-status' to check." ...@@ -243,19 +234,15 @@ Might do a non-blocking connection; use `process-status' to check."
(let ((coding-system-for-read 'binary) (let ((coding-system-for-read 'binary)
(coding-system-for-write 'binary)) (coding-system-for-write 'binary))
(setq conn (case gw-method (setq conn (case gw-method
(tls ((tls ssl native)
(funcall (if (fboundp 'open-gnutls-stream) (if (eq gw-method 'native)
'open-gnutls-stream (setq gw-method 'plain))
'open-tls-stream) (open-network-stream
name buffer host service)) name buffer host service
(ssl :type gw-method
(open-ssl-stream name buffer host service)) ;; Use non-blocking socket if we can.
((native) :nowait (featurep 'make-network-process
;; Use non-blocking socket if we can. '(:nowait t))))
(make-network-process :name name :buffer buffer
:host host :service service
:nowait
(featurep 'make-network-process '(:nowait t))))
(socks (socks