Descriptionarchive/tar: fix writing of pax headers
"archive/tar: reuse temporary buffer in writeHeader" introduced a
change which was supposed to help lower the number of allocations from
512 bytes for every call to writeHeader. This change broke the writing
of PAX headers.
writeHeader calls writePAXHeader and writePAXHeader calls writeHeader
again. writeHeader will end up writing the PAX header twice.
example broken header:
PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000
PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000
example correct header:
PaxHeaders.4290/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021516 xustar0000000000000000
0100644000000000000000000000270412301216634007250 0ustar0000000000000000
This commit adds a dedicated buffer for pax headers to the Writer
struct. This change increases the size of the struct by 512 bytes, but
allows tar/writer to avoid allocating 512 bytes for all written
headers and it avoids allocating 512 more bytes for pax headers.
Patch Set 1 #Patch Set 2 : diff -r fca86a5afe65 https://code.google.com/p/go/ #Patch Set 3 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #Patch Set 4 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #
Total comments: 4
Patch Set 5 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #
Total comments: 6
Patch Set 6 : diff -r 395bf97d72a1 https://code.google.com/p/go/ #MessagesTotal messages: 15
|