emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network security manager


From: Lars Magne Ingebrigtsen
Subject: Re: Network security manager
Date: Fri, 21 Nov 2014 12:12:04 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.51 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Sorry, I don't follow: doesn't the code run from a process filter?  If
> not, what do you mean by "asynchronously" here?

It depends on what you mean by "the code".  This is a call to
`url-retrieve':

(url-retrieve "https://google.com"; (lambda (&rest) (application-code)))

It's the same code used "interactively" (i.e., saying `M-x eww') as when
eww is inserting images into the buffer after it's been generated (this
is the really asynchronous bits where we don't want any prompting in
eww, because it's just too annoying).

The prompting we're talking about here is done from
`nsm-verify-connection'.  This is the stack trace for `M-x eww RET
https://google.com', and it's synchronous, and prompting is a-ok:

Debugger entered--entering a function:
* nsm-verify-connection(#<process google.com> "google.com" 443)
  network-stream-open-tls("google.com" #<buffer  *url-http-temp*> "google.com" 
443 (:type tls :nowait t))
  open-network-stream("google.com" #<buffer  *url-http-temp*> "google.com" 443 
:type tls :nowait t)

[...]

  url-retrieve("https://google.com/"; eww-render ("https://google.com/";))
  eww("https://google.com";)
  call-interactively(eww record nil)
  command-execute(eww record)
  execute-extended-command(nil "eww")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

But then, since we get a redirect to www.google.com, we get a new
`open-network-stream':

Debugger entered--entering a function:
* nsm-verify-connection(#<process www.google.no> "www.google.no" 443)
  network-stream-open-tls("www.google.no" #<buffer  *url-http-temp*> 
"www.google.no" 443 (:type tls :nowait t))
  open-network-stream("www.google.no" #<buffer  *url-http-temp*> 
"www.google.no" 443 :type tls :nowait t)

[...]

  url-http-content-length-after-change-function(221 479 258)
  url-http-wait-for-headers-change-function(1 487 486)
  url-http-generic-filter()

And that one is asynchronous, but should (in this instance) also be
allowed to prompt, since a redirect is an implementation detail the user
shouldn't know or care about.

But now we're asynchronous mode, and the user may have decided to do
something else where prompting would be ungood.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]