@matheusbsbs / matheus-bagliano / commits / 80573baec4
Fork 0

cvsserver: Introduce new state variable 'method'

$state->{method} contains the CVS access method used, either 'ext' or 'pserver' Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Frank Lichtenheld committed Mar 19, 2007 at 16:55 UTC 80573baec4a6211fc9a01d83690c0d73015cfbdc
1 file changed +3 -1
git-cvsserver.perl
+3 -1
@@ -91,7 +91,9 @@ $log->debug("Temporary directory is '$TEMP_DIR'");
91 # if we are called with a pserver argument,
92 # deal with the authentication cat before entering the
93 # main loop
94 +$state->{method} = 'ext';
95 if (@ARGV && $ARGV[0] eq 'pserver') {
96 + $state->{method} = 'pserver';
97 my $line = <STDIN>; chomp $line;
98 unless( $line eq 'BEGIN AUTH REQUEST') {
99 die "E Do not understand $line - expecting BEGIN AUTH REQUEST\n";
@@ -1026,7 +1028,7 @@ sub req_ci
1028
1029 $log->info("req_ci : " . ( defined($data) ? $data : "[NULL]" ));
1030
1029 - if ( @ARGV && $ARGV[0] eq 'pserver')
1031 + if ( $state->{method} eq 'pserver')
1032 {
1033 print "error 1 pserver access cannot commit\n";
1034 exit;