Lines Matching +full:no +full:- +full:read +full:- +full:rollover
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
18 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
43 #include "tftp-file.h"
44 #include "tftp-io.h"
45 #include "tftp-utils.h"
46 #include "tftp-options.h"
47 #include "tftp-transfer.h"
71 ts->amount = 0; in tftp_send()
86 return -1; in tftp_send()
100 return -1; in tftp_send()
117 return -1; in tftp_send()
124 ts->retries++; in tftp_send()
130 return -1; in tftp_send()
137 /* Either read failure or ERROR packet */ in tftp_send()
141 return -1; in tftp_send()
143 if (rp->th_opcode == ACK) { in tftp_send()
149 if (rp->th_block == window[i].block) in tftp_send()
158 rp->th_block); in tftp_send()
160 /* Re-synchronize with the other side */ in tftp_send()
164 ts->retries++; in tftp_send()
170 return -1; in tftp_send()
184 ts->blocks++; in tftp_send()
185 ts->amount += window[j].size; in tftp_send()
190 * un-ACKed block. in tftp_send()
202 return -1; in tftp_send()
206 ts->retries++; in tftp_send()
219 * "rollover" option not specified in in tftp_send()
228 ts->rollovers++; in tftp_send()
230 gettimeofday(&(ts->tstop), NULL); in tftp_send()
238 * - It could be that the first block has already arrived while
251 ts->amount = 0; in tftp_receive()
255 writesize = write_file(firstblock->th_data, fb_size); in tftp_receive()
256 ts->amount += writesize; in tftp_receive()
257 ts->blocks++; in tftp_receive()
267 return -1; in tftp_receive()
281 gettimeofday(&(ts->tstop), NULL); in tftp_receive()
293 * "rollover" option not specified in in tftp_receive()
302 ts->rollovers++; in tftp_receive()
318 return -1; in tftp_receive()
329 /* Either read failure or ERROR packet */ in tftp_receive()
333 return -1; in tftp_receive()
335 if (rp->th_opcode == DATA) { in tftp_receive()
336 ts->blocks++; in tftp_receive()
338 if (rp->th_block == *block) in tftp_receive()
346 * blocks during a rollover as in tftp_receive()
351 windowstart = *block - windowsize; in tftp_receive()
354 if (rp->th_block > windowstart && in tftp_receive()
355 rp->th_block < *block) { in tftp_receive()
359 rp->th_block); in tftp_receive()
367 *block, rp->th_block); in tftp_receive()
369 /* Re-synchronize with the other side */ in tftp_receive()
374 ts->retries++; in tftp_receive()
380 packettype(rp->th_opcode)); in tftp_receive()
385 writesize = write_file(rp->th_data, n_data); in tftp_receive()
386 ts->amount += writesize; in tftp_receive()
394 return -1; in tftp_receive()
413 return -1; in tftp_receive()
427 gettimeofday(&(ts->tstop), NULL); in tftp_receive()
436 NULL, -timeoutpacket); in tftp_receive()
440 rp->th_opcode == DATA && /* and got a data block */ in tftp_receive()
441 *block == rp->th_block) /* then my last ack was lost */ in tftp_receive()