#ifdef HAVE_GETADDRINFO_A
/* Pending DNS requests. */
static Lisp_Object dns_processes;
+static void wait_for_socket_fds (Lisp_Object process);
#endif
/* Alist of elements (NAME . PROCESS). */
struct Lisp_Process *p;
CHECK_PROCESS (process);
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
p = XPROCESS (process);
/* Don't signal an error if the process's input file descriptor
{
CHECK_PROCESS (process);
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
/* All known platforms store window sizes as 'unsigned short'. */
CHECK_RANGED_INTEGER (height, 0, USHRT_MAX);
CHECK_RANGED_INTEGER (width, 0, USHRT_MAX);
contact = XPROCESS (process)->childp;
#ifdef DATAGRAM_SOCKETS
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
if (DATAGRAM_CONN_P (process)
&& (EQ (key, Qt) || EQ (key, QCremote)))
contact = Fplist_put (contact, QCremote,
CHECK_PROCESS (process);
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
if (!DATAGRAM_CONN_P (process))
return Qnil;
CHECK_PROCESS (process);
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
if (!DATAGRAM_CONN_P (process))
return Qnil;
if (!NETCONN1_P (p))
error ("Process is not a network process");
+#ifdef HAVE_GETADDRINFO_A
+ wait_for_socket_fds (process);
+#endif
+
s = p->infd;
if (s < 0)
error ("Process is not running");
#endif
#ifdef HAVE_GETADDRINFO_A
- if (EQ (Fplist_get (contact, QCnowait), Qdns) &&
+ if (EQ (Fplist_get (contact, QCnowait), Qt) &&
!NILP (host))
{
int ret;
return ip_addresses;
}
+
+static void
+wait_for_socket_fds(Lisp_Object process)
+{
+ while (XPROCESS(process)->dns_requests)
+ {
+ wait_reading_process_output (0, 20 * 1000 * 1000, 0, 0, Qnil, NULL, 0);
+ }
+}
+
+static void
+wait_while_connecting(Lisp_Object process)
+{
+ while (EQ (Qconnect, XPROCESS(process)->status))
+ {
+ wait_reading_process_output (0, 20 * 1000 * 1000, 0, 0, Qnil, NULL, 0);
+ }
+}
#endif /* HAVE_GETADDRINFO_A */
/* This variable is different from waiting_for_input in keyboard.c.
if (XINT (start) < GPT && XINT (end) > GPT)
move_gap_both (XINT (start), start_byte);
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (proc))
+ wait_while_connecting (proc);
+#endif
+
send_process (proc, (char *) BYTE_POS_ADDR (start_byte),
end_byte - start_byte, Fcurrent_buffer ());
Lisp_Object proc;
CHECK_STRING (string);
proc = get_process (process);
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (proc))
+ wait_while_connecting (proc);
+#endif
+
send_process (proc, SSDATA (string),
SBYTES (string), string);
return Qnil;
struct coding_system *coding = NULL;
int outfd;
- if (DATAGRAM_CONN_P (process))
+ proc = get_process (process);
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (proc))
+ wait_while_connecting (proc);
+#endif
+
+ if (DATAGRAM_CONN_P (proc))
return process;
- proc = get_process (process);
+
outfd = XPROCESS (proc)->outfd;
if (outfd >= 0)
coding = proc_encode_coding_system[outfd];
register struct Lisp_Process *p;
CHECK_PROCESS (process);
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
p = XPROCESS (process);
+
if (p->infd < 0)
error ("Input file descriptor of %s closed", SDATA (p->name));
if (p->outfd < 0)
register struct Lisp_Process *p;
CHECK_PROCESS (process);
+
+#ifdef HAVE_GETADDRINFO_A
+ if (NETCONN_P (process))
+ wait_for_socket_fds (process);
+#endif
+
p = XPROCESS (process);
if (NILP (flag))
pset_decode_coding_system
DEFSYM (QCcoding, ":coding");
DEFSYM (QCserver, ":server");
DEFSYM (QCnowait, ":nowait");
- DEFSYM (Qdns, "dns");
DEFSYM (QCsentinel, ":sentinel");
DEFSYM (QCtls_parameters, ":tls-parameters");
DEFSYM (QClog, ":log");
#ifdef NON_BLOCKING_CONNECT
ADD_SUBFEATURE (QCnowait, Qt);
-#ifdef HAVE_GETADDRINFO_A
- ADD_SUBFEATURE (QCnowait, Qdns);
-#endif
#endif
#ifdef DATAGRAM_SOCKETS
ADD_SUBFEATURE (QCtype, Qdatagram);