{
char *ret, *hn = para_hostname();
ret = make_message("%s1.0\nHost: %s\nUser-Agent: para_recv/%s\n\n\n",
- HTTP_GET_MSG, hn, VERSION);
+ HTTP_GET_MSG, hn, PACKAGE_VERSION);
free(hn);
return ret;
}
PARA_NOTICE_LOG("connecting to %s:%d\n", conf->host_arg,
conf->port_arg);
ret = para_connect(phd->fd, &their_addr);
- if (ret < 0)
+ if (ret < 0) {
+ close(phd->fd);
goto err_out;
+ }
mark_fd_nonblock(phd->fd);
phd->status = HTTP_CONNECTED;
return 1;