projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
osx_write.c: Add doxygen description for struct private_osx_write_data
[paraslash.git]
/
http_recv.c
diff --git
a/http_recv.c
b/http_recv.c
index
0965416
..
c418af1
100644
(file)
--- a/
http_recv.c
+++ b/
http_recv.c
@@
-87,7
+87,7
@@
static char *make_request_msg(void)
{
char *ret, *hn = para_hostname();
ret = make_message("%s1.0\nHost: %s\nUser-Agent: para_recv/%s\n\n\n",
{
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;
}
free(hn);
return ret;
}
@@
-121,7
+121,7
@@
static void http_recv_post_select(struct sched *s, struct task *t)
if (!FD_ISSET(phd->fd, &s->wfds))
goto out;
rq = make_request_msg();
if (!FD_ISSET(phd->fd, &s->wfds))
goto out;
rq = make_request_msg();
- PARA_
NOTICE
_LOG("%s", "sending http request\n");
+ PARA_
INFO
_LOG("%s", "sending http request\n");
t->ret = send_va_buffer(phd->fd, "%s", rq);
free(rq);
if (t->ret > 0)
t->ret = send_va_buffer(phd->fd, "%s", rq);
free(rq);
if (t->ret > 0)
@@
-134,7
+134,7
@@
static void http_recv_post_select(struct sched *s, struct task *t)
t->ret = recv_pattern(phd->fd, HTTP_OK_MSG, MAXLINE);
if (t->ret < 0)
goto out;
t->ret = recv_pattern(phd->fd, HTTP_OK_MSG, MAXLINE);
if (t->ret < 0)
goto out;
- PARA_
NOTICE
_LOG("%s", "received ok msg, streaming\n");
+ PARA_
INFO
_LOG("%s", "received ok msg, streaming\n");
t->ret = 1;
phd->status = HTTP_STREAMING;
goto out;
t->ret = 1;
phd->status = HTTP_STREAMING;
goto out;
@@
-184,7
+184,6
@@
static int http_recv_open(struct receiver_node *rn)
rn->buf = para_calloc(BUFSIZE);
rn->private_data = para_calloc(sizeof(struct private_http_recv_data));
phd = rn->private_data;
rn->buf = para_calloc(BUFSIZE);
rn->private_data = para_calloc(sizeof(struct private_http_recv_data));
phd = rn->private_data;
- PARA_NOTICE_LOG("phd = %p, rn = %p\n", phd, rn);
ret = get_host_info(conf->host_arg, &he);
if (!ret < 0)
goto err_out;
ret = get_host_info(conf->host_arg, &he);
if (!ret < 0)
goto err_out;
@@
-199,8
+198,10
@@
static int http_recv_open(struct receiver_node *rn)
PARA_NOTICE_LOG("connecting to %s:%d\n", conf->host_arg,
conf->port_arg);
ret = para_connect(phd->fd, &their_addr);
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;
goto err_out;
+ }
mark_fd_nonblock(phd->fd);
phd->status = HTTP_CONNECTED;
return 1;
mark_fd_nonblock(phd->fd);
phd->status = HTTP_CONNECTED;
return 1;