aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prefer AUTO_STRING_WITH_LEN to make_formatted_stringPaul Eggert2016-04-041-12/+12
| | | | | | | | | | * src/buffer.c (Fgenerate_new_buffer_name): * src/filelock.c (get_boot_time): * src/minibuf.c (get_minibuffer): * src/process.c (make_process): * src/xdisp.c (ensure_echo_area_buffers): Prefer AUTO_STRING_WITH_LEN + sprintf to make_formatted_string when either will do.
* Spelling fixesPaul Eggert2016-04-031-1/+1
|
* Assume NON_BLOCKING_CONNECT (Bug#22946)Paul Eggert2016-03-221-48/+5
| | | | | | | | | | * lisp/proced.el (proced-signal-list): Omit comment about obsolete systems that do not support POSIX 1003.1-2001 signals. * src/process.c (NON_BLOCKING_CONNECT): Remove, since we can now assume POSIX 1003.1-2001 or better here. Assume it’s defined. (connect_network_socket): Assume EINPROGRESS is defined, as that’s portable too now. (Fmake_network_process): Use bool for boolean.
* Merge from origin/emacs-25John Wiegley2016-03-111-11/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | facb5e2 Update Emacs manual section related to character folding 4efea8e ; * etc/DEBUG: Fix a typo. (Bug#22984) f8df21b Update admin/notes/unicode 950be68 Add symref-filepattern entries for c?perl-mode 8b8a6ad Don't use XRANDR 1.3 extensions if the server doesn't support them. 985dacf ; NEWS update for the last change in etags 741a6f8 Sync with gnulib 7352c6c Rework C source files to avoid ^( a589e9a By default, etags produces unqualified Perl tag names 72c7438 Indent methods with keyword names correctly 28532a9 Propertize character literals and special global variables differently a7d6f39 ; Fix last change in NEWS 83b2a20 Change how /etc/NEWS presents character folding b417c5a Revert "Revert "Backport: * lisp/isearch.el: Turn char-folding off by default"" 711ca36 Properly handle lambda as read function (bug 22961) 1b9d616 Propertize operator symbol names with symbol syntax class 9b16bc2 Stop recognizing :#{} as symbol in ruby-mode 366ec77 Allow using the left shift operator without spaces on both sides 02bf7cc Properly handle unquoting in wdired (bug 22938) 16cf469 ; Spelling fix and tighten up comment f50bc04 Allow splat operator before percent literal 991c801 Don't apply the return value of goto-char as syntax class 6e63b3e Guard against nested percent literals 066f3bc Recognize iuwu-mod after an escaped newline 6f7a57c Fix symbolic mode string conversion for s and t 50b9826 Update 'ucs-names' database 993b2fb Improve doc string of 'shell-command' b71c717 Make the code in movemail_strftime more general cc057e4 Speed up redisplay of binary files with long series of nulls e51b27e Remove the highlighting support for quoting 'like this' inside Lisp docstrings b1abce1 Restore leading space in movemail pop output 98b8d44 Fix bidi-paragraph-direction in Rmail view buffer dc9d837 Don't misindent computed property generator methods 7923112 Fix mbox files produced by movemail on MS-Windows c45a1ca doc string file descriptor exhaustion fix 265141b Fix Bug#22814
| * Rework C source files to avoid ^(Paul Eggert2016-03-101-11/+11
| | | | | | | | | | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
| * src/process.c Correctly convert AF_INET6 addressesDavid Edmondson2016-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * src/process.c (conv_lisp_to_sockaddr): AF_INET6 addresses are converted to a list of 16 bit quantities by conv_sockaddr_to_lisp(). conv_lisp_to_sockaddr() should follow the same scheme rather than expecting a (longer) list of 8 bit quantities. Backport: (cherry picked from commit 55ce3c30d617c38eb086d5ad4ffbd881c20c559c)
* | Minor fixes for getaddrinfo_a usagePaul Eggert2016-03-091-25/+23
| | | | | | | | | | | | | | | | | | * src/process.c (Fdelete_process): Check gai_cancel return value. That way, there’s no need to invoke gai_error. Check gai_suspend return value. (Fmake_network_process): Don’t assume gai_strerror returns a UTF-8 string. Simplify call to connect_network_socket. (check_for_dns): Avoid unnecessary initialization of local.
* | Assume getaddrinfo in C codePaul Eggert2016-03-071-64/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/CPP-DEFINES, configure.ac: Remove HAVE_GETADDRINFO, HAVE_H_ERRNO. All uses removed. * doc/lispref/processes.texi (Network, Network Processes), etc/NEWS: Say that port numbers can be integer strings. * lib-src/pop.c (h_errno) [!WINDOWSNT && !HAVE_H_ERRNO]: Remove decl. (socket_connection): Assume HAVE_GETADDRINFO. * lisp/mpc.el (mpc--proc-connect): * lisp/net/network-stream.el (open-network-stream): It’s now OK to use integer strings as port numbers. * src/process.c (conv_numerical_to_lisp) [!HAVE_GETADDRINFO]: Remove. (Fmake_network_process): Assume HAVE_GETADDRINFO.
* | Remove support for IRIXPaul Eggert2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IRIX port wasn’t really working anyway, and the code was getting in the way of other changes (e.g., getaddrinfo fixes). IRIX’s supplier dropped support for IRIX in 2013. * admin/CPP-DEFINES: * configure.ac (opsys): * doc/lispref/os.texi (System Environment): * etc/MACHINES, etc/PROBLEMS: * lisp/find-dired.el (find-grep-options): * lisp/lpr.el (lpr-lp-system): * lisp/ls-lisp.el (ls-lisp-emulation): * lisp/mail/rmail.el (rmail-spool-directory): * lisp/net/net-utils.el (ping-program-options): * lisp/progmodes/gud.el (gud-irix-p, gud-dbx-use-stopformat-p): * lisp/progmodes/ps-mode.el (ps-mode-print-function): * src/conf_post.h [IRIX6_5]: * src/emacs.c (Vsystem_type): * src/filelock.c (get_boot_time_1): * src/process.c (process_send_signal): * src/unexelf.c (unexec): Omit IRIX-specific code and/or documentation. * configure.ac (NON_GCC_TEST_OPTIONS, IRIX6_5, PREFER_VSUSP): Remove. All uses removed. * etc/NEWS: Document the change.
* | Ensure TLS negotiation progressLars Ingebrigtsen2016-03-031-5/+29
| | | | | | | | | | | | | | | | * src/gnutls.h (GNUTLS_EMACS_HANDSHAKES_LIMIT): Increase the number of retries so that we try for about a minute. * src/process.c (wait_reading_process_output): Ensure progress for DNS resolution and TLS negotiation.
* | Stop calling res_initPaul Eggert2016-02-291-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | Emacs shouldn’t need to call res_init any more, now that nscd or equivalent is everywhere. On modern systems, calling res_init simply slows Emacs down. On ancient systems lacking nscd Emacs will still work well enough with this change; it’s just that it won’t respond to changes in /etc/resolv.conf. * configure.ac (HAVE_RES_INIT): Remove. Worry about -lresolv only when configured --with-hesiod. Hesiod is still used; see, e.g.: https://soylentnews.org/meta/article.pl?sid=15/07/13/0255214 * src/Makefile.in (LIBRESOLV): Remove. All uses removed.
* | * src/process.c (Fdelete_process): Simplify cast.Paul Eggert2016-02-291-2/+1
| |
* | Wait for async DNS to complete before freeing resourcesLars Ingebrigtsen2016-02-291-1/+17
| | | | | | | | | | * src/process.c (Fdelete_process): Wait for async DNS to complete before freeing the data structures it needs.
* | Integer overflow cleanups for ports and socklenPaul Eggert2016-02-251-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/process.c (struct sockaddr_and_len, conv_sockaddr_to_lisp) (get_lisp_to_sockaddr_size, Fset_process_datagram_address) (connect_network_socket): Use ptrdiff_t, not int, for signed object sizes. This addresses only a theoretical problem, as in practice these object sizes are less than 2**31, but we might as well use the same style here as elsewhere in Emacs. (string_integer_p): Remove; all uses removed. (Fmake_network_process): Check that port number is in range. When converting an integer-string service, rely on strtol rather than rechecking the string by hand. * src/process.h, src/w32.c (conv_sockaddr_to_lisp): Adjust prototypes to match.
* | Allow using "number strings" as services on non-GNU systemsLars Ingebrigtsen2016-02-251-0/+15
| | | | | | | | | | | | | | * src/process.c (string_integer_p): New function. (Fmake_network_process): Use it to allow connecting to services specified as "993" even when getaddrbyname isn't available.
* | Make setting the coding system non-blockingLars Ingebrigtsen2016-02-241-14/+13
| | | | | | | | | | | | * src/process.c (Fset_process_filter_multibyte): Defer completing coding system setup in asynchronous processes. (Fset_process_coding_system): Ditto.
* | Port to --enable-gcc-warnings sans getaddrinfo_aPaul Eggert2016-02-231-5/+4
| | | | | | | | | | | | | | * src/process.c (Fmake_network_process): Add ATTRIBUTE_UNUSED to a local unused when getaddrinfo_a is missing. Resize portbuf to size needed. Do cheap test first. Move local to block where it’s needed.
* | Minor cleanups for async DNS etc.Paul Eggert2016-02-231-123/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED): Omit unnecessary parens. * src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit) (gnutls_verify_boot): Use bool for boolean. (ATTRIBUTE_FORMAT_PRINTF): Add printf attribute. * src/process.c (free_dns_request, Fmake_network_process): Allocate and free async request control block all in one go. (set_network_socket_coding_system, finish_after_tls_connection) (connect_network_socket): Now static. (conv_numerical_to_lisp): 2nd arg is now int, not unsigned. (Fmake_network_process): Use list1 for brevity. (wait_for_socket_fds): 2nd arg is now const ptr. * src/process.h (struct Lisp_Process.dns_request): Now struct gaicb *, not struct gaicb **, since there was always exactly one. All uses changed. * src/window.c, src/window.h (run_window_configuration_change_hook): Now static.
* | Fix async TLS boot problemLars Ingebrigtsen2016-02-221-1/+1
| | | | | | | | | | * src/process.c (wait_reading_process_output): Verify the boot of the correct process.
* | Clean up debugging codeLars Ingebrigtsen2016-02-221-4/+3
| | | | | | | | | | | | * src/process.c (Fmake_network_process): Remove debugging printf. (wait_for_socket_fds, wait_while_connecting) (wait_for_tls_negotiation): Remove newlines from messages.
* | add_to_log expects Lisp parametersfeature/async-dnsLars Ingebrigtsen2016-02-221-1/+1
| |
* | Mention in the doc strings that process functions may blockLars Ingebrigtsen2016-02-221-7/+26
| | | | | | | | | | | | | | | | (Fprocess_contact, Fprocess_datagram_address) (Fset_process_datagram_address, Fset_network_process_option) (Fprocess_send_region, Fprocess_send_string): Mention that the functions may block. (Fset_process_coding_system): Ditto.
* | Add blocker warnings to the *Messages* bufferLars Ingebrigtsen2016-02-221-3/+3
| | | | | | | | | | | | * src/process.c (wait_for_socket_fds): Add warning to the log. (wait_while_connecting): Ditto. (wait_for_tls_negotiation): Ditto.
* | Respect DNS timeoutsAlain Schneble2016-02-211-1/+1
| | | | | | | | | | | | * src/process.c (check_for_dns): If the async DNS request failed and the associated process is still in "connect" state, deactivate the process and set status to "failed".
* | Fix coding system setupLars Ingebrigtsen2016-02-191-7/+5
| | | | | | | | | | * src/process.c (set_network_socket_coding_system): Pass in the host/service that's been computed already.
* | Verify the TLS connection asynchronouslyLars Ingebrigtsen2016-02-181-1/+4
| | | | | | | | | | | | | | | | | | * src/gnutls.c (gnutls_verify_boot): Refactor out into its own function so that we can call it asynchronously. (Fgnutls_boot): Use it. * src/process.c (wait_reading_process_output): Verify the TLS negotiation.
* | Deactivate the correct processLars Ingebrigtsen2016-02-161-1/+1
| | | | | | | | | | * src/process.c (wait_reading_process_output): Deactivate the correct process on failure.
* | Implement asynch TLS negotiationLars Ingebrigtsen2016-02-161-47/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/gnutls.c (gnutls_try_handshake): Factor out into its own function. (emacs_gnutls_handshake): Use it. (emacs_gnutls_read): Just return instead of retrying the handshake. * src/process.c (finish_after_tls_connection): Factor out into its own function. (connect_network_socket): Use it. (wait_reading_process_output): Retry TLS handshakes. (wait_reading_process_output): Defer sentinel until TLS completes.
* | Simplify the DNS resolution loop a bitLars Ingebrigtsen2016-02-161-25/+10
| | | | | | | | | | * src/process.c (wait_reading_process_output): Simplify the DNS resolution loop a bit.
* | Loop over the process list instead of maintaining a separate listAlain Schneble2016-02-161-53/+33
| | | | | | | | | | | | | | * src/process.c: Remove declaration/definition of dns_processes list. * src/process.c (wait_reading_process_output): Loop over all processes in Vprocess_alist instead of dns_processes, to check for completed DNS requests.
* | Allow setting the filter masks laterLars Ingebrigtsen2016-02-161-15/+23
| | | | | | | | | | | | | | * src/process.c (Fset_process_filter): Don't set the socket masks here, because we may not have a socket yet. (set_process_filter_masks): New function. (connect_network_socket): Set the filter masks here.
* | Ensure we always free DNS resources when deleting a processLars Ingebrigtsen2016-02-161-12/+31
| | | | | | | | | | | | | | * src/process.c (free_dns_request): Factor out into own function. (Fdelete_process): When deleting a process, free any DNS structures associated with it. (check_for_dns): Always free all DNS resources.
* | Don't block in set-process-window-sizeAlain Schneble2016-02-161-4/+2
| | | | | | | | | | | | | | * src/process.c (set-process-window-size): Explicitly return Qnil when called with network processes as set_window_size won't work anyway on socket fds. As a welcome side effect, this makes the blocking wait_for_socket_fds call obsolete.
* | Do most of the coding system setup earlierLars Ingebrigtsen2016-02-161-3/+3
| | | | | | | | | | | | * src/process.c (Fmake_network_process): Set the read/write coding systems here, so that special bindings work. (Fmake_network_process): Complete the coding system setup here.
* | Protect against initial handshake failuresLars Ingebrigtsen2016-02-151-1/+2
| | | | | | | | | | | | * src/process.c (connect_network_socket): Mark the connection as failed if the handshake didn't succeed yet. This should be reworked later.
* | Call the network security manager after doing TLS negotiationLars Ingebrigtsen2016-02-151-35/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/network-stream.el (network-stream-open-tls): Postpone NSM verification when running async. * src/process.c (Fset_process_filter): This function doesn't need to wait. (connect_network_socket): Set the process status to "run" only after TLS negotiation. (wait_for_socket_fds): Take a name parameter for more debugging. (wait_reading_process_output): Don't change status to "run" unless TLS negotiation has finished. (send_process): Wait for the process here instead of send_process_string. (connect_network_socket): Call the network security manager.
* | Remove some #ifdefs and update documentationLars Ingebrigtsen2016-02-151-48/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Network Processes): Remove mention of `dns'. * lisp/net/network-stream.el (open-network-stream): Remove mention of `dns'. * src/process.c (Fset_process_filter) (Fset_process_window_size, Fprocess_contact) (Fprocess_datagram_address, Fset_process_datagram_address) (Fset_network_process_option, Fprocess_send_region) (Fprocess_send_string, Fset_process_coding_system) (Fset_process_filter_multibyte): Remove the #ifdef HAVE_GETADDRINFO_A checks. (Fprocess_send_string): Wait for TLS negotiation. (wait_for_tls_negotiation): New function. (send_process): Remove the TLS boot check. * src/process.c (Fmake_network_process): Ditto.
* | Add blockers to process functionsAlain Schneble2016-02-151-7/+84
| | | | | | | | | | | | | | | | | | | | | | | | * src/process.c (set-process-filter, set-process-window-size, process-contact, process-datagram-address, set-process-datagram-address, set-network-process-option): Make functions wait (block) on network process until pending DNS requests have been processed and associated socket initialized. * src/process.c (process-send-region, process-send-string, process-send-eof): Make functions wait (block) while network process is in connect state.
* | src/process.c Correctly convert AF_INET6 addressesDavid Edmondson2016-02-091-1/+1
| | | | | | | | | | | | | | | | * src/process.c (conv_lisp_to_sockaddr): AF_INET6 addresses are converted to a list of 16 bit quantities by conv_sockaddr_to_lisp(). conv_lisp_to_sockaddr() should follow the same scheme rather than expecting a (longer) list of 8 bit quantities.
* | Make url.el use async DNSLars Ingebrigtsen2016-02-051-0/+3
| | | | | | | | | | | | | | * lisp/url/url-gw.el (url-open-stream): Use non-blocking DNS. * src/process.c (syms_of_process): Add a `dns' subfeature for make-network-process.
* | Only do async DNS if requested with :nowait 'dnsLars Ingebrigtsen2016-02-051-7/+13
| | | | | | | | | | | | | | | | * 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'.
* | Add sanity check for checking async DNSLars Ingebrigtsen2016-02-051-0/+4
| | | | | | | | | | * src/process.c (check_for_dns): Disregard processes that have already been killed.
* | Doc fixes and refactorings based on comments from Eli ZaretskiiLars Ingebrigtsen2016-02-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Network Processes): Clarify the meaning of :tls-parameters. * lisp/net/gnutls.el (open-gnutls-stream): Clarify :nowait. * lisp/net/gnutls.el (gnutls-boot-parameters): Factor out into own function. (gnutls-negotiate): Use it. (open-gnutls-stream): Ditto. * src/eval.c (vformat_string): Refactor out the printing bits from verror. (verror): Use it. * src/gnutls.c (boot_error): Mark failed processes with the real error message. * src/lisp.h: Declare vformat_string.
* | Build fix for --enable-check-lisp-object-typeLars Ingebrigtsen2016-02-021-1/+1
| | | | | | | | | | * process.c (check_for_dns): Type fix reported by YAMAMOTO Mitsuharu.
* | Boot parameter check fixLars Ingebrigtsen2016-02-021-1/+1
| | | | | | | | | | * process.c (send_process): Fix test for boot parameters noted by Andy Moreton.
* | Style fixLars Ingebrigtsen2016-02-011-7/+8
| |
* | Return the correct server port numberLars Ingebrigtsen2016-02-011-0/+3
| | | | | | | | | | * process.c (connect_network_socket): Return the correct server port number.
* | Better async error reportingLars Ingebrigtsen2016-02-011-2/+10
| | | | | | | | | | | | * process.c (connect_network_socket): Mark failed processes with a better error message. (check_for_dns): Ditto.
* | Always boot TLS if given parametersLars Ingebrigtsen2016-02-011-11/+12
| | | | | | | | | | * src/process.c (connect_network_socket): If we have the TLS parameters, then boot the socket.
* | Add documentation for :tls-parametersLars Ingebrigtsen2016-02-011-0/+4
| | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Network Processes): Mention :tls-parameters. * src/process.c (Fmake_network_process): Document the :tls-parameters parameter.