[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: SVN Protocol

From: Ramprasad Venkata Inala <rinala_at_cordys.com>
Date: 2005-06-11 14:32:45 CEST

Hi,

I could the get whole of protocol from the ethereal. Thanks for the
help.
But it when I am trying to do the same there is some problem.
The code is written in java.
Proxy:( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) )
Client:( 2 ( edit-pipeline ) 18:svn://10.192.61.27 )
Till here it's ok i.e., the client responds to the proxy's response
But when proxy sends the next response the client does not respond.
Below is the proxy's response I have tried both but it is of no vail.
Proxy:( success ( ( ANONYMOUS CRAM-MD5 ) 8:svnrepos ) )
                or
       ( success ( ( ANONYMOUS ) 0: ) )
Also attached are the java files

Note:
Max: Your are not able to capture the n/w data on your because ethereal
is not capture data on the same m/c. Try putting them client and server
in different m/c
Sameer: Thanks for the info. I apologise if I had tried to put to many
questions on board. But I tried to ask the same question in different
ways to get any answer.

Regards
Ramprasad
-----Original Message-----
From: Max Bowsher [mailto:maxb@ukf.net]
Sent: Friday, June 10, 2005 11:21 PM
To: Ramprasad Venkata Inala
Cc: dev@subversion.tigris.org
Subject: Re: SVN Protocol

VK Sameer wrote:
> Here's a suggested approach:
>
> Run svnserve on the same machine as the svn client.
> Run Ethereal to trace the packets on the loopback interface. See the
> HACKING document for hints/instructions on how to do that or the
> Ethereal documentation.
> Perform various operations (that your proxy should track) using the
svn
> client.
> For each operation, save the trace.
> Compare the traces against the protocol document
> in the svn repository to build requirements for your proxy.
> Use those traces to implement your proxy.
>
> This strategy is likely to reduce the difficulty in setting up a
network
> sniffer on multiple machines.
>
> Your emails ask for help with a variety of things. It is difficult to
> respond to all of them, so it would make it easier to respond if one
> email focuses on a specific area. Often, following this focusing
> procedure will in turn help you to do the research yourself using the
> detailed information in the mailing list archives. Specifically, in an
> email, list the operation the client is doing, as e.g.:
>
> svn ls svn://localhost/repos/foo-repos/trunk/bar-file
>
> Then, if svnserve or svn doesn't behave according to your
understanding
> of the svnserve protocol for a specific svn operation, send an email
> describing your understanding, the operation, what actually happened,
> and, if possible, your conjecture about why the client or server
behaved
> the way they did. I think you will probably get a more useful
response.

Agree with all of the above.

I couldn't get ethereal to work for me, though, so I hacked up a rather
crude piece of Python to display stuff for me.

Here's a "svn ls":

[1] Got a connection from ('127.0.0.1', 4212)
[1] > '( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) '
[1] < '( 2 ( edit-pipeline ) 26:svn://localhost:8037/mob22 ) '
[1] > '( success ( ( ANONYMOUS CRAM-MD5 ) 18:Max-Personal-Realm ) ) '
[1] < '( ANONYMOUS ( 0: ) ) '
[1] > '( success ( ) ) ( success (
36:f6e90260-9ef4-0310-bc2a-c870f8ee9a5a
26:svn://localhost:8037/mob22 ) ) '
[1] < '( get-latest-rev ( ) ) '
[1] > '( success ( ( ) 0: ) ) ( success ( 48 ) ) '
[1] < '( get-latest-rev ( ) ) '
[1] > '( success ( ( ) 0: ) ) ( success ( 48 ) ) '
[1] < '( get-locations ( 0: 48 ( 48 ) ) ) '
[1] > '( success ( ( ) 0: ) ) ( 48 1:/ ) done ( success ( ) ) '
[1] Connection closed
[2] Got a connection from ('127.0.0.1', 4216)
[2] > '( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline ) ) ) '
[2] < '( 2 ( edit-pipeline ) 26:svn://localhost:8037/mob22 ) '
[2] > '( success ( ( ANONYMOUS CRAM-MD5 ) 18:Max-Personal-Realm ) ) '
[2] < '( ANONYMOUS ( 0: ) ) '
[2] > '( success ( ) ) ( success (
36:f6e90260-9ef4-0310-bc2a-c870f8ee9a5a
26:svn://localhost:8037/mob22 ) ) '
[2] < '( check-path ( 0: ( 48 ) ) ) '
[2] > '( success ( ( ) 0: ) ) ( success ( dir ) ) '
[2] < '( get-dir ( 0: ( 48 ) false true ) ) '
[2] > '( success ( ( ) 0: ) ) ( success ( 48 ( ) ( ( 4:home dir 0 true
45
( 27:2005-05-09T17:11:26.963516Z ) ( 5:mob22 ) ) ( 8:projects dir 0
false 48
( 27:2005-06-02T20:47:32.500216Z ) ( 3:max ) ) ) ) ) '
[2] Connection closed

#!/usr/bin/python

import socket
import thread

PORT = 8037
BUFSIZ = 1024

def serve(client, addr, connid):
  print "[%s] Got a connection from %s" % (connid, addr)
  client.setblocking(0)
  ups = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  ups.connect(("localhost",3690))
  ups.setblocking(0)
  while 1:
    try:
      d = client.recv(BUFSIZ)
      if d == '':
        break
      print '[%d] < %s' % (connid, repr(d))
      ups.sendall(d)
    except socket.error, (errno, msg):
      if errno == 11: pass
      else: raise
    try:
      d = ups.recv(BUFSIZ)
      if d == '':
        break
      print '[%d] > %s' % (connid, repr(d))
      client.sendall(d)
    except socket.error, (errno, msg):
      if errno == 11: pass
      else: raise
  client.close()
  ups.close()
  print "[%d] Connection closed" % (connid,)

def main():
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.bind(("", PORT))
  s.listen(5)

  conncount = 0

  while True:
    client, addr = s.accept()
    conncount += 1
    thread.start_new_thread(serve, (client, addr, conncount))

if __name__ == '__main__':
  main()

Max.

**********************************************************************
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: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Jun 11 14:33:46 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.