How to protect yourself from dog attacks: so far, we have heard gun, whips, cattle prods.
After I was attached by a pit bull, I put the question to my local animal control department. Their suggestions:
(1) A citronella-based spray is what their agents use.
(2) A long stick. They said that few dogs will go past the end of a stick that is pointed at them.
Luckily, I got off with only only a couple of deep puncture wounds. The dog snapped at my thigh but did not hang on in the usual pit-bull manner. By shouting, I kept the dog away until the owner could run up with the "He's never done that before," story.