Panda3D

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 */
23 IIdentityStream::
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 */
36 bool IIdentityStream::
37 is_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 */
50 void IIdentityStream::
51 close() {
52 _buf.close_read();
53 }
54
55 /**
56 * Returns an enum indicating how we are coming along in reading the document.
57 */
58 INLINE IIdentityStream::ReadState IIdentityStream::
59 get_read_state() {
60 return _buf.get_read_state();
61 }
62
63 #endif // HAVE_OPENSSL
httpChannel.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
identityStream.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.