Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Protocol support besides pserver

Help
cvsclient
2005-01-19
2013-04-25
  • cvsclient
    cvsclient
    2005-01-19

    hi,

    i am using the latest development package downloaded from the following link:
    http://sourceforge.net/project/showfiles.php?group_id=78334&package_id=140980

    with this package, i can successfully do some actions against a cvsnt server through the pserver protocol. then i wanna go ahead to test other protocols.

    by examining the source, it seems that ext protocol should be supported. however, when i construct the CvsRoot object with the following cvsroot,

    ":ext:garygu@localhost:2401/Tech/CVS"

    it falied at

    Match matches = regex.Match(cvsRoot);

    inside the CvsRoot.parse method. the matches.Succes always returns false.

    does the latest development package supports the ext protocol? and how many protocols do it support now?

    sorry for my so many questions.

    Gary,

     
    • cvsclient
      cvsclient
      2005-01-19

      it seems to be a BUG of the CvsRoot.parse method. the CVSROOT_REGEX seems only passes cvsroot with four colons in, like:
      --------------------
      :pserver:garygu@localhost:2401:/Tech/CVS
      --------------------
      for :ext: protocol, the cvsroot only contains three colons, so the matching will fail
      --------------------
      :ext:garygu@localhost:2401/Tech/CVS
      --------------------

      am i right?

      thanks,

      Gary,

       
    • Gerry, it looks like you got passed this, what was the resolution?

       
      • cvsclient
        cvsclient
        2005-01-20

        hi Clayton,

        it should be a good news!!

        i now successfully do actions against a cvsnt server via the :ext protocol. however, i did some modifications to the ExtProtocol class:
        1. provide the full path to the ssh.exe, instead of the single executable file name
        -----------------
        //Gary Gu - commented on 2005/01/20 - starts
                    //ProcessStartInfo startInfo =
                    //    new ProcessStartInfo("ssh.exe", args);
                    ProcessStartInfo startInfo =
                        new ProcessStartInfo(@"C:\cygwin\bin\ssh.exe", args);
                //Gary Gu - commented on 2005/01/20 - ends
        --------------------
        i am not sure why the full path should be provided, although i have add the path pointing to the ssh.exe to the end of the PATH envrionment. in addition, i also added CVS_RSH environment.

        2. commented out the following lines inside the ExtProtocol.GetProcessInfo method:
        -------------------
        //Gary Gu - commented on 2005/01/20 - starts
                    //startInfo.RedirectStandardError  = true;
                    //startInfo.RedirectStandardInput  = true;
                    //startInfo.RedirectStandardOutput = true;
                    //startInfo.UseShellExecute        = false;
                //Gary Gu - commented on 2005/01/20 - ends
        -----------------------
        these properties were already set in the ExtProtocol.GetSshProcessInfo method. so it is duplicate in the GetProcessInfo method. if the code above was not commented, the application will hang. by now, i don't know why it happens.

        Clayton,your any comment or suggestion on those problems above will be greatly appreciated.

        Cheer,
        Gary

         
        • cvsclient
          cvsclient
          2005-01-20

          sorry that i missed mentioning of an important point. that is, the success in my precious post only worked in the DEBUG status. in non-debug situation, the application still hang after the dos command for password prompted.

          i am near to the edge of disappointment:(

           
          • cvsclient
            cvsclient
            2005-01-20

            hi Clayton,

            sorry for my repeatedly posting information here.

            just FYI, by digging into the source code, i found that the hang happened on the following line inside the CVSServerConnection.HandleResponses method
            --------------------------
            string responseStr = inputStream.ReadToFirstWS();
            --------------------------

            any clue on this issue?

            Gary,

             
            • This is odd, what it is doing is attempting to read the response back from the cvs server.  This is then mapped via the ResponseFactory and dispatched.  The fact that it is hanging means that it is unable to read anything from the stream.  I will look at it tonight but if you are already digging into it you might search for an #if DEBUG defines.  I don't use this a lot but I have added it for convenience in a couple of places. 

              Cheers,

              Clayton

               
        • Hi Gary, needing the full path to ssh is odd.  The application should ideally look in the CVS_RSH environment variable and then in the PATH as a last resort.  When using other cvs commandlines they will hang if the CVS_RSH is not specified.  I was sure I was doing this but it might have been in another project.  The duplicate code is a bad one too, which probably came about when I added plink support. 

          Cheers,

          Clayton

           
    • cvsclient
      cvsclient
      2005-01-20

      hi Clayton,

      after doing some modifications to the CvsRoot.Parse() method, the :ext protocol was recognized as a valid protocol. then the flow went ahead to the section where a new process was launched. the new process launched the ssh.exe, which tried to connect to the ssh server. then a dos command prompted for a password. after i input the correct password, the dos command hang there.

      the parent process continued executing. however, it also got hung when certain command, for example the ListCommand, was submmited for execution.

      have i missed something here?

      thanks if you have any time to help figure out this issue.

      Gary,

       
    • cvsclient
      cvsclient
      2005-01-20

      hi Clayton,

      i am now temporarily leaving the cvs application alone, and work on a simple sample. here is the code i tried:
      ---------------------------
      Process myProcess = new Process();
                  ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("ssh.exe", "garygu@localhost" );
                  myProcessStartInfo.UseShellExecute = false;
                  myProcessStartInfo.RedirectStandardOutput = true;
                  myProcess.StartInfo = myProcessStartInfo;
                  myProcess.Start();

                  StreamReader myStreamReader = myProcess.StandardOutput;
                  // Read the standard output of the spawned process.
                  string myString = myStreamReader.ReadLine();
                  MessageBox.Show(myString);
                  myProcess.Close();
      ---------------------------
      the code above also hang when the dos comamnd for password prompted.

      have i missed something here?

      thanks,
      Gary