00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef IDENTITYSTREAMBUF_H
00020 #define IDENTITYSTREAMBUF_H
00021
00022 #include "pandabase.h"
00023
00024
00025 #ifdef HAVE_SSL
00026
00027 #include "httpChannel.h"
00028 #include "bioStreamPtr.h"
00029 #include "pointerTo.h"
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDAEXPRESS IdentityStreamBuf : public streambuf {
00037 public:
00038 IdentityStreamBuf();
00039 virtual ~IdentityStreamBuf();
00040
00041 void open_read(BioStreamPtr *source, HTTPChannel *doc,
00042 bool has_content_length, size_t content_length);
00043 void close_read();
00044
00045 protected:
00046 virtual int underflow(void);
00047
00048 private:
00049 size_t read_chars(char *start, size_t length);
00050
00051 PT(BioStreamPtr) _source;
00052 bool _has_content_length;
00053 size_t _bytes_remaining;
00054
00055 PT(HTTPChannel) _doc;
00056 int _read_index;
00057
00058 friend class IIdentityStream;
00059 };
00060
00061 #endif // HAVE_SSL
00062
00063 #endif