[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r35333 - in trunk/subversion: include libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_subr mod_dav_svn/reports svnserve

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 21 Jan 2009 09:37:44 +0100

On Mon, Jan 19, 2009 at 20:55, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>...
> +++ trunk/subversion/libsvn_ra_svn/client.c Mon Jan 19 11:55:36 2009 (r35333)
>...
> @@ -1065,7 +1041,7 @@ static svn_error_t *ra_svn_get_dir(svn_r
> &crev, &cdate, &cauthor));
> name = svn_path_canonicalize(name, pool);
> dirent = apr_palloc(pool, sizeof(*dirent));
> - SVN_ERR(interpret_kind(kind, pool, &dirent->kind));
> + dirent->kind = svn_node_kind_from_word(kind);
> dirent->size = size;/* FIXME: svn_filesize_t */
> dirent->has_props = has_props;
> dirent->created_rev = crev;
> @@ -1364,7 +1340,7 @@ static svn_error_t *ra_svn_log(svn_ra_se
> change->action = *action;
> change->copyfrom_path = copy_path;
> change->copyfrom_rev = copy_rev;
> - SVN_ERR(interpret_kind(kind_str, pool, &change->node_kind));
> + change->node_kind = svn_node_kind_from_word(kind_str);
> apr_hash_set(cphash, cpath, APR_HASH_KEY_STRING, change);
> }
> }
> @@ -1444,7 +1420,7 @@ static svn_error_t *ra_svn_check_path(sv
> SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "check-path", "c(?r)", path, rev));
> SVN_ERR(handle_auth_request(sess_baton, pool));
> SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "w", &kind_word));
> - SVN_ERR(interpret_kind(kind_word, pool, kind));
> + *kind = svn_node_kind_from_word(kind_word);
> return SVN_NO_ERROR;
> }
>
> @@ -1493,7 +1469,7 @@ static svn_error_t *ra_svn_stat(svn_ra_s
> &crev, &cdate, &cauthor));
>
> the_dirent = apr_palloc(pool, sizeof(*the_dirent));
> - SVN_ERR(interpret_kind(kind, pool, &the_dirent->kind));
> + the_dirent->kind = svn_node_kind_from_word(kind);
> the_dirent->size = size;/* FIXME: svn_filesize_t */
> the_dirent->has_props = has_props;
> the_dirent->created_rev = crev;

You lost error returns in these three cases. Could be that ra_svn will
crash if left with svn_node_unknown in that field. You need to check
for that, and (continue to) return an error.

Arguably, some of the other locations may need error checks, too (even
though they were lax before).

> +++ trunk/subversion/svnserve/serve.c Mon Jan 19 11:55:36 2009 (r35333)
>...
> @@ -1520,7 +1500,7 @@ static svn_error_t *get_dir(svn_ra_svn_c
> cdate = (entry->time == (time_t) -1) ? NULL
> : svn_time_to_cstring(entry->time, pool);
> SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
> - kind_word(entry->kind),
> + svn_node_kind_to_word(entry->kind),
> (apr_uint64_t) entry->size,
> entry->has_props, entry->created_rev,
> cdate, entry->last_author));
> @@ -1844,7 +1824,8 @@ static svn_error_t *log_receiver(void *b
> SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cw(?cr)(?c)", path,
> action, change->copyfrom_path,
> change->copyfrom_rev,
> - kind_word(change->node_kind)));
> + svn_node_kind_to_word(
> + change->node_kind)));
> }
> }
> svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops);
> @@ -1993,7 +1974,8 @@ static svn_error_t *check_path(svn_ra_sv
>
> SVN_CMD_ERR(svn_fs_revision_root(&root, b->fs, rev, pool));
> SVN_CMD_ERR(svn_fs_check_path(&kind, root, full_path, pool));
> - SVN_ERR(svn_ra_svn_write_cmd_response(conn, pool, "w", kind_word(kind)));
> + SVN_ERR(svn_ra_svn_write_cmd_response(conn, pool, "w",
> + svn_node_kind_to_word(kind)));
> return SVN_NO_ERROR;
> }
>
> @@ -2036,7 +2018,7 @@ static svn_error_t *stat(svn_ra_svn_conn
> : svn_time_to_cstring(dirent->time, pool);
>
> SVN_ERR(svn_ra_svn_write_cmd_response(conn, pool, "((wnbr(?c)(?c)))",
> - kind_word(dirent->kind),
> + svn_node_kind_to_word(dirent->kind),
> (apr_uint64_t) dirent->size,
> dirent->has_props, dirent->created_rev,
> cdate, dirent->last_author));

And same above...

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040600
Received on 2009-01-21 09:38:42 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.