[tor-bugs] #15125 [Obfuscation/meek]: meek-client-torbrowser does not use signals well

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Apr 30 16:06:15 UTC 2019


#15125: meek-client-torbrowser does not use signals well
------------------------------+------------------------------
 Reporter:  infinity0         |          Owner:  dcf
     Type:  defect            |         Status:  needs_review
 Priority:  Medium            |      Milestone:
Component:  Obfuscation/meek  |        Version:
 Severity:  Normal            |     Resolution:
 Keywords:                    |  Actual Points:
Parent ID:                    |         Points:
 Reviewer:  cohosh            |        Sponsor:
------------------------------+------------------------------

Comment (by cohosh):

 Looks good!

 Is there a reason to have four separate if statements here
 {{{
         if firefoxCmd != nil {
                 wg.Add(1)
         }
         if meekClientCmd != nil {
                 wg.Add(1)
         }
         if firefoxCmd != nil {
                 go func() {
                         err := terminateCmd(firefoxCmd)
                         // We terminate Firefox with SIGTERM, so don't log
 an
                         // error if the exit status is "terminated by
 SIGTERM."
                         ...
                         wg.Done()
                 }()
         }
         if meekClientCmd != nil {
                 go func() {
                     ...
         }
         wg.Wait()
 }}}
 instead of doing
 {{{
         if firefoxCmd != nil {
                 wg.Add(1)
                 go func() {
                         err := terminateCmd(firefoxCmd)
                         // We terminate Firefox with SIGTERM, so don't log
 an
                         // error if the exit status is "terminated by
 SIGTERM."
                         ...
                         wg.Done()
                 }()
         }
         if meekClientCmd != nil {
                 wg.Add(1)
                 go func() {
                     ...
         }
         wg.Wait()

 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15125#comment:14>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list