HTTPIOStream.cpp 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include "Poco/Net/HTTPIOStream.h"
  14. #include "Poco/Net/HTTPClientSession.h"
  15. using Poco::UnbufferedStreamBuf;
  16. namespace Poco {
  17. namespace Net {
  18. HTTPResponseStreamBuf::HTTPResponseStreamBuf(std::istream& istr):
  19. _istr(istr)
  20. {
  21. // make sure exceptions from underlying string propagate
  22. _istr.exceptions(std::ios::badbit);
  23. }
  24. HTTPResponseStreamBuf::~HTTPResponseStreamBuf()
  25. {
  26. }
  27. HTTPResponseIOS::HTTPResponseIOS(std::istream& istr):
  28. _buf(istr)
  29. {
  30. poco_ios_init(&_buf);
  31. }
  32. HTTPResponseIOS::~HTTPResponseIOS()
  33. {
  34. }
  35. HTTPResponseStream::HTTPResponseStream(std::istream& istr, HTTPClientSession* pSession):
  36. HTTPResponseIOS(istr),
  37. std::istream(&_buf),
  38. _pSession(pSession)
  39. {
  40. }
  41. HTTPResponseStream::~HTTPResponseStream()
  42. {
  43. delete _pSession;
  44. }
  45. } } // namespace Poco::Net