diff options
| author | Paul Eggert | 2019-02-01 08:40:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-02-01 08:40:52 -0800 |
| commit | b60761acfa3c0070efd53056040524f05b35c07f (patch) | |
| tree | 5dd010859b95c60bdcd3623b5df4fa50f653dc9e /src/process.c | |
| parent | 94245b9a790392768d47afc15ae278369307d663 (diff) | |
| parent | 7ba8f803983fce7896042289ca47b3de4df42bb7 (diff) | |
| download | emacs-b60761acfa3c0070efd53056040524f05b35c07f.tar.gz emacs-b60761acfa3c0070efd53056040524f05b35c07f.zip | |
Merge from origin/emacs-26
7ba8f80398 Avoid errors in 'rmail-get-new-mail'
9c8412a0b8 Fix process-contact bug with TCP connections
# Conflicts:
# src/process.c
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/process.c b/src/process.c index c0741403b57..728c14a7624 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4741,19 +4741,24 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4741 | service = Qnil; | 4741 | service = Qnil; |
| 4742 | Lisp_Object args[11]; | 4742 | Lisp_Object args[11]; |
| 4743 | int nargs = 0; | 4743 | int nargs = 0; |
| 4744 | AUTO_STRING (procname_format_in, "%s <%d.%d.%d.%d:%d>"); | 4744 | #define HOST_FORMAT_IN "%d.%d.%d.%d" |
| 4745 | AUTO_STRING (procname_format_in6, "%s <[%x:%x:%x:%x:%x:%x:%x:%x]:%d>"); | 4745 | #define HOST_FORMAT_IN6 "%x:%x:%x:%x:%x:%x:%x:%x" |
| 4746 | AUTO_STRING (host_format_in, HOST_FORMAT_IN); | ||
| 4747 | AUTO_STRING (host_format_in6, HOST_FORMAT_IN6); | ||
| 4748 | AUTO_STRING (procname_format_in, "%s <"HOST_FORMAT_IN":%d>"); | ||
| 4749 | AUTO_STRING (procname_format_in6, "%s <["HOST_FORMAT_IN6"]:%d>"); | ||
| 4746 | AUTO_STRING (procname_format_default, "%s <%d>"); | 4750 | AUTO_STRING (procname_format_default, "%s <%d>"); |
| 4747 | switch (saddr.sa.sa_family) | 4751 | switch (saddr.sa.sa_family) |
| 4748 | { | 4752 | { |
| 4749 | case AF_INET: | 4753 | case AF_INET: |
| 4750 | { | 4754 | { |
| 4751 | args[nargs++] = procname_format_in; | 4755 | args[nargs++] = procname_format_in; |
| 4752 | nargs++; | 4756 | args[nargs++] = host_format_in; |
| 4753 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; | 4757 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; |
| 4754 | service = make_fixnum (ntohs (saddr.in.sin_port)); | 4758 | service = make_fixnum (ntohs (saddr.in.sin_port)); |
| 4755 | for (int i = 0; i < 4; i++) | 4759 | for (int i = 0; i < 4; i++) |
| 4756 | args[nargs++] = make_fixnum (ip[i]); | 4760 | args[nargs++] = make_fixnum (ip[i]); |
| 4761 | host = Fformat (5, args + 1); | ||
| 4757 | args[nargs++] = service; | 4762 | args[nargs++] = service; |
| 4758 | } | 4763 | } |
| 4759 | break; | 4764 | break; |
| @@ -4762,11 +4767,12 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4762 | case AF_INET6: | 4767 | case AF_INET6: |
| 4763 | { | 4768 | { |
| 4764 | args[nargs++] = procname_format_in6; | 4769 | args[nargs++] = procname_format_in6; |
| 4765 | nargs++; | 4770 | args[nargs++] = host_format_in6; |
| 4766 | DECLARE_POINTER_ALIAS (ip6, uint16_t, &saddr.in6.sin6_addr); | 4771 | DECLARE_POINTER_ALIAS (ip6, uint16_t, &saddr.in6.sin6_addr); |
| 4767 | service = make_fixnum (ntohs (saddr.in.sin_port)); | 4772 | service = make_fixnum (ntohs (saddr.in.sin_port)); |
| 4768 | for (int i = 0; i < 8; i++) | 4773 | for (int i = 0; i < 8; i++) |
| 4769 | args[nargs++] = make_fixnum (ip6[i]); | 4774 | args[nargs++] = make_fixnum (ip6[i]); |
| 4775 | host = Fformat (9, args + 1); | ||
| 4770 | args[nargs++] = service; | 4776 | args[nargs++] = service; |
| 4771 | } | 4777 | } |
| 4772 | break; | 4778 | break; |