You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/03/02 02:35:19 UTC

svn commit: r1296018 - /subversion/trunk/subversion/svnserve/main.c

Author: hwright
Date: Fri Mar  2 01:35:18 2012
New Revision: 1296018

URL: http://svn.apache.org/viewvc?rev=1296018&view=rev
Log:
Add an option to svnserve to force it into single-threaded mode.  This
greatly simplifies debugging an svnserve server.

* subversion/svnserve/main.c
  (SVNSERVE_OPT_SINGLE_CONN): New.
  (svnserve__options): Add new option.
  (main): Handle the new option.

Modified:
    subversion/trunk/subversion/svnserve/main.c

Modified: subversion/trunk/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/main.c?rev=1296018&r1=1296017&r2=1296018&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/main.c (original)
+++ subversion/trunk/subversion/svnserve/main.c Fri Mar  2 01:35:18 2012
@@ -147,6 +147,7 @@ void winservice_notify_stop(void)
 #define SVNSERVE_OPT_LOG_FILE        264
 #define SVNSERVE_OPT_CACHE_TXDELTAS  265
 #define SVNSERVE_OPT_CACHE_FULLTEXTS 266
+#define SVNSERVE_OPT_SINGLE_CONN     267
 
 static const apr_getopt_option_t svnserve__options[] =
   {
@@ -231,6 +232,10 @@ static const apr_getopt_option_t svnserv
      N_("run in foreground (useful for debugging)\n"
         "                             "
         "[mode: daemon]")},
+    {"single-thread",    SVNSERVE_OPT_SINGLE_CONN, 0,
+     N_("handle one connection at a time in the parent process\n"
+        "                             "
+        "(useful for debugging)")},
     {"log-file",         SVNSERVE_OPT_LOG_FILE, 1,
      N_("svnserve log file")},
     {"pid-file",         SVNSERVE_OPT_PID_FILE, 1,
@@ -434,6 +439,7 @@ int main(int argc, const char *argv[])
   svn_boolean_t quiet = FALSE;
   svn_boolean_t is_version = FALSE;
   int mode_opt_count = 0;
+  int handling_opt_count = 0;
   const char *config_filename = NULL;
   const char *pid_filename = NULL;
   const char *log_filename = NULL;
@@ -518,6 +524,11 @@ int main(int argc, const char *argv[])
           foreground = TRUE;
           break;
 
+        case SVNSERVE_OPT_SINGLE_CONN:
+          handling_mode = connection_mode_single;
+          handling_opt_count++;
+          break;
+
         case 'i':
           if (run_mode != run_mode_inetd)
             {
@@ -590,6 +601,7 @@ int main(int argc, const char *argv[])
 
         case 'T':
           handling_mode = connection_mode_thread;
+          handling_opt_count++;
           break;
 
         case 'c':
@@ -670,6 +682,14 @@ int main(int argc, const char *argv[])
       usage(argv[0], pool);
     }
 
+  if (handling_opt_count > 1)
+    {
+      svn_error_clear(svn_cmdline_fputs(
+                      _("You may only specify one of -T or --single-thread\n"),
+                      stderr, pool));
+      usage(argv[0], pool);
+    }
+
   /* If a configuration file is specified, load it and any referenced
    * password and authorization files. */
   if (config_filename)