Skip to content

Commit 598c220

Browse files
committed
.
1 parent 61856ee commit 598c220

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

webserver/proxyclient.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ CProxyClient::CProxyClient(boost::asio::io_service& io_service, boost::asio::ssl
2828
doStop = true;
2929
return;
3030
}
31-
_log.Log(LOG_NORM, "PROXY: Connecting.");
3231
m_pWebEm = webEm;
3332
Reconnect();
3433
}
3534

3635
void CProxyClient::Reconnect()
3736
{
38-
_log.Log(LOG_NORM, "PROXY: Connecting...");
3937

4038
std::string address = "my.domoticz.com";
4139
std::string port = "9999";
@@ -44,25 +42,21 @@ void CProxyClient::Reconnect()
4442
boost::asio::ip::tcp::resolver::query query(address, port);
4543
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
4644
boost::asio::ip::tcp::endpoint endpoint = *iterator;
47-
_log.Log(LOG_NORM, "PROXY: we have an iterator");
4845
_socket.lowest_layer().async_connect(endpoint,
4946
boost::bind(&CProxyClient::handle_connect, this,
5047
boost::asio::placeholders::error, iterator));
5148
}
5249

5350
void CProxyClient::handle_connect(const boost::system::error_code& error, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
5451
{
55-
_log.Log(LOG_NORM, "PROXY: In handle_connect.");
5652
if (!error)
5753
{
58-
_log.Log(LOG_NORM, "PROXY: Connect complete. Starting handshake.");
5954
_socket.async_handshake(boost::asio::ssl::stream_base::client,
6055
boost::bind(&CProxyClient::handle_handshake, this,
6156
boost::asio::placeholders::error));
6257
}
6358
else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
6459
{
65-
_log.Log(LOG_NORM, "PROXY: Trying next endpoint iterator.");
6660
_socket.lowest_layer().close();
6761
boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
6862
_socket.lowest_layer().async_connect(endpoint,
@@ -83,7 +77,6 @@ void CProxyClient::MyWrite(pdu_type type, CValueLengthPart *parameters)
8377
{
8478
_writebuf.clear();
8579
writePdu = new ProxyPdu(type, parameters);
86-
_log.Log(LOG_NORM, "PROXY: Writing pdu.");
8780

8881
_writebuf.push_back(boost::asio::buffer(writePdu->content(), writePdu->length()));
8982

@@ -109,7 +102,6 @@ void CProxyClient::handle_handshake(const boost::system::error_code& error)
109102
{
110103
if (!error)
111104
{
112-
_log.Log(LOG_NORM, "PROXY: Handshake complete. Authenticating.");
113105
// lock until we have a valid api id
114106
prefs_mutex.lock();
115107
LoginToService();
@@ -135,7 +127,7 @@ void CProxyClient::handle_write(const boost::system::error_code& error, size_t b
135127
delete writePdu;
136128
if (!error)
137129
{
138-
_log.Log(LOG_NORM, "PROXY: Write complete. Reading pdu.");
130+
// Write complete. Reading pdu.
139131
ReadMore();
140132
}
141133
else
@@ -168,11 +160,9 @@ void CProxyClient::GetRequest(const std::string originatingip, boost::asio::muta
168160
m_pWebEm->myRequestHandler.handle_request(originatingip, request_, reply_);
169161
//std::vector<boost::asio::const_buffer> replybuf = reply_.to_buffers();
170162
//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");
172163
}
173164
else if (!result)
174165
{
175-
_log.Log(LOG_ERROR, "PROXY: Parse result: false.");
176166
reply_ = http::server::reply::stock_reply(http::server::reply::bad_request);
177167
//std::vector<boost::asio::const_buffer> replybuf = reply_.to_buffers();
178168
//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)
255245
parameters.AddValue((void *)&reply_.status, SIZE_INT);
256246
parameters.AddPart((void *)responseheaders.c_str(), responseheaders.length() + 1);
257247
parameters.AddPart((void *)reply_.content.c_str(), reply_.content.length());
258-
_log.Log(LOG_NORM, "About to send PDU.\n");
259248
break;
260249
}
261250

@@ -280,8 +269,6 @@ void CProxyClient::HandleAssignkey(ProxyPdu *pdu)
280269

281270
void CProxyClient::HandleEnquire(ProxyPdu *pdu)
282271
{
283-
_log.Log(LOG_NORM, "PROXY: Receiving enquire.");
284-
285272
// assemble response
286273
CValueLengthPart parameters;
287274

@@ -313,16 +300,13 @@ void CProxyClient::handle_read(const boost::system::error_code& error, size_t by
313300
{
314301
if (!error)
315302
{
316-
_log.Log(LOG_ERROR, "PROXY: Reply: %ld bytes transferred.", bytes_transferred);
317-
318303
_readbuf.commit(bytes_transferred);
319304
const char *data = boost::asio::buffer_cast<const char*>(_readbuf.data());
320305
ProxyPdu pdu(data, _readbuf.size());
321306
if (pdu.Disconnected()) {
322307
ReadMore();
323308
return;
324309
}
325-
_log.Log(LOG_NORM, "Consuming %d bytes.", pdu.length() + 9);
326310
_readbuf.consume(pdu.length() + 9); // 9 is header size
327311

328312
switch (pdu._type) {
@@ -417,7 +401,6 @@ void CProxyManager::Stop()
417401
{
418402
proxyclient->Stop();
419403
io_service.stop();
420-
_log.Log(LOG_ERROR, "PROXY: waiting for thread.join");
421404
m_thread->interrupt();
422405
m_thread->join();
423406
}

0 commit comments

Comments
 (0)