You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by 张扬 <la...@gmail.com> on 2012/03/06 15:32:15 UTC

some doubts about the svn Packet

Dear All:
    I'm interested in subversion and i want to know how the client
communicate with the subversion based on apache web server.I use
wireshark to get the package when check-out a directory in the server
,and find that after a options method with authorization there are
many propfind methods,and many URL in the propfind command line is
the same,i can't understand,if you want to get the specific version's
URL,just use:
1).Fetch the following properties from the given URL
    DAV:version-controlled-configuration
    svn:baseline-relative-path
    DAV:resourcetype
2). Fetch the DAV:checked-in and a Label header from the VCC(we got
it in the step 1),it points to the Baseline

3).From the Baseline, we fetch the following properties:
    DAV:baseline-collection
    DAV:version-name
and the href in DAV:baseline-collection is the URL we need.

    So,in my opinion,three propfind is enough to checkout a directory.
But the fact is,the client create two TCP connection,and in every
connection client will repeat the 3 steps.I can't find doc to declare
the principle,wish a reply that can release my doubts.
                                                        Thanks.
                                                          Yang Zhang

Re: some doubts about the svn Packet

Posted by Philip Martin <ph...@wandisco.com>.
张扬 <la...@gmail.com> writes:

>     I'm interested in subversion and i want to know how the client
> communicate with the subversion based on apache web server.I use
> wireshark to get the package when check-out a directory in the server
> ,and find that after a options method with authorization there are
> many propfind methods,and many URL in the propfind command line is
> the same,i can't understand,if you want to get the specific version's
> URL,just use:
> 1).Fetch the following properties from the given URL
>     DAV:version-controlled-configuration
>     svn:baseline-relative-path
>     DAV:resourcetype
> 2). Fetch the DAV:checked-in and a Label header from the VCC(we got
> it in the step 1),it points to the Baseline
>
> 3).From the Baseline, we fetch the following properties:
>     DAV:baseline-collection
>     DAV:version-name
> and the href in DAV:baseline-collection is the URL we need.
>
>     So,in my opinion,three propfind is enough to checkout a directory.
> But the fact is,the client create two TCP connection,and in every
> connection client will repeat the 3 steps.I can't find doc to declare
> the principle,wish a reply that can release my doubts.

The reason there are two connections is that checkout first contact the
server to determine whether the given URL is directory or not, see
subversion/libsvn_client/checkout.c:svn_client__checkout_internal
That uses one connection that is closed.  If the URL is a directory then
the client runs update and that opens a second connection.

We could avoid the close and second open by passing the first connection
into the update code.  That might be worth doing but it's probably only
a small gain in most checkouts.

The number of PROPFINDs depends partly on which client/server versions
are in use. Subversion 1.7 introduced the v2 protocol which has fewer
PROPFINDs.

Some notes about Subversion's use of DeltaV/WebDAV here:
http://svn.apache.org/repos/asf/subversion/trunk/notes/http-and-webdav/

-- 
Philip