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

Re: [PATCH] Compressed streams

From: Eric Dorland <eric.dorland_at_mail.mcgill.ca>
Date: 2003-03-28 00:49:17 CET

* Philip Martin (philip@codematters.co.uk) wrote:
> Eric Dorland <eric.dorland@mail.mcgill.ca> writes:
>
> > > > +svn_stream_t *
> > > > +svn_stream_compressed (svn_stream_t *stream, apr_pool_t *pool)
> > > > +{
> > > > +#ifdef ZLIB
> > > > +
> > > > + struct svn_stream_t *zstream, *old_stream = (struct svn_stream_t *) stream;
> > >
> > > Is this cast necessary? Why use old_stream at all?
> >
> > No the cast isn't, but we need to use old stream. stream is of type
> > svn_stream_t * which is opaque, so we need to make it a struct
> > svn_stream_t *.
>
> Huh? "svn_stream_t*" and "struct svn_stream_t*" are the same type are
> they not?

Whoops! I'll fix that...

> > > > + static const char * const strings[NUM_TEST_STRINGS] = {
> > > > + /* 0 */
> > > > + "",
> > > > + /* 1 */
> > > > + "This is a string.",
> > > > + /* 2 */
> > > > + "This is, by comparison to the previous string, a much longer string.",
> > > > + /* 3 */
> > > > + "And if you thought that last string was long, you just wait until "
> > > > + "I'm finished here. I mean, how can a string really claim to be long "
> > > > + "when it fits on a single line of 80-columns? Give me a break. "
> > > > + "Now, I'm not saying that I'm the longest string out there--far from "
> > > > + "it--but I feel that it is safe to assume that I'm far longer than my "
> > > > + "peers. And that demands some amount of respect, wouldn't you say?"
> > >
> > > How does the size of these strings relate to the 4096 above? Do you
> > > need a test that has an input (or an output perhaps?) greater than
> > > 4096?
> >
> > Good point. But the compressed representation of the string would need
> > to be more than 4096, not just the size of the string, since the it is
> > the read function that uses this buffer size. Any ideas how i could
> > generate that data?
>
> apr_generate_random_bytes? apr_pstrcat? apr_psprintf?

Good idea. I'll add something like this to the test. New patch later
this evening.

-- 
Eric Dorland <eric.dorland@mail.mcgill.ca>
ICQ: #61138586, Jabber: hooty@jabber.com
1024D/16D970C6 097C 4861 9934 27A0 8E1C  2B0A 61E9 8ECF 16D9 70C6
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d- s++: a-- C+++ UL+++ P++ L++ E++ W++ N+ o K- w+ 
O? M++ V-- PS+ PE Y+ PGP++ t++ 5++ X+ R tv++ b+++ DI+ D+ 
G e h! r- y+ 
------END GEEK CODE BLOCK------

  • application/pgp-signature attachment: stored
Received on Fri Mar 28 00:50:01 2003

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.