File:  [Public] / libwww / Library / src / HTConLen.html
Revision 2.8: download - view: text, annotated - select for diffs
Thu May 14 02:10:21 1998 UTC (26 years ago) by frystyk
Branches: MAIN
CVS tags: repeat-requests, before_webdav, Release-5-4-0, Release-5-3-1, Release-5-2-8, Release-5-2-6, Release-5-2, Release-5-1m, HEAD, Before-New-Trace-Messages, Amaya_2_4, Amaya-6-3, Amaya-6-1, Amaya-5-2, Amaya-4-3-2, Amaya-4-3-1, Amaya-4-3, Amaya-4-1-2, Amaya-4-1-0, Amaya-4-0-0, Amaya-3-2-1, Amaya-3-2, Amaya
Changing old pub/WWW links

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
  <TITLE>W3C Sample Code Library libwww Content Length Counter and Other Buffer
  Streams</TITLE>
</HEAD>
<BODY>
<H1>
  Content Length Counter and Other Buffer Streams
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
This module provides various forms of buffering streams. You can also check
out the <A HREF="HTSChunk.html">chunk buffer stream</A> which converts a
stream to a memory buffer. These streams preseerve the streaming model.
<P>
The content length counter &nbsp;stream buffers the result&nbsp;to find out
the content length&nbsp;before the data is forwarded to the target stream.
You can use this stream when generating a HTTP response in order to find
the content length before writing the object to the socket, for example.
<P>
This module is implemented by <A HREF="HTConLen.c">HTConLen.c</A>, and it
is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
Library</A>.
<PRE>
#ifndef HTCONLEN_H
#define HTCONLEN_H
</PRE>
<H2>
  Buffer Stream
</H2>
<P>
This stream does almost the same as the content length counter stream except
that it doesn't count the length! In other words - it's a completely normal
memory buffer for the stream. If the buffer fills up, this stream flushes
the buffer and goes transparent so that all new data will be pumped through
without any buffering.
<PRE>
extern HTStream * HTBuffer_new		(HTStream *	target,
					 HTRequest *	request,
					int		max_size);
</PRE>
<H2>
  Content Length Counter Stream
</H2>
<P>
This stream can be inserted anywhere to count the content length of the body.
The result is passed to the <A HREF="HTAnchor.html">Anchor object</A> of
this request so that future requests for the content length will get the
right size.
<PRE>
extern HTStream * HTContentCounter	(HTStream *	target,
					 HTRequest *	request,
					 int		max_size);
</PRE>
<H2>
  Delay Buffer Stream
</H2>
<P>
This stream is much like the buffer stream above but instead of goin transparent
when the buffer fills up, it returns <CODE>HT_PAUSE</CODE> which indicates
that the stream doesn't accept more data and so the caller should not put
any more data into it. When the buffer is flushed (the flush method invoked)
then the stream goes into transparent mode, just like the buffer stream.
<PRE>
extern HTStream * HTDelayBuffer    	(HTStream *	target,
					 int		max_size);
</PRE>
<H2>
  Pipe Buffer Stream
</H2>
<P>
This stream is much like the buffer stream above but instead of goin transparent
when the buffer fills up, it returns <CODE>HT_PAUSE</CODE> which indicates
that the stream doesn't accept more data and so the caller should not put
any more data into it.
<PRE>
extern HTStream * HTPipeBuffer    	(HTStream *	target,
					 int		max_size);
</PRE>
<P>
End of definition module
<PRE>
#endif /* HTCONLEN_H */
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTConLen.html,v 2.8 1998/05/14 02:10:21 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster