Panda3D
panda
src
downloader
chunkedStream.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 chunkedStream.cxx
10
* @author drose
11
* @date 2002-09-25
12
*/
13
14
#include "
chunkedStream.h
"
15
16
// This module is not compiled if OpenSSL is not available.
17
#ifdef HAVE_OPENSSL
18
19
/**
20
*
21
*/
22
IChunkedStream::
23
~IChunkedStream() {
24
if
(_channel !=
nullptr
) {
25
_channel->body_stream_destructs(
this
);
26
_channel =
nullptr
;
27
}
28
}
29
30
/**
31
* Returns true if the last eof condition was triggered because the socket has
32
* genuinely closed, or false if we can expect more data to come along
33
* shortly.
34
*/
35
bool
IChunkedStream::
36
is_closed() {
37
if
(_buf._done || _buf.is_closed()) {
38
return
true
;
39
}
40
clear();
41
return
false
;
42
}
43
44
/**
45
* Resets the ChunkedStream to empty, but does not actually close the source
46
* BIO unless owns_source was true.
47
*/
48
void
IChunkedStream::
49
close() {
50
_buf.close_read();
51
}
52
53
/**
54
* Returns an enum indicating how we are coming along in reading the document.
55
*/
56
IChunkedStream::ReadState IChunkedStream::
57
get_read_state() {
58
return
_buf.get_read_state();
59
}
60
61
#endif // HAVE_OPENSSL
chunkedStream.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Sun Dec 27 2020 13:22:52 for Panda3D by
1.8.20