fix timeout 0

timeout 0 would NOT timeout, but nothing happened
url-encode tmpl allow inputting encoded contents