SVN Proxy server

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

SVN Proxy server

Ramprasad Venkata Inala
Hi,

I need to write a proxy server for SVN ( using the svn protocol i.e., svn:// ).
I would like to understand protocol for the same. Altough i had gone through the protocol text file in the subversion sources directory.
I would be grrate ful somebody gives the exact working of the protocol.
Please add me to the cc of the mailing list as i am not a member of this group.

Thanks and Regards
Prasad

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Ben Collins-Sussman

On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:

> Hi,
>
> I need to write a proxy server for SVN ( using the svn protocol  
> i.e., svn:// ).
> I would like to understand protocol for the same. Altough i had  
> gone through the protocol text file in the subversion sources  
> directory.
> I would be grrate ful somebody gives the exact working of the  
> protocol.

Does the 'protocol' document not give a precise-enough description?  
If something's unclear, please ask specific questions.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Marc Haisenko
On Friday 27 May 2005 13:59, Ben Collins-Sussman wrote:

> On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:
> > Hi,
> >
> > I need to write a proxy server for SVN ( using the svn protocol
> > i.e., svn:// ).
> > I would like to understand protocol for the same. Altough i had
> > gone through the protocol text file in the subversion sources
> > directory.
> > I would be grrate ful somebody gives the exact working of the
> > protocol.
>
> Does the 'protocol' document not give a precise-enough description?
> If something's unclear, please ask specific questions.

Did you mean this document:
http://svn.collab.net/viewcvs/svn/trunk/doc/programmer/design/protocol.texi?view=markup

Actually, it doesn't even mention the svn:// protocol :-)

--
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Ben Collins-Sussman

On May 27, 2005, at 7:38 AM, Marc Haisenko wrote:
>
> Did you mean this document:
> http://svn.collab.net/viewcvs/svn/trunk/doc/programmer/design/ 
> protocol.texi?view=markup
>
> Actually, it doesn't even mention the svn:// protocol :-)
>

No, that's a very early design of the WebDAV protocol, 5 years old.

I'm talking about:

http://svn.collab.net/repos/svn/trunk/subversion/libsvn_ra_svn/protocol


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Marc Haisenko
On Friday 27 May 2005 15:10, Ben Collins-Sussman wrote:
> No, that's a very early design of the WebDAV protocol, 5 years old.
>
> I'm talking about:
>
> http://svn.collab.net/repos/svn/trunk/subversion/libsvn_ra_svn/protocol

Ah, now /that's/ what I call documentation :-)

--
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Julian Foad
In reply to this post by Ben Collins-Sussman
Ben Collins-Sussman wrote:
> On May 27, 2005, at 7:38 AM, Marc Haisenko wrote:
>> Did you mean this document:
>> http://svn.collab.net/viewcvs/svn/trunk/doc/programmer/design/ 
>> protocol.texi?view=markup
>>
>> Actually, it doesn't even mention the svn:// protocol :-)
>
> No, that's a very early design of the WebDAV protocol, 5 years old.

Well, is its presence in our repository, or its content, misleading?  If so we
ought to amend or delete it.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: SVN Proxy server

Ramprasad Venkata Inala
In reply to this post by Ramprasad Venkata Inala
Hi Ben,

I had to write a proxy that would pass through our versions as well before it reaches the svn.

Client-->SVNproxy-->OurVersioningSystem-->SVNDB.
The above is the process that i need to follow. Considering the different protocols that svn has like Http, Https( which are already handled ) and SVN which need to be handled now in our project.

I had written a socket ( SVN Proxy ) server in java.
Let me put the details how i am proceeding in obtaining the connection.

Note: I use the eclipse svn plugin as the client.

1. First I click Team->Share Project-> SVN( Chosen option ) click next and pick up an existing svn repsoitory on my machine.
2. Now the proxy receives the request( opening a socket , ServerSocket.accept method ) then spawns a new thread that would handle the request then on, like opening input and output streams. when the proxy receives the first call to open socket then it sends back reponse in this format
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) ( 2 ANONYMOUS ( ) ( ) )
3. Then the client responds back with this.
( 2 ( edit-pipeline ) 32:svn:///d:/testsvnrep/SVNProtocol )
In my case the testsvnrep is my repository and SVNProtocol is my eclipse project.
4. Then the proxy sends a reponse to the client in this format
( success ( ( ) 32:localhost/d:/testsvnrep/SVNProtocol ) )

Now the problem starts, after when i send this response to the client the client opens up anew socket instead of sending on the same socket that was opened before.

Also attached is the code for the same.

SVNProxy File
--------------

import java.net.ServerSocket;
import java.net.Socket;

public class SVNProxy
{
        public static void main( String[] args ) throws Exception
        {
                ServerSocket serverSoc = new ServerSocket( 3690 );
                //Socket soc = null;

                System.out.println("SVN Proxy Started.");
                while( true )
                {
                        System.out.println( "Waiting..." );
                        Socket soc = serverSoc.accept();
                        System.out.println( "New connection opened on port::"+soc.getPort() );
                        new Thread( new SVNSession( soc ) ).start();
                        //openSession( soc );
                }
        }


SVNSession File
----------------


import java.net.Socket;
//import java.io.InputStream;
import java.io.OutputStream;
//import java.io.BufferedInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class SVNSession implements Runnable
{
        private Socket clientSocket = null;
        private String OPEN_CONNECTION_RESPONSE = "( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) " +
                                                                                                  "( 2 ANONYMOUS ( ) ( ) )";
        private String AUTHETICATION_REQUEST = "( success ( ( ) ";

        SVNSession( Socket soc ) throws Exception
        {
                this.clientSocket = soc;
        } // end of constructor SVNSession

        public void run()
        {
                try
                {
                        openSVNSession();
                        readInputStream();
                } // end of try block
                catch( Exception e )
                {
                        e.printStackTrace();
                } // end of catch block
        } // end of run method
       
        private void openSVNSession() throws Exception
        {
                byte[] writeBytes = OPEN_CONNECTION_RESPONSE.getBytes();
                OutputStream socOutputStream = this.clientSocket.getOutputStream();
                socOutputStream.write( writeBytes );
                System.out.println("SVN hand shake ack sent.");
        } // end of openConnection method
       

        private void readInputStream() throws Exception
        {
                BufferedReader input = new BufferedReader( new
                                                                                                          InputStreamReader( this.clientSocket.
                                                                                                          getInputStream() ) );
                String message = null;
                while( true  )
                {
                        if( this.clientSocket.getInputStream().available() > 0 )
                        {
                                System.out.println( "available:" + this.clientSocket.getInputStream().available() );
                                byte[] readBytes = new byte[ this.clientSocket.getInputStream().
                                                                                                                        available() ];
                                this.clientSocket.getInputStream().read( readBytes );
                                System.out.println( new String( readBytes ) );
                                requestForAuthentication( new String( readBytes ));
                        }
                } // end of while listening to inputstream
        } // end of readInputStream method
       
        private void processRequest( String request )
        {
        }
       
        private void requestForAuthentication( String response )
                                                throws Exception
        {
                this.clientSocket.getOutputStream().write( ( this.AUTHETICATION_REQUEST + " ( " +
                                                                                 response.substring(
                                                                                 ( response.indexOf( ")" ) + 2 ) ) ).getBytes() );
        }

        private void closeStreams()
                                        throws Exception
        {
                this.clientSocket.getInputStream().close();
                this.clientSocket.getOutputStream().close();
        }
}
 

Please help me in understanding the protocol.

Regards
RP

-----Original Message-----

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************


From: Ben Collins-Sussman [mailto:[hidden email]]
Sent: Friday, May 27, 2005 5:30 PM
To: Ramprasad Venkata Inala
Cc: [hidden email]
Subject: Re: SVN Proxy server



On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:

> Hi,
>
> I need to write a proxy server for SVN ( using the svn protocol  
> i.e., svn:// ).
> I would like to understand protocol for the same. Altough i had  
> gone through the protocol text file in the subversion sources  
> directory.
> I would be grrate ful somebody gives the exact working of the  
> protocol.

Does the 'protocol' document not give a precise-enough description?  
If something's unclear, please ask specific questions.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: SVN Proxy server

Ramprasad Venkata Inala
In reply to this post by Ramprasad Venkata Inala
Hi Ben,

I had to write a proxy that would pass through our versions as well before it reaches the svn.

Client-->SVNproxy-->OurVersioningSystem-->SVN.
The above is the process that i need to follow. Considering the different protocols that svn has like Http, Https( which are already handled ) and SVN which need to be handled now in our project.

I had written a socket ( SVN Proxy ) server in java.
Let me put the details how i am proceeding in obtaining the connection.

Note: I use the eclipse svn plugin as the client.

1. First I click Team->Share Project-> SVN( Chosen option ) click next and pick up an existing svn repsoitory on my machine.
2. Now the proxy receives the request( opening a socket , ServerSocket.accept method ) then spawns a new thread that would handle the request then on, like opening input and output streams. when the proxy receives the first call to open socket then it sends back reponse in this format
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) ( 2 ANONYMOUS ( ) ( ) )
3. Then the client responds back with this.
( 2 ( edit-pipeline ) 32:svn:///d:/testsvnrep/SVNProtocol )
In my case the testsvnrep is my repository and SVNProtocol is my eclipse project.
4. Then the proxy sends a reponse to the client in this format
( success ( ( ) 32:localhost/d:/testsvnrep/SVNProtocol ) )

Now the problem starts, after when i send this response to the client the client opens up anew socket instead of sending on the same socket that was opened before.

Also attached is the code for the same.

SVNProxy File
--------------

import java.net.ServerSocket;
import java.net.Socket;

public class SVNProxy
{
        public static void main( String[] args ) throws Exception
        {
                ServerSocket serverSoc = new ServerSocket( 3690 );
                //Socket soc = null;

                System.out.println("SVN Proxy Started.");
                while( true )
                {
                        System.out.println( "Waiting..." );
                        Socket soc = serverSoc.accept();
                        System.out.println( "New connection opened on port::"+soc.getPort() );
                        new Thread( new SVNSession( soc ) ).start();
                        //openSession( soc );
                }
        }


SVNSession File
----------------


import java.net.Socket;
//import java.io.InputStream;
import java.io.OutputStream;
//import java.io.BufferedInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class SVNSession implements Runnable
{
        private Socket clientSocket = null;
        private String OPEN_CONNECTION_RESPONSE = "( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) " +
                                                                                                  "( 2 ANONYMOUS ( ) ( ) )";
        private String AUTHETICATION_REQUEST = "( success ( ( ) ";

        SVNSession( Socket soc ) throws Exception
        {
                this.clientSocket = soc;
        } // end of constructor SVNSession

        public void run()
        {
                try
                {
                        openSVNSession();
                        readInputStream();
                } // end of try block
                catch( Exception e )
                {
                        e.printStackTrace();
                } // end of catch block
        } // end of run method
       
        private void openSVNSession() throws Exception
        {
                byte[] writeBytes = OPEN_CONNECTION_RESPONSE.getBytes();
                OutputStream socOutputStream = this.clientSocket.getOutputStream();
                socOutputStream.write( writeBytes );
                System.out.println("SVN hand shake ack sent.");
        } // end of openConnection method
       

        private void readInputStream() throws Exception
        {
                BufferedReader input = new BufferedReader( new
                                                                                                          InputStreamReader( this.clientSocket.
                                                                                                          getInputStream() ) );
                String message = null;
                while( true  )
                {
                        if( this.clientSocket.getInputStream().available() > 0 )
                        {
                                System.out.println( "available:" + this.clientSocket.getInputStream().available() );
                                byte[] readBytes = new byte[ this.clientSocket.getInputStream().
                                                                                                                        available() ];
                                this.clientSocket.getInputStream().read( readBytes );
                                System.out.println( new String( readBytes ) );
                                requestForAuthentication( new String( readBytes ));
                        }
                } // end of while listening to inputstream
        } // end of readInputStream method
       
        private void processRequest( String request )
        {
        }
       
        private void requestForAuthentication( String response )
                                                throws Exception
        {
                this.clientSocket.getOutputStream().write( ( this.AUTHETICATION_REQUEST + " ( " +
                                                                                 response.substring(
                                                                                 ( response.indexOf( ")" ) + 2 ) ) ).getBytes() );
        }

        private void closeStreams()
                                        throws Exception
        {
                this.clientSocket.getInputStream().close();
                this.clientSocket.getOutputStream().close();
        }
}
 

Please help me in understanding the protocol.

Regards
RP

-----Original Message-----

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************


From: Ben Collins-Sussman [mailto:[hidden email]]
Sent: Friday, May 27, 2005 5:30 PM
To: Ramprasad Venkata Inala
Cc: [hidden email]
Subject: Re: SVN Proxy server



On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:

> Hi,
>
> I need to write a proxy server for SVN ( using the svn protocol  
> i.e., svn:// ).
> I would like to understand protocol for the same. Altough i had  
> gone through the protocol text file in the subversion sources  
> directory.
> I would be grrate ful somebody gives the exact working of the  
> protocol.

Does the 'protocol' document not give a precise-enough description?  
If something's unclear, please ask specific questions.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: SVN Proxy server

Ramprasad Venkata Inala
In reply to this post by Ramprasad Venkata Inala
Hi Ben,

Note: Please add me to the cc of the mailing list as i am not a member
of this group.

I had to write a proxy that would pass through our versions as well
before it reaches the svn.

Client-->SVNproxy-->OurVersioningSystem-->SVN.
The above is the process that i need to follow. Considering the
different protocols that svn has like Http, Https( which are already
handled ) and SVN which need to be handled now in our project.

I had written a socket ( SVN Proxy ) server in java.
Let me put the details how i am proceeding in obtaining the connection.

Note: I use the eclipse svn plugin as the client.

1. First I click Team->Share Project-> SVN( Chosen option ) click next
and pick up an existing svn repsoitory on my machine.
2. Now the proxy receives the request( opening a socket ,
ServerSocket.accept method ) then spawns a new thread that would handle
the request then on, like opening input and output streams. when the
proxy receives the first call to open socket then it sends back reponse
in this format
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) ( 2 ANONYMOUS ( ) (
) )
3. Then the client responds back with this.
( 2 ( edit-pipeline ) 32:svn:///d:/testsvnrep/SVNProtocol )
In my case the testsvnrep is my repository and SVNProtocol is my eclipse
project.
4. Then the proxy sends a reponse to the client in this format
( success ( ( ) 32:localhost/d:/testsvnrep/SVNProtocol ) )

Now the problem starts, after when i send this response to the client
the client opens up anew socket instead of sending on the same socket
that was opened before.

Also attached is the code for the same.

SVNProxy File
--------------

import java.net.ServerSocket;
import java.net.Socket;

public class SVNProxy
{
        public static void main( String[] args ) throws Exception
        {
                ServerSocket serverSoc = new
ServerSocket( 3690 );
                //Socket soc
= null;

                System.out.println("SVN Proxy Started.");
                while( true )
                {
                        System.out.println( "Waiting..." );
                        Socket soc
= serverSoc.accept();
                        System.out.println( "New connection opened on
port::"+soc.getPort() );
                        new Thread( new SVNSession( soc ) ).start();
                        //openSession( soc );
                }
        }


SVNSession File
----------------


import java.net.Socket;
//import java.io.InputStream;
import java.io.OutputStream;
//import java.io.BufferedInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class SVNSession implements Runnable
{
        private Socket clientSocket
= null;
        private String OPEN_CONNECTION_RESPONSE = "( success ( 1
2 ( ANONYMOUS ) ( edit-pipeline ) ) ) " +
       
"( 2 ANONYMOUS ( ) ( ) )";
        private String AUTHETICATION_REQUEST = "( success ( (
) ";

        SVNSession( Socket soc ) throws Exception
        {
                this.clientSocket
= soc;
        } // end of constructor SVNSession

        public void run()
        {
                try
                {
                        openSVNSession();
                        readInputStream();
                } // end of try block
                catch( Exception e )
                {
                        e.printStackTrace();
                } // end of catch block
        } // end of run method
       
        private void openSVNSession() throws Exception
        {
                byte[] writeBytes
= OPEN_CONNECTION_RESPONSE.getBytes();
                OutputStream socOutputStream =
this.clientSocket.getOutputStream();
                socOutputStream.write( writeBytes );
                System.out.println("SVN hand shake ack sent.");
        } // end of openConnection method
       

        private void readInputStream() throws Exception
        {
                BufferedReader input
= new BufferedReader( new
       
InputStreamReader( this.clientSocket.
       
getInputStream() ) );
                String message
= null;
                while( true  )
                {
                        if(
this.clientSocket.getInputStream().available() > 0 )
                        {
                                System.out.println( "available:" +
this.clientSocket.getInputStream().available() );
                                byte[] readBytes
= new byte[ this.clientSocket.getInputStream().
       
available() ];
                                this.clientSocket.getInputStream().read(
readBytes );
                                System.out.println( new String(
readBytes ) );
                                requestForAuthentication( new String(
readBytes ));
                        }
                } // end of while listening to inputstream
        } // end of readInputStream method
       
        private void processRequest( String request )
        {
        }
       
        private void requestForAuthentication( String response )
                                                throws Exception
        {
                this.clientSocket.getOutputStream().write( (
this.AUTHETICATION_REQUEST + " ( " +
       
response.substring(
       
( response.indexOf( ")" ) + 2 ) ) ).getBytes() );
        }

        private void closeStreams()
                                        throws Exception
        {
                this.clientSocket.getInputStream().close();
                this.clientSocket.getOutputStream().close();
        }
}
 

Please help me in understanding the protocol.

Regards
RP

-----Original Message-----

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************


From: Ben Collins-Sussman [mailto:[hidden email]]
Sent: Friday, May 27, 2005 5:30 PM
To: Ramprasad Venkata Inala
Cc: [hidden email]
Subject: Re: SVN Proxy server



On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:

> Hi,
>
> I need to write a proxy server for SVN ( using the svn protocol  
> i.e., svn:// ).
> I would like to understand protocol for the same. Altough i had  
> gone through the protocol text file in the subversion sources  
> directory.
> I would be grrate ful somebody gives the exact working of the  
> protocol.

Does the 'protocol' document not give a precise-enough description?  
If something's unclear, please ask specific questions.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: SVN Proxy server

Ramprasad Venkata Inala
In reply to this post by Ramprasad Venkata Inala
Anybody please help me in achieving the connectivity.

Note: Please add me to the cc of the mailing list as i am not a member
of this group.

Thanks and regards
RP

-----Original Message-----
From: Ramprasad Venkata Inala
Sent: Thursday, June 02, 2005 10:45 AM
To: '[hidden email]'
Subject: RE: SVN Proxy server

Hi Ben,

I had to write a proxy that would pass through our versions as well
before it reaches the svn.

Client-->SVNproxy-->OurVersioningSystem-->SVN.
The above is the process that i need to follow. Considering the
different protocols that svn has like Http, Https( which are already
handled ) and SVN which need to be handled now in our project.

I had written a socket ( SVN Proxy ) server in java.
Let me put the details how i am proceeding in obtaining the connection.

Note: I use the eclipse svn plugin as the client.

1. First I click Team->Share Project-> SVN( Chosen option ) click next
and pick up an existing svn repsoitory on my machine.
2. Now the proxy receives the request( opening a socket ,
ServerSocket.accept method ) then spawns a new thread that would handle
the request then on, like opening input and output streams. when the
proxy receives the first call to open socket then it sends back reponse
in this format
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) ( 2 ANONYMOUS ( ) (
) )
3. Then the client responds back with this.
( 2 ( edit-pipeline ) 32:svn:///d:/testsvnrep/SVNProtocol )
In my case the testsvnrep is my repository and SVNProtocol is my eclipse
project.
4. Then the proxy sends a reponse to the client in this format
( success ( ( ) 32:localhost/d:/testsvnrep/SVNProtocol ) )

Now the problem starts, after when i send this response to the client
the client opens up anew socket instead of sending on the same socket
that was opened before.

Also attached is the code for the same.

SVNProxy File
--------------

import java.net.ServerSocket;
import java.net.Socket;

public class SVNProxy
{
        public static void main( String[] args ) throws Exception
        {
                ServerSocket serverSoc = new
ServerSocket( 3690 );
                //Socket soc
= null;

                System.out.println("SVN Proxy Started.");
                while( true )
                {
                        System.out.println( "Waiting..." );
                        Socket soc
= serverSoc.accept();
                        System.out.println( "New connection opened on
port::"+soc.getPort() );
                        new Thread( new SVNSession( soc ) ).start();
                        //openSession( soc );
                }
        }


SVNSession File
----------------


import java.net.Socket;
//import java.io.InputStream;
import java.io.OutputStream;
//import java.io.BufferedInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class SVNSession implements Runnable
{
        private Socket clientSocket
= null;
        private String OPEN_CONNECTION_RESPONSE = "( success ( 1
2 ( ANONYMOUS ) ( edit-pipeline ) ) ) " +
       
"( 2 ANONYMOUS ( ) ( ) )";
        private String AUTHETICATION_REQUEST = "( success ( (
) ";

        SVNSession( Socket soc ) throws Exception
        {
                this.clientSocket
= soc;
        } // end of constructor SVNSession

        public void run()
        {
                try
                {
                        openSVNSession();
                        readInputStream();
                } // end of try block
                catch( Exception e )
                {
                        e.printStackTrace();
                } // end of catch block
        } // end of run method
       
        private void openSVNSession() throws Exception
        {
                byte[] writeBytes
= OPEN_CONNECTION_RESPONSE.getBytes();
                OutputStream socOutputStream =
this.clientSocket.getOutputStream();
                socOutputStream.write( writeBytes );
                System.out.println("SVN hand shake ack sent.");
        } // end of openConnection method
       

        private void readInputStream() throws Exception
        {
                BufferedReader input
= new BufferedReader( new
       
InputStreamReader( this.clientSocket.
       
getInputStream() ) );
                String message
= null;
                while( true  )
                {
                        if(
this.clientSocket.getInputStream().available() > 0 )
                        {
                                System.out.println( "available:" +
this.clientSocket.getInputStream().available() );
                                byte[] readBytes
= new byte[ this.clientSocket.getInputStream().
       
available() ];
                                this.clientSocket.getInputStream().read(
readBytes );
                                System.out.println( new String(
readBytes ) );
                                requestForAuthentication( new String(
readBytes ));
                        }
                } // end of while listening to inputstream
        } // end of readInputStream method
       
        private void processRequest( String request )
        {
        }
       
        private void requestForAuthentication( String response )
                                                throws Exception
        {
                this.clientSocket.getOutputStream().write( (
this.AUTHETICATION_REQUEST + " ( " +
       
response.substring(
       
( response.indexOf( ")" ) + 2 ) ) ).getBytes() );
        }

        private void closeStreams()
                                        throws Exception
        {
                this.clientSocket.getInputStream().close();
                this.clientSocket.getOutputStream().close();
        }
}
 

Please help me in understanding the protocol.

Regards
RP

-----Original Message-----
From: Ben Collins-Sussman [mailto:[hidden email]]
Sent: Friday, May 27, 2005 5:30 PM
To: Ramprasad Venkata Inala
Cc: [hidden email]
Subject: Re: SVN Proxy server



On May 27, 2005, at 2:01 AM, Ramprasad Venkata Inala wrote:

> Hi,
>
> I need to write a proxy server for SVN ( using the svn protocol  
> i.e., svn:// ).
> I would like to understand protocol for the same. Altough i had  
> gone through the protocol text file in the subversion sources  
> directory.
> I would be grrate ful somebody gives the exact working of the  
> protocol.

Does the 'protocol' document not give a precise-enough description?  
If something's unclear, please ask specific questions.




**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SVN Proxy server

Erik Huelsmann-2
On 6/2/05, Ramprasad Venkata Inala <[hidden email]> wrote:
> Anybody please help me in achieving the connectivity.

What should that proxy do, apart from forwarding network traffic? If
just that, then why bother writing a program for it? Any router can do
it...
 
In other words, what's the defined behaviour of what you're trying to do?

> Note: Please add me to the cc of the mailing list as i am not a member
> of this group.

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: SVN Proxy server

Ramprasad Venkata Inala
In reply to this post by Ramprasad Venkata Inala
It sends requests in the format that is required by our versioning
system which in turn uses svn/vss/cvs. So when is request sent by a
client that in the svn protocol then the proxy converts it into the
format required by our versioning system and then send it in the format
that the client understands

Rgds
Ramprasad

Note: Please add me to the cc of the mailing list as i am not a member
of this group.

-----Original Message-----

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************


From: Erik Huelsmann [mailto:[hidden email]]
Sent: Thursday, June 02, 2005 10:35 PM
To: Ramprasad Venkata Inala
Cc: [hidden email]
Subject: Re: SVN Proxy server

On 6/2/05, Ramprasad Venkata Inala <[hidden email]> wrote:
> Anybody please help me in achieving the connectivity.

What should that proxy do, apart from forwarding network traffic? If
just that, then why bother writing a program for it? Any router can do
it...
 
In other words, what's the defined behaviour of what you're trying to
do?

> Note: Please add me to the cc of the mailing list as i am not a member
> of this group.

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]