Author: stefan2
Date: Sun Dec  2 15:57:31 2012
New Revision: 1416194

URL: http://svn.apache.org/viewvc?rev=1416194&view=rev
Log:
Fix a tx delta stream corruption introduced in r1390435:  Even if we don't
use any data from the source window, it may still have content.  We must
specify that in our delta window header to make the receiver advance the
source window pointer correctly.

* subversion/libsvn_delta/svndiff.c
  (send_simple_insertion_window): always encode the source window pos & size

Patch by: lgo

Modified:
    subversion/trunk/subversion/libsvn_delta/svndiff.c

Modified: subversion/trunk/subversion/libsvn_delta/svndiff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/svndiff.c?rev=1416194&r1=1416193&r2=1416194&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/trunk/subversion/libsvn_delta/svndiff.c Sun Dec  2 15:57:31 2012
@@ -229,10 +229,11 @@ send_simple_insertion_window(svn_txdelta
       ip_len = encode_int(ibuf + 1, window->tview_len) - ibuf;
     }
 
-  /* encode the window header.  */
-  header_current[0] = 0;  /* source offset == 0 */
-  header_current[1] = 0;  /* source length == 0 */
-  header_current = encode_int(header_current + 2, window->tview_len);
+  /* encode the window header.  Please note that the source window may
+   * have content despite not being used for deltification. */
+  header_current = encode_int(header_current, window->sview_offset);
+  header_current = encode_int(header_current, window->sview_len);
+  header_current = encode_int(header_current, window->tview_len);
   header_current[0] = (unsigned char)ip_len;  /* 1 instruction */
   header_current = encode_int(&header_current[1], len);
 


Reply via email to