From 5a8fc22727bc20624dd915f1e6fd805ba5e0f85f Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Thu, 29 Aug 2013 16:47:14 -0400 Subject: Remove complicated remote file descriptor code Only handle one file transfer at a time so we don't need an array to track multiple transfers or know the remote's fd number. Loop in recv_packet until we read a whole packet. --- qarsh_packet.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'qarsh_packet.c') diff --git a/qarsh_packet.c b/qarsh_packet.c index 945db6b..d6a45a1 100644 --- a/qarsh_packet.c +++ b/qarsh_packet.c @@ -319,7 +319,6 @@ void parse_qp_sendfile(char *buf, int *buflen, struct qa_packet *qp) { buf = fetch_string(buf, buflen, &(qp->qp_sendfile.qp_path)); - buf = fetch_int(buf, buflen, &(qp->qp_sendfile.qp_remfd)); } void @@ -485,7 +484,6 @@ char * store_qp_sendfile(char *buf, struct qa_packet *qp) { buf = store_string(buf, qp->qp_sendfile.qp_path); - buf = store_int(buf, qp->qp_sendfile.qp_remfd); return buf; } @@ -660,7 +658,7 @@ make_qp_recvfile(const char *path, off_t count, mode_t mode) } struct qa_packet * -make_qp_sendfile(const char *path, int remfd) +make_qp_sendfile(const char *path) { struct qa_packet *qp; qp = malloc(sizeof *qp); @@ -669,7 +667,6 @@ make_qp_sendfile(const char *path, int remfd) qp->qp_type = QP_SENDFILE; qp->qp_sendfile.qp_path = strdup(path); - qp->qp_sendfile.qp_remfd = remfd; return qp; } @@ -852,8 +849,8 @@ dump_qp_recvfile(struct qa_packet *qp) void dump_qp_sendfile(struct qa_packet *qp) { - fprintf(stderr, "path: %s remfd: %d", - qp->qp_sendfile.qp_path, qp->qp_sendfile.qp_remfd); + fprintf(stderr, "path: %s", + qp->qp_sendfile.qp_path); } void -- cgit