upstream changes from latest tornado (3.1.1)
Merge pull request #415 from minrk/tornado-upstream

upstream changes from latest tornado (3.1.1)