diff options
Diffstat (limited to 'subversion/libsvn_ra_serf/getlocationsegments.c')
-rw-r--r-- | subversion/libsvn_ra_serf/getlocationsegments.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/subversion/libsvn_ra_serf/getlocationsegments.c b/subversion/libsvn_ra_serf/getlocationsegments.c index e5c58a9..884ab5d 100644 --- a/subversion/libsvn_ra_serf/getlocationsegments.c +++ b/subversion/libsvn_ra_serf/getlocationsegments.c @@ -52,8 +52,8 @@ typedef struct gls_context_t { } gls_context_t; -enum { - INITIAL = 0, +enum locseg_state_e { + INITIAL = XML_STATE_INITIAL, REPORT, SEGMENT }; @@ -84,6 +84,8 @@ gls_closed(svn_ra_serf__xml_estate_t *xes, const char *path; const char *start_str; const char *end_str; + apr_int64_t start_val; + apr_int64_t end_val; svn_location_segment_t segment; SVN_ERR_ASSERT(leaving_state == SEGMENT); @@ -95,9 +97,12 @@ gls_closed(svn_ra_serf__xml_estate_t *xes, /* The transition table said these must exist. */ SVN_ERR_ASSERT(start_str && end_str); + SVN_ERR(svn_cstring_atoi64(&start_val, start_str)); + SVN_ERR(svn_cstring_atoi64(&end_val, end_str)); + segment.path = path; /* may be NULL */ - segment.range_start = SVN_STR_TO_REV(start_str); - segment.range_end = SVN_STR_TO_REV(end_str); + segment.range_start = (svn_revnum_t)start_val; + segment.range_end = (svn_revnum_t)end_val; SVN_ERR(gls_ctx->receiver(&segment, gls_ctx->receiver_baton, scratch_pool)); return SVN_NO_ERROR; @@ -109,7 +114,8 @@ static svn_error_t * create_gls_body(serf_bucket_t **body_bkt, void *baton, serf_bucket_alloc_t *alloc, - apr_pool_t *pool) + apr_pool_t *pool /* request pool */, + apr_pool_t *scratch_pool) { serf_bucket_t *buckets; gls_context_t *gls_ctx = baton; @@ -119,7 +125,7 @@ create_gls_body(serf_bucket_t **body_bkt, svn_ra_serf__add_open_tag_buckets(buckets, alloc, "S:get-location-segments", "xmlns:S", SVN_XML_NAMESPACE, - NULL); + SVN_VA_NULL); svn_ra_serf__add_tag_buckets(buckets, "S:path", gls_ctx->path, @@ -173,31 +179,29 @@ svn_ra_serf__get_location_segments(svn_ra_session_t *ra_session, gls_ctx->receiver_baton = receiver_baton; SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */, - session, NULL /* conn */, - NULL /* url */, peg_revision, + session, NULL /* url */, peg_revision, pool, pool)); xmlctx = svn_ra_serf__xml_context_create(gls_ttable, NULL, gls_closed, NULL, gls_ctx, pool); - handler = svn_ra_serf__create_expat_handler(xmlctx, pool); + handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool); handler->method = "REPORT"; handler->path = req_url; handler->body_delegate = create_gls_body; handler->body_delegate_baton = gls_ctx; handler->body_type = "text/xml"; - handler->conn = session->conns[0]; - handler->session = session; err = svn_ra_serf__context_run_one(handler, pool); - err = svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline, - handler->path, - handler->location), - err); + if (!err) + { + err = svn_ra_serf__error_on_status(handler->sline, + handler->path, + handler->location); + } if (err && (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)) return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL); |