[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #15125 [meek]: meek-client-wrapper does not use signals well



#15125: meek-client-wrapper does not use signals well
---------------------------+-----------------
     Reporter:  infinity0  |      Owner:  dcf
         Type:  defect     |     Status:  new
     Priority:  normal     |  Milestone:
    Component:  meek       |    Version:
   Resolution:             |   Keywords:
Actual Points:             |  Parent ID:
       Points:             |
---------------------------+-----------------

Comment (by infinity0):

 OK, I managed to get access to a Windows 7 machine, and this does what we
 want:

 {{{
 ' meek-browser-helper.vbs
 Dim ChildProc
 Set ChildProc = CreateObject("WScript.Shell").Exec(".\firefox.exe " & _
     "-no-remote -profile TorBrowser\Data\Browser\profile.meek-http-
 helper")

 WScript.StdOut.WriteLine(ChildProc.StdOut.ReadLine)

 Do While Not WScript.StdIn.AtEndOfStream
    WScript.StdIn.Skip(1)
 Loop

 ChildProc.Terminate()
 }}}

 If you close stdin, it terminates firefox gracefully as possible
 (`WM_CLOSE`; wait; `ProcessTerminate`) - https://msdn.microsoft.com/en-
 us/library/yk84ffsf.aspx

 Unfortunately it must be run as `cscript X.vbs` rather than as `X.vbs`
 which on most Windows systems would run `wscript` not `cscript`, and the
 former does not have `StdIn`. There is no way to override this on a per-
 script basis; the closest thing I found online is to do "if we're not
 being run by cscript, run ourselves using cscript" but this doesn't work
 for our purposes because it doesn't provide a way to pass stdout back to
 the calling process.

 It does not seem feasible to do the equivalent behaviour from a `.bat`
 file either. :(

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15125#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs