MCPcopy Create free account
hub / github.com/RsyncProject/rsync / whine_about_eof

Function whine_about_eof

io.c:217–233  ·  view source on GitHub ↗

It's almost always an error to get an EOF when we're trying to read from the * network, because the protocol is (for the most part) self-terminating. * * There is one case for the receiver when it is at the end of the transfer * (hanging around reading any keep-alive packets that might come its way): if * the sender dies before the generator's kill-signal comes through, we can end * up here

Source from the content-addressed store, hash-verified

215 * listing was not terminated, so we must ignore an EOF error in that case and
216 * exit. In this situation, kluge_around_eof will be > 0. */
217static NORETURN void whine_about_eof(BOOL allow_kluge)
218{
219 if (kluge_around_eof && allow_kluge) {
220 int i;
221 if (kluge_around_eof > 0)
222 exit_cleanup(0);
223 /* If we're still here after 10 seconds, exit with an error. */
224 for (i = 10*1000/20; i--; )
225 msleep(20);
226 }
227
228 rprintf(FERROR, RSYNC_NAME ": connection unexpectedly closed "
229 "(%s bytes received so far) [%s]\n",
230 big_num(stats.total_read), who_am_i());
231
232 exit_cleanup(RERR_STREAMIO);
233}
234
235/* Do a safe read, handling any needed looping and error handling.
236 * Returns the count of the bytes read, which will only be different

Callers 2

perform_ioFunction · 0.85
read_bufFunction · 0.85

Calls 4

msleepFunction · 0.85
big_numFunction · 0.85
rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected