Re: rs_mdfour functions and librsync >= 0.9.6

Shirish Hemant Phatak <[email protected]> Wed, 07 Apr 2004 20:33:28 -0400
Newsgroups gmane.network.librsync.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------030401010707060708050503
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi Donovan,

Donovan Baarda wrote:

>On Thu, 2004-04-08 at 06:26, Shirish Hemant Phatak wrote:
>  
>
>>Hi,
>>
>>    Here is a bug I reported on the Bug tracker on sourceforge a few
>>days ago. I am including it here for reference. An change in
>>librsync.h has made it impossible to use the buffer oriented
>>rs_mdfour_{begin,update,result} functions. The problem is that
>>rs_mdfour_t has become an opaque data type, but these functions still
>>expect a pre-allocated struct from the caller. This will not affect
>>the whole file rs_mdfour_file function.
>>    
>>
>
>I did see your original bug report and have been brewing on it for a few
>days :-)
>  
>
Aha...I was wondering if it got lost!

>I was kind of surprised to see someone was using librsync's md4sum
>interface. If all you need is md4sum, then libmd is a much more widely
>used library for that purpose.
>  
>
True, but I am using the md4 component to augment the librsync block 
checksums with whole file checksums (something I see is being widely 
discussed elsewhere). I guess I was just too lazy to move over to libmd 
for this one thing which was so initimately tied into the operation of 
librsync.

>>    I think rs_mdfour_t can remain anonymous as long as we now have
>>rs_mdfour_alloc and res_mdfour_free (analogous to rs_job_xxx)
>>functions and require minor changes in the programs to allocate and
>>free the rs_mdfour struct.  The other alternative is of course to
>>bring back struct rs_mdfour into librsync.h, but given the dependency
>>on types.h that might be messy.
>>    
>>
>
>One of my plans is to move librsync over to using libmd, or at least the
>libmd API. I was thinking that librsync could then clean up the
>interface in librsync.h, removing everything except a minimal and clean
>interface to librsync itself. Applications could then use libmd for
>things like md4sum.
>
>For backwards compatibility we could leave old style rs_mdfour hooks in
>librsync.h that just call libmd, but if it's busted right now, I'd
>rather drop it than fix it. Now's the time for feedback if you think
>this is a bad idea :-)
>  
>
    Hmmm...I suppose if this is going to require an API change anyway 
and it is not widely used, you may as well drop it. I would defnitely 
recomend adding a whole file checksum though.

    Incidently, what would you suggest using instead of the librsync md4 
apis for Windows? Does libmd work there as well? There are probably 
better options, I guess it's time to take a look.

-Shirish


--------------030401010707060708050503
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Donovan,<br>
<br>
Donovan Baarda wrote:<br>
<blockquote type="cite" cite="mid1081383185.1015.11.camel@schizo">
  <pre wrap="">On Thu, 2004-04-08 at 06:26, Shirish Hemant Phatak wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

    Here is a bug I reported on the Bug tracker on sourceforge a few
days ago. I am including it here for reference. An change in
librsync.h has made it impossible to use the buffer oriented
rs_mdfour_{begin,update,result} functions. The problem is that
rs_mdfour_t has become an opaque data type, but these functions still
expect a pre-allocated struct from the caller. This will not affect
the whole file rs_mdfour_file function.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I did see your original bug report and have been brewing on it for a few
days :-)
  </pre>
</blockquote>
Aha...I was wondering if it got lost!<br>
<blockquote type="cite" cite="mid1081383185.1015.11.camel@schizo">
  <pre wrap="">
I was kind of surprised to see someone was using librsync's md4sum
interface. If all you need is md4sum, then libmd is a much more widely
used library for that purpose.
  </pre>
</blockquote>
True, but I am using the md4 component to augment the librsync block
checksums with whole file checksums (something I see is being widely
discussed elsewhere). I guess I was just too lazy to move over to libmd
for this one thing which was so initimately tied into the operation of
librsync.<br>
<blockquote type="cite" cite="mid1081383185.1015.11.camel@schizo">
  <blockquote type="cite">
    <pre wrap="">    I think rs_mdfour_t can remain anonymous as long as we now have
rs_mdfour_alloc and res_mdfour_free (analogous to rs_job_xxx)
functions and require minor changes in the programs to allocate and
free the rs_mdfour struct.  The other alternative is of course to
bring back struct rs_mdfour into librsync.h, but given the dependency
on types.h that might be messy.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
One of my plans is to move librsync over to using libmd, or at least the
libmd API. I was thinking that librsync could then clean up the
interface in librsync.h, removing everything except a minimal and clean
interface to librsync itself. Applications could then use libmd for
things like md4sum.

For backwards compatibility we could leave old style rs_mdfour hooks in
librsync.h that just call libmd, but if it's busted right now, I'd
rather drop it than fix it. Now's the time for feedback if you think
this is a bad idea :-)
  </pre>
</blockquote>
&nbsp;&nbsp;&nbsp; Hmmm...I suppose if this is going to require an API change anyway
and it is not widely used, you may as well drop it. I would defnitely
recomend adding a whole file checksum though.<br>
<br>
&nbsp;&nbsp;&nbsp; Incidently, what would you suggest using instead of the librsync
md4 apis for Windows? Does libmd work there as well? There are probably
better options, I guess it's time to take a look.<br>
<br>
-Shirish<br>
<br>
</body>
</html>

--------------030401010707060708050503--




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click