Commit 66057123 authored by Mike Hibler's avatar Mike Hibler

Fix uploader timeout code. Was not being properly detected.

parent c7c7cec8
/* /*
* Copyright (c) 2010-2014 University of Utah and the Flux Group. * Copyright (c) 2010-2015 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -277,10 +277,7 @@ recv_file() ...@@ -277,10 +277,7 @@ recv_file()
cc = remaining; cc = remaining;
ncc = conn_read(conn, wbuf, cc); ncc = conn_read(conn, wbuf, cc);
if (ncc < 0) { if (ncc < 0) {
if (conn_timeout(conn)) FrisPwarning("socket read");
rv = 2;
else
FrisPwarning("socket read");
goto done; goto done;
} }
if (ncc == 0) if (ncc == 0)
...@@ -297,8 +294,11 @@ recv_file() ...@@ -297,8 +294,11 @@ recv_file()
goto done; goto done;
} }
} }
/* Note that coming up short (remaining > 0) is not an error */ /*
rv = 0; * Note that coming up short (remaining > 0) is not an error
* unless we timed out.
*/
rv = conn_timeout(conn) ? 2 : 0;
done: done:
gettimeofday(&et, NULL); gettimeofday(&et, NULL);
......
...@@ -577,10 +577,7 @@ send_file(void) ...@@ -577,10 +577,7 @@ send_file(void)
cc = conn_write(conn, rbuf, ncc); cc = conn_write(conn, rbuf, ncc);
if (cc < 0) { if (cc < 0) {
if (conn_timeout(conn)) FrisPwarning("socket write");
rv = 2;
else
FrisPwarning("socket write");
goto done; goto done;
} }
remaining -= cc; remaining -= cc;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment