Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/mod_dav_svn.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/mod_dav_svn.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/mod_dav_svn.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/mod_dav_svn.c Sun Jun 14 20:58:10 2015 @@ -143,6 +143,25 @@ init(apr_pool_t *p, apr_pool_t *plog, ap return OK; } +static svn_error_t * +malfunction_handler(svn_boolean_t can_return, + const char *file, int line, + const char *expr) +{ + if (expr) + ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, + "mod_dav_svn: file '%s', line %d, assertion \"%s\" failed", + file, line, expr); + else + ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, + "mod_dav_svn: file '%s', line %d, internal malfunction", + file, line); + abort(); + + /* Should not be reached. */ + return SVN_NO_ERROR; +} + static int init_dso(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) { @@ -162,6 +181,8 @@ init_dso(apr_pool_t *pconf, apr_pool_t * return HTTP_INTERNAL_SERVER_ERROR; } + svn_error_set_malfunction_handler(malfunction_handler); + return OK; } @@ -249,7 +270,7 @@ merge_dir_config(apr_pool_t *p, void *ba newconf->txdelta_cache = INHERIT_VALUE(parent, child, txdelta_cache); newconf->fulltext_cache = INHERIT_VALUE(parent, child, fulltext_cache); newconf->revprop_cache = INHERIT_VALUE(parent, child, revprop_cache); - newconf->block_read = INHERIT_VALUE(parent, child, block_read); + newconf->block_read = INHERIT_VALUE(parent, child, block_read); newconf->root_dir = INHERIT_VALUE(parent, child, root_dir); newconf->hooks_env = INHERIT_VALUE(parent, child, hooks_env);
Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/get-location-segments.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/get-location-segments.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/get-location-segments.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/get-location-segments.c Sun Jun 14 20:58:10 2015 @@ -177,16 +177,37 @@ dav_svn__get_location_segments_report(co if (! abs_path) return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0, "Not all parameters passed"); - if (SVN_IS_VALID_REVNUM(start_rev) - && SVN_IS_VALID_REVNUM(end_rev) - && (end_rev > start_rev)) - return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0, + + /* No START_REV or PEG_REVISION? We'll use HEAD. */ + if (!SVN_IS_VALID_REVNUM(start_rev) || !SVN_IS_VALID_REVNUM(peg_revision)) + { + svn_revnum_t youngest; + + serr = svn_fs_youngest_rev(&youngest, resource->info->repos->fs, + resource->pool); + if (serr != NULL) + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + "Could not determine youngest revision", + resource->pool); + + if (!SVN_IS_VALID_REVNUM(start_rev)) + start_rev = youngest; + if (!SVN_IS_VALID_REVNUM(peg_revision)) + peg_revision = youngest; + } + + /* No END_REV? We'll use 0. */ + if (!SVN_IS_VALID_REVNUM(end_rev)) + end_rev = 0; + + if (end_rev > start_rev) + return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, + SVN_ERR_FS_NO_SUCH_REVISION, "End revision must not be younger than " "start revision"); - if (SVN_IS_VALID_REVNUM(peg_revision) - && SVN_IS_VALID_REVNUM(start_rev) - && (start_rev > peg_revision)) - return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0, + if (start_rev > peg_revision) + return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, + SVN_ERR_FS_NO_SUCH_REVISION, "Start revision must not be younger than " "peg revision"); Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/inherited-props.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/inherited-props.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/inherited-props.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/inherited-props.c Sun Jun 14 20:58:10 2015 @@ -61,6 +61,7 @@ dav_svn__get_inherited_props_report(cons int i; svn_revnum_t rev = SVN_INVALID_REVNUM; apr_pool_t *iterpool; + svn_node_kind_t kind; /* Sanity check. */ if (!resource->info->repos_path) @@ -114,6 +115,20 @@ dav_svn__get_inherited_props_report(cons "couldn't retrieve revision root", resource->pool); + serr = svn_fs_check_path(&kind, root, path, resource->pool); + if (!serr && kind == svn_node_none) + { + serr = svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL, + "'%s' path not found", path); + } + + if (serr) + { + derr = dav_svn__convert_err(serr, HTTP_BAD_REQUEST, NULL, + resource->pool); + goto cleanup; + } + serr = svn_repos_fs_get_inherited_props(&inherited_props, root, path, NULL, dav_svn__authz_read_func(&arb), &arb, resource->pool, iterpool); Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/log.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/log.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/log.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/reports/log.c Sun Jun 14 20:58:10 2015 @@ -65,6 +65,10 @@ struct log_receiver_baton /* whether the client can handle encoded binary property values */ svn_boolean_t encode_binary_props; + + /* Helper variables to force early bucket brigade flushes */ + int result_count; + int next_forced_flush; }; @@ -282,6 +286,41 @@ log_receiver(void *baton, SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output, "</S:log-item>" DEBUG_CR)); + /* In general APR will flush the brigade every 8000 bytes through the filter + stack, but log items may not be generated that fast, especially in + combination with authz and busy servers. We now explictly flush after + log-item 4, 16, 64 and 256 to produce a few results fast. + + This introduces 4 full flushes of our brigade and the installed output + filters at growing intervals and then falls back to the standard + buffering of 8000 bytes + whatever buffers are added in output filters. */ + lrb->result_count++; + if (lrb->result_count == lrb->next_forced_flush) + { + apr_status_t apr_err; + + /* This flush is similar to that in dav_svn__final_flush_or_error(). + + Compared to using ap_filter_flush(), which we use in other place + this adds a flush frame before flushing the brigade, to make output + filters perform a flush as well */ + + /* No brigade empty check. We want output filters to flush anyway */ + apr_err = ap_fflush(lrb->output, lrb->bb); + if (apr_err) + return svn_error_create(apr_err, NULL, NULL); + + /* Check for an aborted connection, just like our brigade write + helper functions, since the brigade functions don't appear to + be return useful errors when the connection is dropped. */ + if (lrb->output->c->aborted) + return svn_error_create(SVN_ERR_APMOD_CONNECTION_ABORTED, + NULL, NULL); + + if (lrb->result_count < 256) + lrb->next_forced_flush = lrb->next_forced_flush * 4; + } + return SVN_NO_ERROR; } @@ -427,6 +466,9 @@ dav_svn__log_report(const dav_resource * lrb.stack_depth = 0; /* lrb.requested_custom_revprops set above */ + lrb.result_count = 0; + lrb.next_forced_flush = 4; + /* Our svn_log_entry_receiver_t sends the <S:log-report> header in a lazy fashion. Before writing the first log message, it assures that the header has already been sent (checking the needs_header Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/repos.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/repos.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/repos.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/repos.c Sun Jun 14 20:58:10 2015 @@ -1858,6 +1858,22 @@ do_out_of_date_check(dav_resource_combin "Attempting to modify out-of-date resource.", r->pool); } + else if (comb->priv.version_name > created_rev) + { + svn_revnum_t txn_base_rev; + + txn_base_rev = svn_fs_txn_base_revision(comb->res.info->root.txn); + if (comb->priv.version_name > txn_base_rev) + { + serr = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL, + "No such revision %ld", + comb->priv.version_name); + + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + "Unknown base revision", + r->pool); + } + } } else if (comb->res.collection) { @@ -1932,7 +1948,7 @@ do_out_of_date_check(dav_resource_combin r->pool); } - if (node_relation != svn_fs_node_same) + if (node_relation != svn_fs_node_unchanged) { serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL, "Directory '%s' is out of date", @@ -2110,6 +2126,16 @@ get_resource(request_rec *r, xslt_uri = dav_svn__get_xslt_uri(r); fs_parent_path = dav_svn__get_fs_parent_path(r); + if (r->method_number == M_COPY) + { + /* Workaround for issue #4531: Avoid a depth-infinity walk on + the copy source by overriding the Depth header here. + mod_dav defaults to infinite depth if this header is not set + which makes copies O(size of source) rather than the desired O(1). + ### Should be fixed by an explicit provider API feature in mod_dav. */ + apr_table_setn(r->headers_in, "Depth", "0"); + } + /* Special case: detect and build the SVNParentPath as a unique type of private resource, iff the SVNListParentPath directive is 'on'. */ if (dav_svn__is_parentpath_list(r)) @@ -4099,6 +4125,22 @@ remove_resource(dav_resource *resource, "Can't DELETE out-of-date resource", resource->pool); } + else if (resource->info->version_name > created_rev) + { + svn_revnum_t txn_base_rev; + + txn_base_rev = svn_fs_txn_base_revision(resource->info->root.txn); + if (resource->info->version_name > txn_base_rev) + { + serr = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL, + "No such revision %ld", + resource->info->version_name); + + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + "Unknown base revision", + resource->pool); + } + } } /* Before attempting the filesystem delete, we need to push any Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/status.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/status.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/status.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/status.c Sun Jun 14 20:58:10 2015 @@ -30,7 +30,7 @@ #include "private/svn_fs_private.h" #ifndef DEFAULT_TIME_FORMAT -#define DEFAULT_TIME_FORMAT "%F %H:%M:%S %z" +#define DEFAULT_TIME_FORMAT "%Y-%m-%d %H:%M:%S %Z" #endif /* A bit like mod_status: add a location: @@ -57,7 +57,7 @@ int dav_svn__status(request_rec *r) ap_set_content_type(r, "text/html; charset=ISO-8859-1"); - ap_rvputs(r, + ap_rvputs(r, DOCTYPE_HTML_3_2 "<html><head>\n" "<title>Apache SVN Status</title>\n" Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/util.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/util.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/util.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/util.c Sun Jun 14 20:58:10 2015 @@ -40,6 +40,7 @@ #include "dav_svn.h" #include "private/svn_fspath.h" +#include "private/svn_string_private.h" dav_error * dav_svn__new_error(apr_pool_t *pool, @@ -135,6 +136,7 @@ dav_svn__convert_err(svn_error_t *serr, switch (purged_serr->apr_err) { case SVN_ERR_FS_NOT_FOUND: + case SVN_ERR_FS_NO_SUCH_REVISION: status = HTTP_NOT_FOUND; break; case SVN_ERR_UNSUPPORTED_FEATURE: @@ -216,7 +218,7 @@ dav_svn__get_safe_cr(svn_fs_root_t *root return revision; } - if (node_relation == svn_fs_node_same) + if (node_relation == svn_fs_node_unchanged) return history_rev; /* the history rev is safe! the same node exists at the same path in both revisions. */ @@ -819,7 +821,7 @@ request_body_to_string(svn_string_t **re { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Request body is larger than the configured " - "limit of %lu", (unsigned long)limit_req_body); + "limit of %" APR_OFF_T_FMT, limit_req_body); result = HTTP_REQUEST_ENTITY_TOO_LARGE; goto cleanup; } @@ -834,9 +836,7 @@ request_body_to_string(svn_string_t **re apr_brigade_destroy(brigade); /* Make an svn_string_t from our svn_stringbuf_t. */ - *request_str = svn_string_create_empty(pool); - (*request_str)->data = buf->data; - (*request_str)->len = buf->len; + *request_str = svn_stringbuf__morph_into_string(buf); return OK; cleanup: Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/version.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/version.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/mod_dav_svn/version.c (original) +++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/version.c Sun Jun 14 20:58:10 2015 @@ -751,7 +751,7 @@ dav_svn__checkout(dav_resource *resource svn_error_clear(serr); return err; } - if (node_relation != svn_fs_node_same) + if (node_relation != svn_fs_node_unchanged) { return dav_svn__new_error_svn (resource->pool, HTTP_CONFLICT, SVN_ERR_FS_CONFLICT,
