[BACK]Return to sender.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rsync

Diff for /src/usr.bin/rsync/sender.c between version 1.9 and 1.10

version 1.9, 2019/02/16 16:58:39 version 1.10, 2019/02/16 16:59:34
Line 120 
Line 120 
         /* Validate the index. */          /* Validate the index. */
   
         if (idx < 0 || (uint32_t)idx >= flsz) {          if (idx < 0 || (uint32_t)idx >= flsz) {
                 ERRX(sess, "file index out of bounds: invalid %"                  ERRX(sess, "file index out of bounds: invalid %"
                         PRId32 " out of %zu", idx, flsz);                          PRId32 " out of %zu", idx, flsz);
                 return 0;                  return 0;
         } else if (S_ISDIR(fl[idx].st.mode)) {          } else if (S_ISDIR(fl[idx].st.mode)) {
Line 145 
Line 145 
         s->blks = NULL;          s->blks = NULL;
         TAILQ_INSERT_TAIL(q, s, entries);          TAILQ_INSERT_TAIL(q, s, entries);
   
         /*          /*
          * This blocks til the full blockset has been read.           * This blocks til the full blockset has been read.
          * That's ok, because the most important thing is getting data           * That's ok, because the most important thing is getting data
          * off the wire.           * off the wire.
Line 257 
Line 257 
                 }                  }
         }          }
   
         /*          /*
          * Set up our poll events.           * Set up our poll events.
          * We start by polling only in receiver requests, enabling other           * We start by polling only in receiver requests, enabling other
          * poll events on demand.           * poll events on demand.
Line 302 
Line 302 
                                 if (!io_read_int(sess, fdin, &idx)) {                                  if (!io_read_int(sess, fdin, &idx)) {
                                         ERRX1(sess, "io_read_int");                                          ERRX1(sess, "io_read_int");
                                         goto out;                                          goto out;
                                 }                                  }
                                 if (!send_dl_enqueue(sess,                                  if (!send_dl_enqueue(sess,
                                     &sdlq, idx, fl, flsz, fdin)) {                                      &sdlq, idx, fl, flsz, fdin)) {
                                         ERRX1(sess, "send_dl_enqueue");                                          ERRX1(sess, "send_dl_enqueue");
Line 407 
Line 407 
                                  * put is in the token phase.                                   * put is in the token phase.
                                  */                                   */
   
                                 sz = MIN(MAX_CHUNK,                                  sz = MIN(MAX_CHUNK,
                                         up.stat.curlen - up.stat.curpos);                                          up.stat.curlen - up.stat.curpos);
                                 if (!io_lowbuffer_alloc(sess, &wbuf,                                  if (!io_lowbuffer_alloc(sess, &wbuf,
                                     &wbufsz, &wbufmax, sizeof(int32_t))) {                                      &wbufsz, &wbufmax, sizeof(int32_t))) {
                                         ERRX1(sess, "io_lowbuffer_alloc");                                          ERRX1(sess, "io_lowbuffer_alloc");
                                         goto out;                                          goto out;
                                 }                                  }
                                 io_lowbuffer_int(sess,                                  io_lowbuffer_int(sess,
                                         wbuf, &pos, wbufsz, sz);                                          wbuf, &pos, wbufsz, sz);
                                 if (!io_lowbuffer_alloc(sess, &wbuf,                                  if (!io_lowbuffer_alloc(sess, &wbuf,
                                     &wbufsz, &wbufmax, sz)) {                                      &wbufsz, &wbufmax, sz)) {
                                         ERRX1(sess, "io_lowbuffer_alloc");                                          ERRX1(sess, "io_lowbuffer_alloc");
                                         goto out;                                          goto out;
                                 }                                  }
                                 io_lowbuffer_buf(sess, wbuf, &pos, wbufsz,                                  io_lowbuffer_buf(sess, wbuf, &pos, wbufsz,
                                         up.stat.map + up.stat.curpos, sz);                                          up.stat.map + up.stat.curpos, sz);
                                 up.stat.curpos += sz;                                  up.stat.curpos += sz;
                                 if (up.stat.curpos == up.stat.curlen)                                  if (up.stat.curpos == up.stat.curlen)
Line 455 
Line 455 
   
                                 hash_file(up.stat.map,                                  hash_file(up.stat.map,
                                         up.stat.mapsz, filemd, sess);                                          up.stat.mapsz, filemd, sess);
                                 if (!io_lowbuffer_alloc(sess, &wbuf,                                  if (!io_lowbuffer_alloc(sess, &wbuf,
                                     &wbufsz, &wbufmax, MD4_DIGEST_LENGTH)) {                                      &wbufsz, &wbufmax, MD4_DIGEST_LENGTH)) {
                                         ERRX1(sess, "io_lowbuffer_alloc");                                          ERRX1(sess, "io_lowbuffer_alloc");
                                         goto out;                                          goto out;
Line 473 
Line 473 
                                 LOG3(sess, "%s: flushed %jd KB total, "                                  LOG3(sess, "%s: flushed %jd KB total, "
                                         "%.2f%% uploaded",                                          "%.2f%% uploaded",
                                         fl[up.cur->idx].path,                                          fl[up.cur->idx].path,
                                         (intmax_t)up.stat.total / 1024,                                          (intmax_t)up.stat.total / 1024,
                                         100.0 * up.stat.dirty / up.stat.total);                                          100.0 * up.stat.dirty / up.stat.total);
                                 send_up_reset(&up);                                  send_up_reset(&up);
                         } else if (NULL != up.cur && up.cur->idx < 0) {                          } else if (NULL != up.cur && up.cur->idx < 0) {
Line 496 
Line 496 
                                 }                                  }
                                 send_up_reset(&up);                                  send_up_reset(&up);
   
                                 /*                                  /*
                                  * This is where we actually stop the                                   * This is where we actually stop the
                                  * algorithm: we're already at the                                   * algorithm: we're already at the
                                  * second phase.                                   * second phase.
Line 529 
Line 529 
                                     up.cur->blks, up.cur->idx)) {                                      up.cur->blks, up.cur->idx)) {
                                         ERRX1(sess, "blk_recv_ack");                                          ERRX1(sess, "blk_recv_ack");
                                         goto out;                                          goto out;
                                 }                                  }
                                 LOG3(sess, "%s: primed for %jd B total",                                  LOG3(sess, "%s: primed for %jd B total",
                                         fl[up.cur->idx].path,                                          fl[up.cur->idx].path,
                                         (intmax_t)up.cur->blks->size);                                          (intmax_t)up.cur->blks->size);
Line 576 
Line 576 
   
                         TAILQ_REMOVE(&sdlq, up.cur, entries);                          TAILQ_REMOVE(&sdlq, up.cur, entries);
   
                         /*                          /*
                          * End of phase: enable channel to receiver.                           * End of phase: enable channel to receiver.
                          * We'll need our output buffer enabled in order                           * We'll need our output buffer enabled in order
                          * to process this event.                           * to process this event.
Line 587 
Line 587 
                                 continue;                                  continue;
                         }                          }
   
                         /*                          /*
                          * Non-blocking open of file.                           * Non-blocking open of file.
                          * This will be picked up in the state machine                           * This will be picked up in the state machine
                          * block of not being primed.                           * block of not being primed.

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10