[tor-commits] [tor/release-0.2.6] Extract main part of main loop into a separate function