fixed performance issues with timeout=0
Merge pull request #1 from linohh/master

Fixed performance issues with timeout = 0