add comment
handle accept failure correctly
minor bug fix

remove: log from read_all_text