httpd.write_response capture socket error