[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog client.c cvs.h update.c
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog client.c cvs.h update.c |
Date: |
Tue, 19 Dec 2006 04:24:03 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Mark D. Baushke <mdb> 06/12/19 04:24:03
Modified files:
src : ChangeLog client.c cvs.h update.c
Log message:
* cvs.h (checksum_t): New typedef union for md5 checksum alignment.
* client.c (stored_checksum, handle_checksum, update_entires): Use it.
* update.c (update_fileproc): Ditto.
(struct patch_file_data): Use bool for compute_checksum flag.
(patch_file): Update compute_checksum assignments to bool.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3501&r2=1.3502
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/client.c?cvsroot=cvs&r1=1.460&r2=1.461
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/cvs.h?cvsroot=cvs&r1=1.350&r2=1.351
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/update.c?cvsroot=cvs&r1=1.266&r2=1.267
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3501
retrieving revision 1.3502
diff -u -b -r1.3501 -r1.3502
--- ChangeLog 22 Sep 2006 00:32:48 -0000 1.3501
+++ ChangeLog 19 Dec 2006 04:24:03 -0000 1.3502
@@ -1,3 +1,13 @@
+2006-12-18 Mark D. Baushke <address@hidden>
+
+ * cvs.h (checksum_t): New typedef union for md5 checksum
+ alignment.
+ * client.c (stored_checksum, handle_checksum, update_entires):
+ Use it.
+ * update.c (update_fileproc): Ditto.
+ (struct patch_file_data): Use bool for compute_checksum flag.
+ (patch_file): Update compute_checksum assignments to bool.
+
2006-09-21 Mark D. Baushke <address@hidden>
* commit.c (commit_fileproc): If support for the old info format
Index: client.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/client.c,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -b -r1.460 -r1.461
--- client.c 26 Jul 2006 09:52:56 -0000 1.460
+++ client.c 19 Dec 2006 04:24:03 -0000 1.461
@@ -1278,7 +1278,7 @@
* it here, and then check it in update_entries.
*/
static int stored_checksum_valid;
-static unsigned char stored_checksum[16];
+static checksum_t stored_ck; /* sixteen bytes for MD5 checksum */
static void
handle_checksum (char *args, size_t len)
{
@@ -1297,7 +1297,7 @@
buf[0] = *s++;
buf[1] = *s++;
- stored_checksum[i] = (char) strtol (buf, &bufend, 16);
+ stored_ck.char_checksum[i] = (unsigned char) strtol (buf, &bufend, 16);
if (bufend != buf + 2)
break;
}
@@ -1705,13 +1705,13 @@
{
if (stored_checksum_valid)
{
- unsigned char checksum[16];
+ checksum_t ck;
/* We have a checksum. Check it before writing
the file out, so that we don't have to read it
back in again. */
- md5_buffer (patchedbuf, patchedlen, checksum);
- if (memcmp (checksum, stored_checksum, 16) != 0)
+ md5_buffer (patchedbuf, patchedlen, ck.char_checksum);
+ if (memcmp (ck.char_checksum, stored_ck.char_checksum, 16)
!= 0)
{
error (0, 0,
"checksum failure after patch to `%s'; will refetch",
@@ -1752,7 +1752,7 @@
struct md5_ctx context;
unsigned char buf[8192];
unsigned len;
- unsigned char checksum[16];
+ checksum_t ck;
/*
* Compute the MD5 checksum. This will normally only be
@@ -1773,13 +1773,13 @@
md5_process_bytes (buf, len, &context);
if (ferror (e))
error (1, errno, "could not read %s", short_pathname);
- md5_finish_ctx (&context, checksum);
+ md5_finish_ctx (&context, ck.char_checksum);
fclose (e);
stored_checksum_valid = 0;
- if (memcmp (checksum, stored_checksum, 16) != 0)
+ if (memcmp (ck.char_checksum, stored_ck.char_checksum, 16) != 0)
{
if (data->contents != UPDATE_ENTRIES_PATCH)
error (1, 0, "checksum failure on %s",
Index: cvs.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/cvs.h,v
retrieving revision 1.350
retrieving revision 1.351
diff -u -b -r1.350 -r1.351
--- cvs.h 2 Sep 2006 23:18:00 -0000 1.350
+++ cvs.h 19 Dec 2006 04:24:03 -0000 1.351
@@ -601,3 +601,8 @@
/* From find_names.c. */
List *find_files (const char *dir, const char *pat);
+
+typedef union {
+ uint32_t int_checksum[4];
+ unsigned char char_checksum[16];
+} checksum_t;
Index: update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -b -r1.266 -r1.267
--- update.c 24 Aug 2006 18:36:27 -0000 1.266
+++ update.c 19 Dec 2006 04:24:03 -0000 1.267
@@ -742,11 +742,11 @@
{
int docheckout;
struct stat file_info;
- unsigned char checksum[16];
+ checksum_t ck;
retval = patch_file (finfo,
vers, &docheckout,
- &file_info, checksum);
+ &file_info, ck.char_checksum);
if (!docheckout)
{
if (retval == 0)
@@ -754,7 +754,8 @@
(rcs_diff_patches
? SERVER_RCS_DIFF
: SERVER_PATCHED),
- file_info.st_mode, checksum,
+ file_info.st_mode,
+ ck.char_checksum,
NULL);
break;
}
@@ -1472,7 +1473,7 @@
/* File to which to write. */
FILE *fp;
/* Whether to compute the MD5 checksum. */
- int compute_checksum;
+ bool compute_checksum;
/* Data structure for computing the MD5 checksum. */
struct md5_ctx context;
/* Set if the file has a final newline. */
@@ -1567,7 +1568,7 @@
data.filename = file1;
data.fp = e;
data.final_nl = 0;
- data.compute_checksum = 0;
+ data.compute_checksum = false;
/* Duplicating the client working file, so use the original sticky options.
*/
@@ -1591,7 +1592,7 @@
data.filename = file2;
data.fp = e;
data.final_nl = 0;
- data.compute_checksum = 1;
+ data.compute_checksum = true;
md5_init_ctx (&data.context);
retcode = RCS_checkout (vers_ts->srcfile, NULL,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog client.c cvs.h update.c,
Mark D. Baushke <=