| 1 | // | 
|---|---|
| 2 | // HTTPIOStream.cpp | 
| 3 | // | 
| 4 | // Library: Net | 
| 5 | // Package: HTTP | 
| 6 | // Module: HTTPIOStream | 
| 7 | // | 
| 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. | 
| 9 | // and Contributors. | 
| 10 | // | 
| 11 | // SPDX-License-Identifier: BSL-1.0 | 
| 12 | // | 
| 13 | |
| 14 | |
| 15 | #include "Poco/Net/HTTPIOStream.h" | 
| 16 | #include "Poco/Net/HTTPClientSession.h" | 
| 17 | |
| 18 | |
| 19 | using Poco::UnbufferedStreamBuf; | 
| 20 | |
| 21 | |
| 22 | namespace Poco { | 
| 23 | namespace Net { | 
| 24 | |
| 25 | |
| 26 | HTTPResponseStreamBuf::HTTPResponseStreamBuf(std::istream& istr): | 
| 27 | _istr(istr) | 
| 28 | { | 
| 29 | // make sure exceptions from underlying string propagate | 
| 30 | _istr.exceptions(std::ios::badbit); | 
| 31 | } | 
| 32 | |
| 33 | |
| 34 | HTTPResponseStreamBuf::~HTTPResponseStreamBuf() | 
| 35 | { | 
| 36 | } | 
| 37 | |
| 38 | |
| 39 | HTTPResponseIOS::HTTPResponseIOS(std::istream& istr): | 
| 40 | _buf(istr) | 
| 41 | { | 
| 42 | poco_ios_init(&_buf); | 
| 43 | } | 
| 44 | |
| 45 | |
| 46 | HTTPResponseIOS::~HTTPResponseIOS() | 
| 47 | { | 
| 48 | } | 
| 49 | |
| 50 | |
| 51 | HTTPResponseStream::HTTPResponseStream(std::istream& istr, HTTPClientSession* pSession): | 
| 52 | HTTPResponseIOS(istr), | 
| 53 | std::istream(&_buf), | 
| 54 | _pSession(pSession) | 
| 55 | { | 
| 56 | } | 
| 57 | |
| 58 | |
| 59 | HTTPResponseStream::~HTTPResponseStream() | 
| 60 | { | 
| 61 | delete _pSession; | 
| 62 | } | 
| 63 | |
| 64 | |
| 65 | } } // namespace Poco::Net | 
| 66 | 
