Panda3D
Loading...
Searching...
No Matches
identityStream.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file identityStream.cxx
10 * @author drose
11 * @date 2002-10-09
12 */
13
14#include "identityStream.h"
15
16// This module is not compiled if OpenSSL is not available.
17#ifdef HAVE_OPENSSL
18#include "httpChannel.h"
19
20/**
21 *
22 */
23IIdentityStream::
24~IIdentityStream() {
25 if (_channel != nullptr) {
26 _channel->body_stream_destructs(this);
27 _channel = nullptr;
28 }
29}
30
31/**
32 * Returns true if the last eof condition was triggered because the socket has
33 * genuinely closed, or false if we can expect more data to come along
34 * shortly.
35 */
36bool IIdentityStream::
37is_closed() {
38 if ((_buf._has_content_length && _buf._bytes_remaining == 0) ||
39 _buf.is_closed()) {
40 return true;
41 }
42 clear();
43 return false;
44}
45
46/**
47 * Resets the IdentityStream to empty, but does not actually close the source
48 * BIO unless owns_source was true.
49 */
50void IIdentityStream::
51close() {
52 _buf.close_read();
53}
54
55/**
56 * Returns an enum indicating how we are coming along in reading the document.
57 */
58INLINE IIdentityStream::ReadState IIdentityStream::
59get_read_state() {
60 return _buf.get_read_state();
61}
62
63#endif // HAVE_OPENSSL
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.