Glad you were not seriously hurt.
Tried a few things over the years but the best vicious dog stopper I have found is a law enforcement grade pepper spray called "Punch 2."
The water based, solid stream version has a range of over 25. ft (yes, a full 25 feet) and the 4 oz. can, can easily be mounted to the bars or stem for quick access but is small enough to be almost unnoticeable. It is available in many gun shops that cater to a lot of law enforcement people.
http://www.aerko.com/Punch%20II.htm
Even a trace hit on a dogs face at max range causes a reaction similar to it being hit with a flame thrower. Lots of yelping, dog scurries away with tail between legs and stays away. It will also be unlikely to come after you again, or some poor little kids that has no pepper spray.
I have a great love for dogs but an even greater hatred for emergency rooms and sutures.
In a pinch, pepper spray works well on bad people too.