mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-10 14:10:51 +00:00
Explicitly reject :server and :nowait (Bug#31903)
* src/process.c (Fmake_network_process): Explicitly check for and signal an error when passed both :server and :nowait non-nil. In Emacs 25, :nowait would be ignored in this case, but as of Emacs 26.1 this gives an error, albeit an unclear one. Also remove obsolete comment regarding configurations lacking non-blocking mode, the corresponding code was removed in 2012-11-17 "Assume POSIX 1003.1-1988 or later for fcntl.h."
This commit is contained in:
parent
917158f8c9
commit
90d95b000c
1 changed files with 11 additions and 15 deletions
|
@ -3890,12 +3890,15 @@ usage: (make-network-process &rest ARGS) */)
|
||||||
filter = Fplist_get (contact, QCfilter);
|
filter = Fplist_get (contact, QCfilter);
|
||||||
sentinel = Fplist_get (contact, QCsentinel);
|
sentinel = Fplist_get (contact, QCsentinel);
|
||||||
use_external_socket_p = Fplist_get (contact, QCuse_external_socket);
|
use_external_socket_p = Fplist_get (contact, QCuse_external_socket);
|
||||||
|
Lisp_Object server = Fplist_get (contact, QCserver);
|
||||||
|
bool nowait = !NILP (Fplist_get (contact, QCnowait));
|
||||||
|
|
||||||
|
if (!NILP (server) && nowait)
|
||||||
|
error ("`:server' is incompatible with `:nowait'");
|
||||||
CHECK_STRING (name);
|
CHECK_STRING (name);
|
||||||
|
|
||||||
/* :local ADDRESS or :remote ADDRESS */
|
/* :local ADDRESS or :remote ADDRESS */
|
||||||
tem = Fplist_get (contact, QCserver);
|
if (!NILP (server))
|
||||||
if (NILP (tem))
|
|
||||||
address = Fplist_get (contact, QCremote);
|
address = Fplist_get (contact, QCremote);
|
||||||
else
|
else
|
||||||
address = Fplist_get (contact, QClocal);
|
address = Fplist_get (contact, QClocal);
|
||||||
|
@ -4009,7 +4012,7 @@ usage: (make-network-process &rest ARGS) */)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO_A
|
#ifdef HAVE_GETADDRINFO_A
|
||||||
if (!NILP (host) && !NILP (Fplist_get (contact, QCnowait)))
|
if (!NILP (host) && nowait)
|
||||||
{
|
{
|
||||||
ptrdiff_t hostlen = SBYTES (host);
|
ptrdiff_t hostlen = SBYTES (host);
|
||||||
struct req
|
struct req
|
||||||
|
@ -4154,20 +4157,13 @@ usage: (make-network-process &rest ARGS) */)
|
||||||
|
|
||||||
set_network_socket_coding_system (proc, host, service, name);
|
set_network_socket_coding_system (proc, host, service, name);
|
||||||
|
|
||||||
/* :server BOOL */
|
/* :server QLEN */
|
||||||
tem = Fplist_get (contact, QCserver);
|
p->is_server = !NILP (server);
|
||||||
if (!NILP (tem))
|
if (TYPE_RANGED_INTEGERP (int, server))
|
||||||
{
|
p->backlog = XINT (server);
|
||||||
/* Don't support network sockets when non-blocking mode is
|
|
||||||
not available, since a blocked Emacs is not useful. */
|
|
||||||
p->is_server = true;
|
|
||||||
if (TYPE_RANGED_INTEGERP (int, tem))
|
|
||||||
p->backlog = XINT (tem);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* :nowait BOOL */
|
/* :nowait BOOL */
|
||||||
if (!p->is_server && socktype != SOCK_DGRAM
|
if (!p->is_server && socktype != SOCK_DGRAM && nowait)
|
||||||
&& !NILP (Fplist_get (contact, QCnowait)))
|
|
||||||
p->is_non_blocking_client = true;
|
p->is_non_blocking_client = true;
|
||||||
|
|
||||||
bool postpone_connection = false;
|
bool postpone_connection = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue