subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1331054 - in /subversion/branches/1.6.x-r1306111: ./ subversion/libsvn_ra_svn/client.c subversion/svnserve/serve.c
Date Thu, 26 Apr 2012 19:58:39 GMT
Author: danielsh
Date: Thu Apr 26 19:58:38 2012
New Revision: 1331054

URL: http://svn.apache.org/viewvc?rev=1331054&view=rev
Log:
On the 1.6.x-r1306111 branch, "reintegrate" the 1.7.x-r1306111 branch:

Merge revisions r1306301:r1331000 (i.e., creation through HEAD) of the
1.7.x-r1306111 branch.

Modified:
    subversion/branches/1.6.x-r1306111/   (props changed)
    subversion/branches/1.6.x-r1306111/subversion/libsvn_ra_svn/client.c
    subversion/branches/1.6.x-r1306111/subversion/svnserve/serve.c

Propchange: subversion/branches/1.6.x-r1306111/
------------------------------------------------------------------------------
  Merged /subversion/branches/1.7.x-r1306111:r1306302-1331000
  Merged /subversion/trunk:r1306111

Modified: subversion/branches/1.6.x-r1306111/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-r1306111/subversion/libsvn_ra_svn/client.c?rev=1331054&r1=1331053&r2=1331054&view=diff
==============================================================================
--- subversion/branches/1.6.x-r1306111/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/1.6.x-r1306111/subversion/libsvn_ra_svn/client.c Thu Apr 26 19:58:38
2012
@@ -1095,7 +1095,18 @@ static svn_error_t *ra_svn_get_dir(svn_r
       dirent->size = size;/* FIXME: svn_filesize_t */
       dirent->has_props = has_props;
       dirent->created_rev = crev;
-      SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
+      /* NOTE: the tuple's format string says CDATE may be NULL. But this
+         function does not allow that. The server has always sent us some
+         random date, however, so this just happens to work. But let's
+         be wary of servers that are (improperly) fixed to send NULL.
+
+         Note: they should NOT be "fixed" to send NULL, as that would break
+         any older clients which received that NULL. But we may as well
+         be defensive against a malicous server.  */
+      if (cdate == NULL)
+        dirent->time = 0;
+      else
+        SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
       dirent->last_author = cauthor;
       apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
     }

Modified: subversion/branches/1.6.x-r1306111/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-r1306111/subversion/svnserve/serve.c?rev=1331054&r1=1331053&r2=1331054&view=diff
==============================================================================
--- subversion/branches/1.6.x-r1306111/subversion/svnserve/serve.c (original)
+++ subversion/branches/1.6.x-r1306111/subversion/svnserve/serve.c Thu Apr 26 19:58:38 2012
@@ -1499,12 +1499,18 @@ static svn_error_t *get_dir(svn_ra_svn_c
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(!"));
   if (want_contents)
     {
+      const char *missing_date = svn_time_to_cstring(0, pool);
       for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
         {
           apr_hash_this(hi, &key, NULL, &val);
           name = key;
           entry = val;
-          cdate = (entry->time == (time_t) -1) ? NULL
+          /* The client does not properly handle a missing CDATE. For
+             interoperability purposes, we must fill in some junk.
+
+             See libsvn_ra_svn/client.c:ra_svn_get_dir()  */
+          cdate = (entry->time == (time_t) -1)
+            ? missing_date
             : svn_time_to_cstring(entry->time, pool);
           SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
                                          svn_node_kind_to_word(entry->kind),



Mime
View raw message