1. 16 Feb, 2016 4 commits
    • Lars Ingebrigtsen's avatar
      Allow setting the filter masks later · 9755b753
      Lars Ingebrigtsen authored
      * 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.
    • Lars Ingebrigtsen's avatar
      Ensure we always free DNS resources when deleting a process · df911734
      Lars Ingebrigtsen authored
      * 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.
    • Alain Schneble's avatar
      Don't block in set-process-window-size · e4324bdf
      Alain Schneble authored
      * 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.
    • Lars Ingebrigtsen's avatar
      Do most of the coding system setup earlier · 7f3441cc
      Lars Ingebrigtsen authored
      * 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.
  2. 15 Feb, 2016 4 commits
    • Lars Ingebrigtsen's avatar
      Protect against initial handshake failures · 2d7af7e2
      Lars Ingebrigtsen authored
      * src/process.c (connect_network_socket): Mark the connection
      as failed if the handshake didn't succeed yet.  This should be
      reworked later.
    • Lars Ingebrigtsen's avatar
      Call the network security manager after doing TLS negotiation · 9c74f2fe
      Lars Ingebrigtsen authored
      * 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
      (connect_network_socket): Call the network security manager.
    • Lars Ingebrigtsen's avatar
      Remove some #ifdefs and update documentation · 40155283
      Lars Ingebrigtsen authored
      * 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.
    • Alain Schneble's avatar
      Add blockers to process functions · c740d190
      Alain Schneble authored
      * 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.
  3. 09 Feb, 2016 1 commit
    • David Edmondson's avatar
      src/process.c Correctly convert AF_INET6 addresses · 51d728c8
      David Edmondson authored
      * 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
  4. 05 Feb, 2016 3 commits
  5. 03 Feb, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Doc fixes and refactorings based on comments from Eli Zaretskii · 894e21df
      Lars Ingebrigtsen authored
      * 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.
  6. 02 Feb, 2016 2 commits
  7. 01 Feb, 2016 9 commits
  8. 31 Jan, 2016 4 commits
    • Lars Ingebrigtsen's avatar
      Further TLS async work · 4ff81f8f
      Lars Ingebrigtsen authored
      * gnutls.c (boot_error): New function to either signal an
      error or return an error code.
      (Fgnutls_boot): Don't signal errors when running asynchronously.
      * process.h (pset_status): Move here from process.c to be
      able to use from gnutls.c.
      * process.c (connect_network_socket): Do the TLS boot here
      when running asynchronously.
      (wait_reading_process_output): Rework the dns_processes
      handling for more safety.
    • Lars Ingebrigtsen's avatar
      Rework the mechanisms for async GnuTLS connections · cecf6c9a
      Lars Ingebrigtsen authored
      * lisp/net/gnutls.el (open-gnutls-stream): Compute the
      gnutls-boot parameters and pass them to the process object.
      (gnutls-negotiate): New parameter :return-keywords that won't
      connect to anything, just compute the keywords.
      * lisp/url/url-http.el (url-http): Revert async TLS sentinel
      hack, which is no longer necessary.
      * src/gnutls.c (Fgnutls_asynchronous_parameters): Rename from
      * src/process.c (connect_network_socket): If we're connecting to
      an asynchronous TLS socket, complete the GnuTLS boot sequence here.
      * src/process.h: New parameter gnutls_async_parameters.
    • Lars Ingebrigtsen's avatar
      Fix segfault from double free · 1f71df7a
      Lars Ingebrigtsen authored
      * process.c (check_for_dns): Protect against double free
    • Lars Ingebrigtsen's avatar
      Implement asynchronous GnuTLS connections · 0f47153b
      Lars Ingebrigtsen authored
      * doc/misc/emacs-gnutls.texi (Help For Developers): Mention
      the nowait parameter.
      * lisp/net/gnutls.el (open-gnutls-stream): Allow asynchronous
      connections with the new nowait parameter.
      * lisp/net/network-stream.el (network-stream-open-tls): Pass
      on :nowait to open-gnutls-stream.
      * lisp/url/url-http.el (url-http): Don't overwrite the
      sentinel created by open-gnutls-stream.
      * src/gnutls.c (Fgnutls_mark_process): New function.
      * src/process.c (send_process): Don't write to GnuTLS sockets that
      haven't been initialised yed.
      * src/process.h: New slot gnutls_wait_p.
  9. 30 Jan, 2016 11 commits
  10. 29 Jan, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Implement asynchronous name resolution · fdfb6869
      Lars Ingebrigtsen authored
      * process.c (Fmake_network_process): Do asynchronous DNS
      lookups if we have getaddrinfo_a and the user requests :nowait.
      (check_for_dns): New function.
      (wait_reading_process_output): Check for pending name
      resolution in the idle loop.
      * process.h: Add structure for async DNS.