89 |
|
SSL* ssl; |
90 |
|
bool tls; |
91 |
|
#endif |
92 |
< |
char* buffer; |
92 |
> |
char buffer[BUFSIZ + 1]; |
93 |
|
bool binary; |
94 |
|
stringstream page; |
95 |
|
string type; |
104 |
|
void error(const string& prefix, int number); |
105 |
|
bool starttls(); |
106 |
|
#endif |
107 |
– |
// friends: |
108 |
– |
friend istream& operator>>(istream& is, code& data) { int number; is |
109 |
– |
>> number; data = code(number); return is; } |
107 |
|
public: |
108 |
|
HttpHandler(); |
109 |
|
~HttpHandler(); |
112 |
|
istream& getline(string& line) { return std::getline(page, line); } |
113 |
|
istream& getline(string& line, char end) { return std::getline(page, line, |
114 |
|
end); } |
115 |
< |
bool good() { return page.good(); } |
115 |
> |
bool good() const { return page.good(); } |
116 |
|
void clear(); |
117 |
< |
string contentType() { return type; } |
118 |
< |
unsigned contentLength() { return length; } |
119 |
< |
string redirect() { return location; } |
117 |
> |
const string& contentType() const { return type; } |
118 |
> |
unsigned contentLength() const { return length; } |
119 |
> |
const string& redirect() const { return location; } |
120 |
> |
// friends: |
121 |
> |
friend istream& operator>>(istream& is, code& data) { int number; is |
122 |
> |
>> number; data = code(number); return is; } |
123 |
|
}; |
124 |
|
|
125 |
|
#endif // _HttpHandler_hpp_ |