bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] clarify global from_/to_server [1/2]


From: Alexey Mahotkin
Subject: [PATCH] clarify global from_/to_server [1/2]
Date: Fri, 02 May 2003 02:39:43 +0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)


2003-05-02  Alexey Mahotkin <address@hidden>

Rename global from_/to_server variables to global_from_server and
global_to_server, to emphasize their meaning (it was lost in the maze of
local ones and impostor from_/to_server_p variables).




 src/client.c |   68 ++++++++++++++++++++++++++++-------------------------------
 1 files changed, 33 insertions(+), 35 deletions(-)

--- ccvs/src/client.c~local-from-to-server      Fri May  2 01:48:29 2003
+++ ccvs-alexm/src/client.c     Fri May  2 02:02:44 2003
@@ -403,10 +403,10 @@ int client_prune_dirs;
 static List *ignlist = (List *) NULL;
 
 /* Buffer to write to the server.  */
-static struct buffer *to_server;
+static struct buffer *global_to_server;
 
 /* Buffer used to read from the server.  */
-static struct buffer *from_server;
+static struct buffer *global_from_server;
 
 
 /*
@@ -424,11 +424,11 @@ read_line (resultp)
     char *result;
     int len;
 
-    status = buf_flush (to_server, 1);
+    status = buf_flush (global_to_server, 1);
     if (status != 0)
        error (1, status, "writing to server");
 
-    status = buf_read_line (from_server, &result, &len);
+    status = buf_read_line (global_from_server, &result, &len);
     if (status != 0)
     {
        if (status == -1)
@@ -3049,7 +3049,7 @@ send_to_server (str, len)
     if (len == 0)
        len = strlen (str);
 
-    buf_output (to_server, str, len);
+    buf_output (global_to_server, str, len);
       
     /* There is no reason not to send data to the server, so do it
        whenever we've accumulated enough information in the buffer to
@@ -3059,7 +3059,7 @@ send_to_server (str, len)
     {
        int status;
 
-        status = buf_send_output (to_server);
+        status = buf_send_output (global_to_server);
        if (status != 0)
            error (1, status, "error writing to server");
        nbytes = 0;
@@ -3077,7 +3077,7 @@ try_read_from_server (buf, len)
     int status, nread;
     char *data;
 
-    status = buf_read_data (from_server, len, &data, &nread);
+    status = buf_read_data (global_from_server, len, &data, &nread);
     if (status != 0)
     {
        if (status == -1)
@@ -3213,17 +3213,17 @@ get_responses_and_close ()
      * point our shut down of FROM_SERVER will complete.
      */
 
-    status = buf_shutdown (to_server);
+    status = buf_shutdown (global_to_server);
     if (status != 0)
        error (0, status, "shutting down buffer to server");
-    buf_free (to_server);
-    to_server = NULL;
+    buf_free (global_to_server);
+    global_to_server = NULL;
 
-    status = buf_shutdown (from_server);
+    status = buf_shutdown (global_from_server);
     if (status != 0)
        error (0, status, "shutting down buffer from server");
-    buf_free (from_server);
-    from_server = NULL;
+    buf_free (global_from_server);
+    global_from_server = NULL;
     server_started = 0;
 
     /* see if we need to sleep before returning to avoid time-stamp races */
@@ -3528,8 +3528,8 @@ auth_server (root, lto_server, lfrom_ser
      * verify_only mode.  We should be relying on the values we passed in, but
      * sent_to_server and read_line don't require an outside buf yet.
      */
-    to_server = lto_server;
-    from_server = lfrom_server;
+    global_to_server = lto_server;
+    global_from_server = lfrom_server;
 
     /* Run the authorization mini-protocol before anything else. */
     if (do_gssapi)
@@ -3841,20 +3841,20 @@ start_server ()
            /* Toss the return value.  It will die with an error message if
             * anything goes wrong anyway.
             */
-           connect_to_pserver (current_parsed_root, &to_server, &from_server, 
0, 0);
+           connect_to_pserver (current_parsed_root, &global_to_server, 
&global_from_server, 0, 0);
            break;
 #endif /* AUTH_CLIENT_SUPPORT */
 
 #if HAVE_KERBEROS
        case kserver_method:
-           start_tcp_server (current_parsed_root, &to_server, &from_server);
+           start_tcp_server (current_parsed_root, &global_to_server, 
&global_from_server);
            break;
 #endif /* HAVE_KERBEROS */
 
 #ifdef HAVE_GSSAPI
        case gserver_method:
            /* GSSAPI authentication is handled by the pserver.  */
-           connect_to_pserver (current_parsed_root, &to_server, &from_server, 
0, 1);
+           connect_to_pserver (current_parsed_root, &global_to_server, 
&global_from_server, 0, 1);
            break;
 #endif /* HAVE_GSSAPI */
 
@@ -3863,7 +3863,7 @@ start_server ()
            error (0, 0, ":ext: method not supported by this port of CVS");
            error (1, 0, "try :server: instead");
 #else /* ! NO_EXT_METHOD */
-           start_rsh_server (current_parsed_root, &to_server, &from_server);
+           start_rsh_server (current_parsed_root, &global_to_server, 
&global_from_server);
 #endif /* NO_EXT_METHOD */
            break;
 
@@ -3875,9 +3875,9 @@ start_server ()
                          current_parsed_root->username, 
current_parsed_root->hostname,
                          current_parsed_root->directory);
 # ifdef START_SERVER_RETURNS_SOCKET
-           make_bufs_from_fds (tofd, fromfd, 0, &to_server, &from_server, 1);
+           make_bufs_from_fds (tofd, fromfd, 0, &global_to_server, 
&global_from_server, 1);
 # else /* ! START_SERVER_RETURNS_SOCKET */
-           make_bufs_from_fds (tofd, fromfd, 0, &to_server, &from_server, 0);
+           make_bufs_from_fds (tofd, fromfd, 0, &global_to_server, 
&global_from_server, 0);
 # endif /* START_SERVER_RETURNS_SOCKET */
            }
 #else /* ! START_SERVER */
@@ -3890,12 +3890,11 @@ start_server ()
            break;
 
         case fork_method:
-           connect_to_forked_server (&to_server, &from_server);
+           connect_to_forked_server (&global_to_server, &global_from_server);
            break;
 
        default:
-           error (1, 0, "\
-(start_server internal error): unknown access method");
+           error (1, 0, "(start_server internal error): unknown access 
method");
            break;
     }
 
@@ -3929,16 +3928,16 @@ start_server ()
         if (fp == NULL)
            error (0, errno, "opening to-server logfile %s", buf);
        else
-           to_server = log_buffer_initialize (to_server, fp, 0,
-                                              (BUFMEMERRPROC) NULL);
+           global_to_server = log_buffer_initialize (global_to_server, fp, 0,
+                                                     (BUFMEMERRPROC) NULL);
 
        strcpy (p, ".out");
        fp = open_file (buf, "wb");
         if (fp == NULL)
            error (0, errno, "opening from-server logfile %s", buf);
        else
-           from_server = log_buffer_initialize (from_server, fp, 1,
-                                                (BUFMEMERRPROC) NULL);
+           global_from_server = log_buffer_initialize (global_from_server, fp, 
1,
+                                                       (BUFMEMERRPROC) NULL);
 
        free (buf);
     }
@@ -4149,11 +4148,10 @@ start_server ()
            /* All further communication with the server will be
                compressed.  */
 
-           to_server = compress_buffer_initialize (to_server, 0, gzip_level,
-                                                   (BUFMEMERRPROC) NULL);
-           from_server = compress_buffer_initialize (from_server, 1,
-                                                     gzip_level,
-                                                     (BUFMEMERRPROC) NULL);
+           global_to_server = compress_buffer_initialize (global_to_server, 0, 
gzip_level,
+                                                          (BUFMEMERRPROC) 
NULL);
+           global_from_server = compress_buffer_initialize 
(global_from_server, 1, gzip_level,
+                                                            (BUFMEMERRPROC) 
NULL);
        }
 #ifndef NO_CLIENT_GZIP_PROCESS
        else if (supported_request ("gzip-file-contents"))
@@ -4192,11 +4190,11 @@ start_server ()
                error (1, 0,
                       "This server does not support stream authentication");
            send_to_server ("Gssapi-authenticate\012", 0);
-           to_server = cvs_gssapi_wrap_buffer_initialize (to_server, 0,
+           global_to_server = cvs_gssapi_wrap_buffer_initialize 
(global_to_server, 0,
                                                           gcontext,
                                                           ((BUFMEMERRPROC)
                                                            NULL));
-           from_server = cvs_gssapi_wrap_buffer_initialize (from_server, 1,
+           global_from_server = cvs_gssapi_wrap_buffer_initialize 
(global_from_server, 1,
                                                             gcontext,
                                                             ((BUFMEMERRPROC)
                                                              NULL));

_


--alexm




reply via email to

[Prev in Thread] Current Thread [Next in Thread]