diff options
| author | Lars Ingebrigtsen | 2016-02-05 13:57:28 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-05 13:57:28 +1100 |
| commit | c85e7d4c8c899c01d6b4a393512bab295ef635c1 (patch) | |
| tree | fc778b2e9774b4d8a518044723db18d79331b9fb /src/process.c | |
| parent | e4c58cf3feb853f2808204e85529d9365b31a6b4 (diff) | |
| download | emacs-c85e7d4c8c899c01d6b4a393512bab295ef635c1.tar.gz emacs-c85e7d4c8c899c01d6b4a393512bab295ef635c1.zip | |
Only do async DNS if requested with :nowait 'dns
* doc/lispref/processes.texi (Network Processes): Mention the
dns value of :nowait.
* src/process.c (Fmake_network_process): Only do async DNS if
:nowait is `dns'.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/process.c b/src/process.c index b232e331151..86ca3f339ac 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3421,11 +3421,16 @@ system used for both reading and writing for this process. If CODING | |||
| 3421 | is a cons (DECODING . ENCODING), DECODING is used for reading, and | 3421 | is a cons (DECODING . ENCODING), DECODING is used for reading, and |
| 3422 | ENCODING is used for writing. | 3422 | ENCODING is used for writing. |
| 3423 | 3423 | ||
| 3424 | :nowait BOOL -- If BOOL is non-nil for a stream type client process, | 3424 | :nowait NOWAIT -- If NOWAIT is non-nil for a stream type client |
| 3425 | return without waiting for the connection to complete; instead, the | 3425 | process, return without waiting for the connection to complete; |
| 3426 | sentinel function will be called with second arg matching "open" (if | 3426 | instead, the sentinel function will be called with second arg matching |
| 3427 | successful) or "failed" when the connect completes. Default is to use | 3427 | "open" (if successful) or "failed" when the connect completes. |
| 3428 | a blocking connect (i.e. wait) for stream type connections. | 3428 | Default is to use a blocking connect (i.e. wait) for stream type |
| 3429 | connections. If NOWAIT is `dns', also do the DNS lookup | ||
| 3430 | asynchronously, if supported. In that case, the process is returned | ||
| 3431 | before a connection has been made, and the client should not try | ||
| 3432 | communicating with the process until it has changed status to | ||
| 3433 | "connected". | ||
| 3429 | 3434 | ||
| 3430 | :noquery BOOL -- Query the user unless BOOL is non-nil, and process is | 3435 | :noquery BOOL -- Query the user unless BOOL is non-nil, and process is |
| 3431 | running when Emacs is exited. | 3436 | running when Emacs is exited. |
| @@ -3688,7 +3693,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3688 | #endif | 3693 | #endif |
| 3689 | 3694 | ||
| 3690 | #ifdef HAVE_GETADDRINFO_A | 3695 | #ifdef HAVE_GETADDRINFO_A |
| 3691 | if (!NILP (Fplist_get (contact, QCnowait)) && | 3696 | if (EQ (Fplist_get (contact, QCnowait), Qdns) && |
| 3692 | !NILP (host)) | 3697 | !NILP (host)) |
| 3693 | { | 3698 | { |
| 3694 | int ret; | 3699 | int ret; |
| @@ -4603,7 +4608,7 @@ check_for_dns (Lisp_Object proc) | |||
| 4603 | return Qnil; | 4608 | return Qnil; |
| 4604 | 4609 | ||
| 4605 | /* This process should not already be connected (or killed). */ | 4610 | /* This process should not already be connected (or killed). */ |
| 4606 | if (p->infd != 0) | 4611 | if (!EQ (p->status, Qconnect)) |
| 4607 | return Qnil; | 4612 | return Qnil; |
| 4608 | 4613 | ||
| 4609 | ret = gai_error (p->dns_requests[0]); | 4614 | ret = gai_error (p->dns_requests[0]); |
| @@ -7752,6 +7757,7 @@ syms_of_process (void) | |||
| 7752 | DEFSYM (QCcoding, ":coding"); | 7757 | DEFSYM (QCcoding, ":coding"); |
| 7753 | DEFSYM (QCserver, ":server"); | 7758 | DEFSYM (QCserver, ":server"); |
| 7754 | DEFSYM (QCnowait, ":nowait"); | 7759 | DEFSYM (QCnowait, ":nowait"); |
| 7760 | DEFSYM (Qdns, "dns"); | ||
| 7755 | DEFSYM (QCsentinel, ":sentinel"); | 7761 | DEFSYM (QCsentinel, ":sentinel"); |
| 7756 | DEFSYM (QCtls_parameters, ":tls-parameters"); | 7762 | DEFSYM (QCtls_parameters, ":tls-parameters"); |
| 7757 | DEFSYM (QClog, ":log"); | 7763 | DEFSYM (QClog, ":log"); |