~ubuntu-branches/ubuntu/vivid/burp/vivid-proposed

« back to all changes in this revision

Viewing changes to src/backup_phase2_server.c

  • Committer: Package Import Robot
  • Author(s): Bastiaan Franciscus van den Dikkenberg
  • Date: 2012-02-27 17:01:35 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120227170135-on2z4842wv2ppmrm
Tags: 1.3.1-1
* New upstream release version 1.3.1
  -fixes respect noopt in DEB_BUILD_OPTIONS. (Closes: #661281)
* Switched to Standards-Version 3.9.3 Debian bug: (Closes: #661001)
* Fixed typo in logrotate script Debian bug: (Closes: #660964)
* added debug package Debian bug: (Closes: #661267)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
//logp("start to receive: %s\n", sb->path);
22
22
 
 
23
        mk_dpth(dpth, cconf, sb->cmd);
23
24
        if(!(sb->datapth=strdup(dpth->path))) // file data path
24
25
        {
25
26
                log_and_send("out of memory");
46
47
        return (cmd==CMD_FILE
47
48
          || cmd==CMD_ENC_FILE
48
49
          || cmd==CMD_METADATA
49
 
          || cmd==CMD_ENC_METADATA);
 
50
          || cmd==CMD_ENC_METADATA
 
51
          || cmd==CMD_EFS_FILE);
50
52
}
51
53
 
52
54
static int process_changed_file(struct sbuf *cb, struct sbuf *p1b, const char *currentdata, struct cntr *cntr)
179
181
        {
180
182
                int oldcompressed=0;
181
183
 
 
184
                // If the file type changed, I think it is time to back it
 
185
                // up again (for example, EFS changing to normal file, or
 
186
                // back again).
 
187
                if(cb->cmd!=p1b->cmd)
 
188
                        return process_new_file(cb, p1b, p2fp, ucfp, cntr);
 
189
 
182
190
                // mtime is the actual file data.
183
191
                // ctime is the attributes or meta data.
184
192
                if(cb->statp.st_mtime==p1b->statp.st_mtime
185
193
                  && cb->statp.st_ctime==p1b->statp.st_ctime)
186
194
                {
187
195
                        // got an unchanged file
188
 
                        //logp("got unchanged file: %s\n", cb->path);
 
196
                        logp("got unchanged file: %s %c %c\n", cb->path, cb->cmd, p1b->cmd);
189
197
                        return process_unchanged_file(cb, ucfp, cntr);
190
198
                }
191
199
 
199
207
                          || p1b->cmd==CMD_ENC_METADATA
200
208
                        // TODO: make unencrypted metadata use the librsync
201
209
                          || cb->cmd==CMD_METADATA
202
 
                          || p1b->cmd==CMD_METADATA)
 
210
                          || p1b->cmd==CMD_METADATA
 
211
                          || cb->cmd==CMD_EFS_FILE
 
212
                          || p1b->cmd==CMD_EFS_FILE)
203
213
                                return process_new_file(cb,
204
214
                                        p1b, p2fp, ucfp, cntr);
205
215
                        else
216
226
                  || p1b->cmd==CMD_ENC_FILE
217
227
                  || cb->cmd==CMD_ENC_METADATA
218
228
                  || p1b->cmd==CMD_ENC_METADATA
 
229
                  || cb->cmd==CMD_EFS_FILE
 
230
                  || p1b->cmd==CMD_EFS_FILE
219
231
                // TODO: make unencrypted metadata use the librsync
220
232
                  || cb->cmd==CMD_METADATA
221
233
                  || p1b->cmd==CMD_METADATA)
466
478
                        rb->slen=rlen;
467
479
                        rbuf=NULL;
468
480
                }
469
 
                else if(rcmd==CMD_FILE
470
 
                  || rcmd==CMD_ENC_FILE
471
 
                  || rcmd==CMD_METADATA
472
 
                  || rcmd==CMD_ENC_METADATA)
 
481
                else if(filedata(rcmd))
473
482
                {
474
483
                        rb->cmd=rcmd;
475
484
                        rb->plen=rlen;
569
578
        if(!(p2fp=open_file(phase2data, "r+b")))
570
579
                goto error;
571
580
 
572
 
        if(resume && do_resume(p1zp, p2fp, ucfp, *cmanfp, dpth, cconf,
573
 
                p1cntr, cntr))
 
581
        if(resume && do_resume(p1zp, p2fp, ucfp, dpth, cconf, p1cntr, cntr))
574
582
                        goto error;
575
583
 
576
584
        logp("Begin phase2 (receive file data)\n");