00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BIOSTREAMBUF_H
00016 #define BIOSTREAMBUF_H
00017
00018 #include "pandabase.h"
00019
00020
00021 #ifdef HAVE_OPENSSL
00022 #define OPENSSL_NO_KRB5
00023
00024 #include "bioPtr.h"
00025 #include "pointerTo.h"
00026 #include "openSSLWrapper.h"
00027 #include "openssl/ssl.h"
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDAEXPRESS BioStreamBuf : public streambuf {
00035 public:
00036 BioStreamBuf();
00037 virtual ~BioStreamBuf();
00038
00039 void open(BioPtr *source);
00040 void close();
00041
00042 protected:
00043 virtual int overflow(int c);
00044 virtual int sync();
00045 virtual int underflow();
00046
00047 private:
00048 size_t write_chars(const char *start, size_t length);
00049
00050 PT(BioPtr) _source;
00051 bool _read_open;
00052 bool _write_open;
00053 char *_buffer;
00054
00055 friend class IBioStream;
00056 friend class OBioStream;
00057 friend class BioStream;
00058 };
00059
00060 #endif // HAVE_OPENSSL
00061
00062 #endif