| OLD | NEW |
| 1 /* | 1 /* |
| 2 bsdiff.c -- Binary patch generator. | 2 bsdiff.c -- Binary patch generator. |
| 3 | 3 |
| 4 Copyright 2003 Colin Percival | 4 Copyright 2003 Colin Percival |
| 5 | 5 |
| 6 For the terms under which this work may be distributed, please see | 6 For the terms under which this work may be distributed, please see |
| 7 the adjoining file "LICENSE". | 7 the adjoining file "LICENSE". |
| 8 | 8 |
| 9 ChangeLog: | 9 ChangeLog: |
| 10 2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit | 10 2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 << (base::Time::Now() - q_start_time).InSecondsF(); | 225 << (base::Time::Now() - q_start_time).InSecondsF(); |
| 226 V.reset(); | 226 V.reset(); |
| 227 | 227 |
| 228 const uint8* newbuf = new_stream->Buffer(); | 228 const uint8* newbuf = new_stream->Buffer(); |
| 229 const int newsize = new_stream->Remaining(); | 229 const int newsize = new_stream->Remaining(); |
| 230 | 230 |
| 231 int control_length = 0; | 231 int control_length = 0; |
| 232 int diff_bytes_length = 0; | 232 int diff_bytes_length = 0; |
| 233 int diff_bytes_nonzero = 0; | 233 int diff_bytes_nonzero = 0; |
| 234 int extra_bytes_length = 0; | 234 int extra_bytes_length = 0; |
| 235 int eblen = 0; | |
| 236 | 235 |
| 237 // The patch format is a sequence of triples <copy,extra,seek> where 'copy' is | 236 // The patch format is a sequence of triples <copy,extra,seek> where 'copy' is |
| 238 // the number of bytes to copy from the old file (possibly with mistakes), | 237 // the number of bytes to copy from the old file (possibly with mistakes), |
| 239 // 'extra' is the number of bytes to copy from a stream of fresh bytes, and | 238 // 'extra' is the number of bytes to copy from a stream of fresh bytes, and |
| 240 // 'seek' is an offset to move to the position to copy for the next triple. | 239 // 'seek' is an offset to move to the position to copy for the next triple. |
| 241 // | 240 // |
| 242 // The invariant at the top of this loop is that we are committed to emitting | 241 // The invariant at the top of this loop is that we are committed to emitting |
| 243 // a triple for the part of |newbuf| surrounding a 'seed' match near | 242 // a triple for the part of |newbuf| surrounding a 'seed' match near |
| 244 // |lastscan|. We are searching for a second match that will be the 'seed' of | 243 // |lastscan|. We are searching for a second match that will be the 'seed' of |
| 245 // the next triple. As we scan through |newbuf|, one of four things can | 244 // the next triple. As we scan through |newbuf|, one of four things can |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 LOG(INFO) << "Uncompressed bsdiff patch size " | 421 LOG(INFO) << "Uncompressed bsdiff patch size " |
| 423 << patch_stream->Length() - initial_patch_stream_length; | 422 << patch_stream->Length() - initial_patch_stream_length; |
| 424 | 423 |
| 425 LOG(INFO) << "End bsdiff " | 424 LOG(INFO) << "End bsdiff " |
| 426 << (base::Time::Now() - start_bsdiff_time).InSecondsF(); | 425 << (base::Time::Now() - start_bsdiff_time).InSecondsF(); |
| 427 | 426 |
| 428 return OK; | 427 return OK; |
| 429 } | 428 } |
| 430 | 429 |
| 431 } // namespace | 430 } // namespace |
| OLD | NEW |