Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_SessionBase.inl
blob4735e22290ede074b323c8b4472767e765a80364
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 namespace ACE
6   namespace HTTP
7   {
8     ACE_INLINE
9     void SessionBase::set_keep_alive (bool f)
10       {
11         this->keep_alive_ = f;
12       }
14     ACE_INLINE
15     bool SessionBase::keep_alive () const
16       {
17         return this->keep_alive_;
18       }
20     ACE_INLINE
21     void SessionBase::set_host (const ACE_CString& host, u_short port)
22       {
23         if (!this->is_connected ())
24           {
25             this->host_ = host;
26             this->port_ = port;
27             this->proxy_connection_ = false;
28           }
29       }
31     ACE_INLINE
32     void SessionBase::set_host (const ACE_CString& host)
33       {
34         if (!this->is_connected ())
35           {
36             this->host_ = host;
37             this->proxy_connection_ = false;
38           }
39       }
41     ACE_INLINE
42     void SessionBase::set_port (u_short port)
43       {
44         if (!this->is_connected ())
45           {
46             this->port_ = port;
47           }
48       }
50     ACE_INLINE
51     void SessionBase::set_proxy_target (const ACE_CString& host, u_short port)
52       {
53         if (!this->is_connected ())
54           {
55             this->proxy_target_host_ = host;
56             this->proxy_target_port_ = port;
57             this->proxy_connection_ = true;
58           }
59       }
61     ACE_INLINE
62     const ACE_CString& SessionBase::get_host () const
63       {
64         return this->host_;
65       }
67     ACE_INLINE
68     u_short SessionBase::get_port () const
69       {
70         return this->port_;
71       }
73     ACE_INLINE
74     bool SessionBase::is_proxy_connection () const
75       {
76         return this->proxy_connection_;
77       }
79     ACE_INLINE
80     const ACE_CString& SessionBase::get_proxy_target_host () const
81       {
82         return this->proxy_target_host_;
83       }
85     ACE_INLINE
86     u_short SessionBase::get_proxy_target_port () const
87       {
88         return this->proxy_target_port_;
89       }
91     ACE_INLINE
92     bool SessionBase::reconnect_needed ()
93       {
94         if (this->cannot_reconnect_)
95           return false;
96         if (!this->needs_reconnect_)
97           {
98             this->reconnect_countdown_.update ();
99             return this->reconnect_timer_ == ACE_Time_Value::zero;
100           }
101         return true;
102       }
104     ACE_INLINE
105     void SessionBase::close_streams ()
106       {
107         if (this->in_stream_)
108           {
109             delete this->in_stream_;
110             this->in_stream_ = 0;
111           }
112         if (this->out_stream_)
113           {
114             delete this->out_stream_;
115             this->out_stream_ = 0;
116           }
117       }
118   }
121 ACE_END_VERSIONED_NAMESPACE_DECL