From: Noam Postavsky Date: Tue, 10 Jul 2018 00:06:27 +0000 (-0400) Subject: Merge from emacs-26 X-Git-Tag: emacs-27.0.90~4699 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b8349a90274686d9cb67a2ffaac2d930d5f6b46;p=emacs.git Merge from emacs-26 db3f779780 ; Test for Bug#32014 90d95b000c Explicitly reject :server and :nowait (Bug#31903) 917158f8c9 Fix Bug#32090 # Conflicts: # src/process.c --- 6b8349a90274686d9cb67a2ffaac2d930d5f6b46 diff --cc src/process.c index 279b74bc66e,4d7a735652c..5bd8c255a26 --- a/src/process.c +++ b/src/process.c @@@ -4015,38 -4009,37 +4018,38 @@@ usage: (make-network-process &rest ARGS portstring = SSDATA (service); portstringlen = SBYTES (service); } - } #ifdef HAVE_GETADDRINFO_A - if (!NILP (Fplist_get (contact, QCnowait))) - if (!NILP (host) && nowait) - { - ptrdiff_t hostlen = SBYTES (host); - struct req - { - struct gaicb gaicb; - struct addrinfo hints; - char str[FLEXIBLE_ARRAY_MEMBER]; - } *req = xmalloc (FLEXSIZEOF (struct req, str, - hostlen + 1 + portstringlen + 1)); - dns_request = &req->gaicb; - dns_request->ar_name = req->str; - dns_request->ar_service = req->str + hostlen + 1; - dns_request->ar_request = &req->hints; - dns_request->ar_result = NULL; - memset (&req->hints, 0, sizeof req->hints); - req->hints.ai_family = family; - req->hints.ai_socktype = socktype; - strcpy (req->str, SSDATA (host)); - strcpy (req->str + hostlen + 1, portstring); - - int ret = getaddrinfo_a (GAI_NOWAIT, &dns_request, 1, NULL); - if (ret) - error ("%s/%s getaddrinfo_a error %d", SSDATA (host), portstring, ret); - - goto open_socket; - } ++ if (nowait) + { + ptrdiff_t hostlen = SBYTES (host); + struct req + { + struct gaicb gaicb; + struct addrinfo hints; + char str[FLEXIBLE_ARRAY_MEMBER]; + } *req = xmalloc (FLEXSIZEOF (struct req, str, + hostlen + 1 + portstringlen + 1)); + dns_request = &req->gaicb; + dns_request->ar_name = req->str; + dns_request->ar_service = req->str + hostlen + 1; + dns_request->ar_request = &req->hints; + dns_request->ar_result = NULL; + memset (&req->hints, 0, sizeof req->hints); + req->hints.ai_family = family; + req->hints.ai_socktype = socktype; + strcpy (req->str, SSDATA (host)); + strcpy (req->str + hostlen + 1, portstring); + + int ret = getaddrinfo_a (GAI_NOWAIT, &dns_request, 1, NULL); + if (ret) + error ("%s/%s getaddrinfo_a error %d", + SSDATA (host), portstring, ret); + + goto open_socket; + } #endif /* HAVE_GETADDRINFO_A */ + } /* If we have a host, use getaddrinfo to resolve both host and service. Otherwise, use getservbyname to lookup the service. */