@@ -28,14 +28,12 @@ CProxyClient::CProxyClient(boost::asio::io_service& io_service, boost::asio::ssl
28
28
doStop = true ;
29
29
return ;
30
30
}
31
- _log.Log (LOG_NORM, " PROXY: Connecting." );
32
31
m_pWebEm = webEm;
33
32
Reconnect ();
34
33
}
35
34
36
35
void CProxyClient::Reconnect ()
37
36
{
38
- _log.Log (LOG_NORM, " PROXY: Connecting..." );
39
37
40
38
std::string address = " my.domoticz.com" ;
41
39
std::string port = " 9999" ;
@@ -44,25 +42,21 @@ void CProxyClient::Reconnect()
44
42
boost::asio::ip::tcp::resolver::query query (address, port);
45
43
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve (query);
46
44
boost::asio::ip::tcp::endpoint endpoint = *iterator;
47
- _log.Log (LOG_NORM, " PROXY: we have an iterator" );
48
45
_socket.lowest_layer ().async_connect (endpoint,
49
46
boost::bind (&CProxyClient::handle_connect, this ,
50
47
boost::asio::placeholders::error, iterator));
51
48
}
52
49
53
50
void CProxyClient::handle_connect (const boost::system::error_code& error, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
54
51
{
55
- _log.Log (LOG_NORM, " PROXY: In handle_connect." );
56
52
if (!error)
57
53
{
58
- _log.Log (LOG_NORM, " PROXY: Connect complete. Starting handshake." );
59
54
_socket.async_handshake (boost::asio::ssl::stream_base::client,
60
55
boost::bind (&CProxyClient::handle_handshake, this ,
61
56
boost::asio::placeholders::error));
62
57
}
63
58
else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator ())
64
59
{
65
- _log.Log (LOG_NORM, " PROXY: Trying next endpoint iterator." );
66
60
_socket.lowest_layer ().close ();
67
61
boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
68
62
_socket.lowest_layer ().async_connect (endpoint,
@@ -83,7 +77,6 @@ void CProxyClient::MyWrite(pdu_type type, CValueLengthPart *parameters)
83
77
{
84
78
_writebuf.clear ();
85
79
writePdu = new ProxyPdu (type, parameters);
86
- _log.Log (LOG_NORM, " PROXY: Writing pdu." );
87
80
88
81
_writebuf.push_back (boost::asio::buffer (writePdu->content (), writePdu->length ()));
89
82
@@ -109,7 +102,6 @@ void CProxyClient::handle_handshake(const boost::system::error_code& error)
109
102
{
110
103
if (!error)
111
104
{
112
- _log.Log (LOG_NORM, " PROXY: Handshake complete. Authenticating." );
113
105
// lock until we have a valid api id
114
106
prefs_mutex.lock ();
115
107
LoginToService ();
@@ -135,7 +127,7 @@ void CProxyClient::handle_write(const boost::system::error_code& error, size_t b
135
127
delete writePdu;
136
128
if (!error)
137
129
{
138
- _log. Log (LOG_NORM, " PROXY: Write complete. Reading pdu." );
130
+ // Write complete. Reading pdu.
139
131
ReadMore ();
140
132
}
141
133
else
@@ -168,11 +160,9 @@ void CProxyClient::GetRequest(const std::string originatingip, boost::asio::muta
168
160
m_pWebEm->myRequestHandler .handle_request (originatingip, request_, reply_);
169
161
// std::vector<boost::asio::const_buffer> replybuf = reply_.to_buffers();
170
162
// response = std::string(boost::asio::buffers_begin(replybuf), boost::asio::buffers_begin(replybuf) + boost::asio::buffer_size(replybuf));
171
- _log.Log (LOG_ERROR, " PROXY: We have a response" );
172
163
}
173
164
else if (!result)
174
165
{
175
- _log.Log (LOG_ERROR, " PROXY: Parse result: false." );
176
166
reply_ = http::server::reply::stock_reply (http::server::reply::bad_request);
177
167
// std::vector<boost::asio::const_buffer> replybuf = reply_.to_buffers();
178
168
// response = std::string(boost::asio::buffers_begin(replybuf), boost::asio::buffers_begin(replybuf) + boost::asio::buffer_size(replybuf));
@@ -255,7 +245,6 @@ void CProxyClient::HandleRequest(ProxyPdu *pdu)
255
245
parameters.AddValue ((void *)&reply_.status , SIZE_INT);
256
246
parameters.AddPart ((void *)responseheaders.c_str (), responseheaders.length () + 1 );
257
247
parameters.AddPart ((void *)reply_.content .c_str (), reply_.content .length ());
258
- _log.Log (LOG_NORM, " About to send PDU.\n " );
259
248
break ;
260
249
}
261
250
@@ -280,8 +269,6 @@ void CProxyClient::HandleAssignkey(ProxyPdu *pdu)
280
269
281
270
void CProxyClient::HandleEnquire (ProxyPdu *pdu)
282
271
{
283
- _log.Log (LOG_NORM, " PROXY: Receiving enquire." );
284
-
285
272
// assemble response
286
273
CValueLengthPart parameters;
287
274
@@ -313,16 +300,13 @@ void CProxyClient::handle_read(const boost::system::error_code& error, size_t by
313
300
{
314
301
if (!error)
315
302
{
316
- _log.Log (LOG_ERROR, " PROXY: Reply: %ld bytes transferred." , bytes_transferred);
317
-
318
303
_readbuf.commit (bytes_transferred);
319
304
const char *data = boost::asio::buffer_cast<const char *>(_readbuf.data ());
320
305
ProxyPdu pdu (data, _readbuf.size ());
321
306
if (pdu.Disconnected ()) {
322
307
ReadMore ();
323
308
return ;
324
309
}
325
- _log.Log (LOG_NORM, " Consuming %d bytes." , pdu.length () + 9 );
326
310
_readbuf.consume (pdu.length () + 9 ); // 9 is header size
327
311
328
312
switch (pdu._type ) {
@@ -417,7 +401,6 @@ void CProxyManager::Stop()
417
401
{
418
402
proxyclient->Stop ();
419
403
io_service.stop ();
420
- _log.Log (LOG_ERROR, " PROXY: waiting for thread.join" );
421
404
m_thread->interrupt ();
422
405
m_thread->join ();
423
406
}
0 commit comments