summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-07-26 16:01:23 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-07-26 16:01:23 +0000
commit37bfbdfa1b4bfcea197165ced4da4c898d583703 (patch)
treeedc193d449c7261af99771c51587a3ebdc2f1c51 /usr.bin
parentf0304f146cbbb47379592d8acfcf1b2a2c46bbb7 (diff)
Remove the code that would avoid sending a `Directory' request if the
previous `Directory' request had sent the same dir, our code isn't as stupid as it used to be
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/client.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index 6f2fd2e63df..4ef72aed707 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */
+/* $OpenBSD: client.c,v 1.2 2004/07/26 16:01:22 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -72,9 +72,6 @@ static FILE *cvs_server_outlog;
static char cvs_client_buf[4096];
-/* last directory sent with `Directory' */
-static char cvs_lastdir[MAXPATHLEN] = "";
-
/*
@@ -451,19 +448,17 @@ cvs_client_senddir(const char *dir)
{
char repo[MAXPATHLEN], buf[MAXPATHLEN];
- /* don't bother sending if it's the same as the last Directory sent */
- if (strcmp(dir, cvs_lastdir) == 0)
- return (0);
-
- if (cvs_readrepo(dir, repo, sizeof(repo)) < 0)
- return (-1);
-
- snprintf(buf, sizeof(buf), "%s/%s", cvs_root->cr_dir, repo);
+ if (cvs_readrepo(dir, repo, sizeof(repo)) < 0) {
+ repo[0] = '\0';
+ strlcpy(buf, cvs_root->cr_dir, sizeof(buf));
+ }
+ else {
+ snprintf(buf, sizeof(buf), "%s/%s", cvs_root->cr_dir, repo);
+ }
if ((cvs_client_sendreq(CVS_REQ_DIRECTORY, dir, 0) < 0) ||
(cvs_client_sendln(buf) < 0))
return (-1);
- strlcpy(cvs_lastdir, dir, sizeof(cvs_lastdir));
return (0);
}