aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-05-20 13:18:10 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-05-20 13:18:10 +0000
commit73dc22f45454c7a981354aad6be7edd524eea2cc (patch)
treedaf1cfffa8f719458f7a63f2f417abdbcc217392
parent1a2217699ead3aa329f580bfd3e4fb77d7a12f49 (diff)
downloadsrc-73dc22f45454c7a981354aad6be7edd524eea2cc.tar.gz
src-73dc22f45454c7a981354aad6be7edd524eea2cc.zip
Merge updated patch from vendor branch (1.1.1.17)
Approved by: so
Notes
Notes: svn path=/releng/4.7/; revision=129489
-rw-r--r--contrib/cvs/src/server.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/contrib/cvs/src/server.c b/contrib/cvs/src/server.c
index 42ba9f8ebb60..39ef7d815608 100644
--- a/contrib/cvs/src/server.c
+++ b/contrib/cvs/src/server.c
@@ -1654,8 +1654,18 @@ serve_unchanged (arg)
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
+ /* If the time field is not currently empty, then one of
+ * serve_modified, serve_is_modified, & serve_unchanged were
+ * already called for this file. We would like to ignore the
+ * reinvocation silently or, better yet, exit with an error
+ * message, but we just avoid the copy-forward and overwrite the
+ * value from the last invocation instead. See the comment below
+ * for more.
+ */
if (*timefield == '/')
{
+ /* Copy forward one character. Space was allocated for this
+ * already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1663,8 +1673,17 @@ serve_unchanged (arg)
*cp = cp[-1];
--cp;
}
- *timefield = '=';
}
+ /* If *TIMEFIELD wasn't "/", we assume that it was because of
+ * multiple calls to Is-Modified & Unchanged by the client and
+ * just overwrite the value from the last call. Technically, we
+ * should probably either ignore calls after the first or send the
+ * client an error, since the client/server protocol specification
+ * specifies that only one call to either Is-Modified or Unchanged
+ * is allowed, but broken versions of WinCVS & TortoiseCVS rely on
+ * this behavior.
+ */
+ *timefield = '=';
break;
}
}
@@ -1698,8 +1717,18 @@ serve_is_modified (arg)
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
+ /* If the time field is not currently empty, then one of
+ * serve_modified, serve_is_modified, & serve_unchanged were
+ * already called for this file. We would like to ignore the
+ * reinvocation silently or, better yet, exit with an error
+ * message, but we just avoid the copy-forward and overwrite the
+ * value from the last invocation instead. See the comment below
+ * for more.
+ */
if (*timefield == '/')
{
+ /* Copy forward one character. Space was allocated for this
+ * already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1707,8 +1736,17 @@ serve_is_modified (arg)
*cp = cp[-1];
--cp;
}
- *timefield = 'M';
}
+ /* If *TIMEFIELD wasn't "/", we assume that it was because of
+ * multiple calls to Is-Modified & Unchanged by the client and
+ * just overwrite the value from the last call. Technically, we
+ * should probably either ignore calls after the first or send the
+ * client an error, since the client/server protocol specification
+ * specifies that only one call to either Is-Modified or Unchanged
+ * is allowed, but broken versions of WinCVS & TortoiseCVS rely on
+ * this behavior.
+ */
+ *timefield = 'M';
if (kopt != NULL)
{
if (alloc_pending (strlen (name) + 80))