Skip to content

Commit

Permalink
pac interface change
Browse files Browse the repository at this point in the history
  • Loading branch information
yinghuocho committed May 8, 2016
1 parent 0491f77 commit d513e23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ func (c *fireflyClient) _main() {
}
pacURL := c.ui.handle(pacFilename(), pacHandler(c.httpListener.Addr().String()))
enablePAC(pacURL)
c.addExitFunc(disablePAC)
c.addExitFunc(func() {
disablePAC(pacURL)
})

// systray
c.addExitFunc(systray.Quit)
Expand Down
4 changes: 2 additions & 2 deletions client/pac.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func enablePAC(pacURL string) {
atomic.StoreInt32(&isPACOn, 1)
}

func disablePAC() {
func disablePAC(pacURL string) {
if atomic.CompareAndSwapInt32(&isPACOn, 1, 0) {
log.Printf("Unsetting firefly as system proxy")
err := pac.Off()
err := pac.Off(pacURL)
if err != nil {
log.Printf("Unable to unset firefly as system proxy: %s", err)
}
Expand Down

0 comments on commit d513e23

Please sign in to comment.