# Content Length Counter Stream

    /*
    **	(c) COPYRIGHT MIT 1995.
    **	Please first read the full copyright statement in the file COPYRIGH.
    */

This stream also buffers the result to find out the content length before the data is forwarded to the target stream. This means that 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 If a maximum buffer limit is reached Content-Length is calculated for logs but it is not sent to the client -- rather the buffer is flushed right away. Code taken from HTRequest.c written by Ari Luotonen and modified to fit new stream model. The buffer stream is a small buffer that can be used to optimize net work access in order to prevent multiple writes.

This module is implemented by HTConLen.c, and it is a part of the W3C Reference Library.

    #ifndef HTCONLEN_H
    #define HTCONLEN_H

## Content Length Counter Stream

This stream can be inserted anywhere to count the content length of the body. The result is passed to the Anchor object of this request so that future requests for the content length will get the right size.

    extern HTStream * HTContentCounter	(HTStream *	target,
    					 HTRequest *	request,
    					 int		max_size);

## Buffer Stream

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.

    extern HTStream * HTBuffer_new		(HTStream *	target,
    					 HTRequest *	request,
    					int		max_size);

End of definition module

    #endif /* HTCONLEN_H */