18
18
#include " asio/detail/config.hpp"
19
19
20
20
#if !defined(ASIO_ENABLE_OLD_SSL)
21
- # include " asio/deadline_timer.hpp"
21
+ # if defined(ASIO_HAS_BOOST_DATE_TIME)
22
+ # include " asio/deadline_timer.hpp"
23
+ # else // defined(ASIO_HAS_BOOST_DATE_TIME)
24
+ # include " asio/steady_timer.hpp"
25
+ # endif // defined(ASIO_HAS_BOOST_DATE_TIME)
22
26
# include " asio/ssl/detail/engine.hpp"
23
27
# include " asio/buffer.hpp"
24
28
#endif // !defined(ASIO_ENABLE_OLD_SSL)
@@ -46,8 +50,8 @@ struct stream_core
46
50
input_buffer_space_(max_tls_record_size),
47
51
input_buffer_(asio::buffer(input_buffer_space_))
48
52
{
49
- pending_read_.expires_at (boost::posix_time:: neg_infin);
50
- pending_write_.expires_at (boost::posix_time:: neg_infin);
53
+ pending_read_.expires_at (neg_infin () );
54
+ pending_write_.expires_at (neg_infin () );
51
55
}
52
56
53
57
~stream_core ()
@@ -57,12 +61,44 @@ struct stream_core
57
61
// The SSL engine.
58
62
engine engine_;
59
63
64
+ #if defined(ASIO_HAS_BOOST_DATE_TIME)
60
65
// Timer used for storing queued read operations.
61
66
asio::deadline_timer pending_read_;
62
67
63
68
// Timer used for storing queued write operations.
64
69
asio::deadline_timer pending_write_;
65
70
71
+ // Helper function for obtaining a time value that always fires.
72
+ static asio::deadline_timer::time_type neg_infin ()
73
+ {
74
+ return boost::posix_time::neg_infin;
75
+ }
76
+
77
+ // Helper function for obtaining a time value that never fires.
78
+ static asio::deadline_timer::time_type pos_infin ()
79
+ {
80
+ return boost::posix_time::pos_infin;
81
+ }
82
+ #else // defined(ASIO_HAS_BOOST_DATE_TIME)
83
+ // Timer used for storing queued read operations.
84
+ asio::steady_timer pending_read_;
85
+
86
+ // Timer used for storing queued write operations.
87
+ asio::steady_timer pending_write_;
88
+
89
+ // Helper function for obtaining a time value that always fires.
90
+ static asio::steady_timer::time_point neg_infin ()
91
+ {
92
+ return asio::steady_timer::time_point::min ();
93
+ }
94
+
95
+ // Helper function for obtaining a time value that never fires.
96
+ static asio::steady_timer::time_point pos_infin ()
97
+ {
98
+ return asio::steady_timer::time_point::max ();
99
+ }
100
+ #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
101
+
66
102
// Buffer space used to prepare output intended for the transport.
67
103
std::vector<unsigned char > output_buffer_space_;
68
104
0 commit comments