Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf

subversion
Discussion topic

There will be a brief maintenance window every Friday at 17:00 Pacific.
For further details, see CollabNet's maintenance and upgrade policy.

Back to topic list

Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf

Author gstein
Full name Greg Stein
Date 2008-12-24 08:56:25 PST
Message The old-fashioned code can cache the youngest rev.

It also looks like the key compare is bad. How can you compare to
"svn"? Do you mean to compare just the first three letters?



On Dec 23, 2008, at 20:06, Ben Collins-Sussman <sussman at red-bean dot com>
wrote:

> Author: sussman
> Date: Tue Dec 23 20:06:49 2008
> New Revision: 34914
>
> Log:
> Make serf notice and hold onto the v2 "stubs" in its session_t.
> This should happen right in the initial ra_open() call, when the RA
> session kicks off.
>
> * subversion/libsvn_ra​_serf/options.c
> (capabilities_header​s_iterator_callback)​: notice the new v2 stub
> headers, and save the values in the master session_t.
>
> * subversion/libsvn_ra​_serf/ra_serf.h
> (struct svn_ra_serf__session_t): add (cached) youngest_rev field.
>
> * subversion/libsvn_ra​_serf/serf.c
> (svn_ra_serf__open): initialize session's youngest_rev field.
> (svn_ra_serf__get_la​test_revnum): try to return cached
> youngest_rev first!
>
> Modified:
> branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/options.​c
> branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/ra_serf.​h
> branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/serf.c
>
> Modified: branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/
> options.c
> URL: http://svn.collab.ne​t/viewvc/svn/branche​s/http-protocol-v2/s​ubversion/libsvn_ra_​serf/options.c?pathr​ev=34914&r1=3491​3&r2=34914
> ===
> ===
> ===
> ====================​====================​====================​=========
> --- branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/options.​c
> Tue Dec 23 18:57:28 2008 (r34913)
> +++ branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/options.​c
> Tue Dec 23 20:06:49 2008 (r34914)
> @@ -310,6 +310,22 @@ capabilities_headers​_iterator_callback(v​
> }
> }
>
> + /* SVN-specific headers -- if present, server supports HTTP
> protocol v2 */
> + if (svn_cstring_casecmp(key, "svn") == 0)
> + {
> + if (svn_cstring_casecmp(key, SVN_DAV_ROOT_STUB_HEADER) == 0)
> + orc->session->root_stub = apr_pstrdup(orc->​session->pool,
> val);
> +
> + if (svn_cstring_casecmp(key, SVN_DAV_PEGREV_STUB_HEADER) == 0)
> + orc->session->pegrev_stub = apr_pstrdup(orc->​session->pool,
> val);
> +
> + if (svn_cstring_casecmp(key, SVN_DAV_REV_STUB_HEADER) == 0)
> + orc->session->rev_stub = apr_pstrdup(orc->​session->pool,
> val);
> +
> + if (svn_cstring_casecmp(key, SVN_DAV_YOUNGEST_REV_HEADER) == 0)
> + orc->session->​youngest_rev = SVN_STR_TO_REV(val);
> + }
> +
> return 0;
> }
>
>
> Modified: branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/
> ra_serf.h
> URL: http://svn.collab.ne​t/viewvc/svn/branche​s/http-protocol-v2/s​ubversion/libsvn_ra_​serf/ra_serf.h?pathr​ev=34914&r1=3491​3&r2=34914
> ===
> ===
> ===
> ====================​====================​====================​=========
> --- branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/ra_serf.​h
> Tue Dec 23 18:57:28 2008 (r34913)
> +++ branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/ra_serf.​h
> Tue Dec 23 20:06:49 2008 (r34914)
> @@ -202,6 +202,10 @@ struct svn_ra_serf__session_t {
> /* Repository UUID */
> const char *uuid;
>
> + /* Cached HEAD revnum of the repository: for v2 protocol, usually
> + returned by initial OPTIONS response. */
> + svn_revnum_t youngest_rev;
> +
> /* Opaque URL "stubs". If the OPTIONS response returns these, then
> we know we're using HTTP protocol v2. */
> const char *root_stub; /* where to send REPORT requests */
>
> Modified: branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/serf.c
> URL: http://svn.collab.ne​t/viewvc/svn/branche​s/http-protocol-v2/s​ubversion/libsvn_ra_​serf/serf.c?pathrev=​34914&r1=34913​&r2=34914
> ===
> ===
> ===
> ====================​====================​====================​=========
> --- branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/serf.c
> Tue Dec 23 18:57:28 2008 (r34913)
> +++ branches/http-protoc​ol-v2/subversion/lib​svn_ra_serf/serf.c
> Tue Dec 23 20:06:49 2008 (r34914)
> @@ -385,6 +385,8 @@ svn_ra_serf__open(sv​n_ra_session_t *sess
> if (url.path == NULL || url.path[0] == '\0')
> url.path = apr_pstrdup(serf_sess->pool, "/");
>
> + serf_sess->youngest_rev = SVN_INVALID_REVNUM;
> +
> serf_sess->repos_url = url;
> serf_sess->repos_url_str = apr_pstrdup(serf_sess->pool, repos_URL);
>
> @@ -520,6 +522,14 @@ svn_ra_serf__get_lat​est_revnum(svn_ra_se​
> const char *relative_url, *basecoll_url;
> svn_ra_serf__session_t *session = ra_session->priv;
>
> + /* Using HTTP protocol v2; already got it in the initial OPTIONS
> response. */
> + if (SVN_IS_VALID_REVNUM​(session->younges​t_rev))
> + {
> + *latest_revnum = session->youngest_rev;
> + return SVN_NO_ERROR;
> + }
> +
> + /* Fall back to old-fashioned way of getting it. */
> return svn_ra_serf__get_bas​eline_info(&base​coll_url, &relative_url,
> session, session-
> >repos_url.path,
> SVN_INVALID_REVNUM,
> latest_revnum,
>
> --------------------​--------------------​--------------
> http://subversion.ti​gris.org/ds/viewMess​age.do?dsForumId=495​&dsMessageId=991​228

« Previous message in topic | 1 of 18 | Next message in topic »

Messages

Show all messages in topic

Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf gstein Greg Stein 2008-12-24 08:56:25 PST
     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2008-12-24 10:45:37 PST
         Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf gstein Greg Stein 2008-12-25 00:06:23 PST
     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf pretzelgod Eric Gillespie 2008-12-25 02:18:30 PST
         Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2009-01-09 09:33:55 PST
             Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf gstein Greg Stein 2009-01-09 10:24:02 PST
                 Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2009-01-09 13:22:54 PST
                     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf gstein Greg Stein 2009-01-09 14:10:42 PST
                         Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf cmpilato C. Michael Pilato 2009-01-12 06:25:48 PST
             Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2009-01-13 13:30:03 PST
                 Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf cmpilato C. Michael Pilato 2009-01-13 13:37:10 PST
                     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2009-01-13 14:13:16 PST
                     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf gstein Greg Stein 2009-01-13 15:23:00 PST
                         Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf pretzelgod Eric Gillespie 2009-01-13 17:22:47 PST
                             Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf jerenkrantz Justin Erenkrantz 2009-01-13 18:10:31 PST
                                 Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf pretzelgod Eric Gillespie 2009-01-13 18:38:27 PST
                                 Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf sussman Ben Collins-Sussman 2009-01-13 21:12:31 PST
                                     Re: svn commit: r34914 - branches/http-protocol-v2/subversion/libsvn_ra_serf cmpilato C. Michael Pilato 2009-01-14 05:23:02 PST
Messages per page: