[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: Max Bowsher <maxb_at_ukf.net>
Date: 2005-06-10 19:50:55 CEST

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 10 19:52:11 2005

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