Skip to content

Commit

Permalink
Merge pull request #332 from Telecominfraproject/master
Browse files Browse the repository at this point in the history
  • Loading branch information
stephb9959 authored Sep 25, 2023
2 parents 4c91742 + 2007998 commit e623774
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26
27
22 changes: 13 additions & 9 deletions src/rttys/RTTYS_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
#include "Poco/Net/SocketAcceptor.h"
#include <algorithm>

/*
2023-09-25 14:57:48.963 RADSEC: [email protected]:2084: [Error][thr:7] SSL connection unexpectedly closed
2023-09-25 14:57:48.964 RADSEC: [email protected]:2084: [Information][thr:7] Disconnecting.
2023-09-25 14:57:50.965 RADSEC: [email protected]:2084: [Information][thr:40] Attempting to connect
2023-09-25 14:57:51.675 RTTY-SVR: [Error][thr:6] Frame readable shutdown.
2023-09-25 14:57:51.675 RTTY-SVR: [Debug][thr:6] Closing connection onClientSocketReadable:646
2023-09-25 14:57:51.717 RADSEC: [email protected]:2084: [Information][thr:40] Connected. CN=radsec.openro.am
2023-09-25 14:57:51.717 RADSEC: [email protected]:2084: [Error][thr:7] SSL connection unexpectedly closed
2023-09-25 14:57:51.717 RADSEC: [email protected]:2084: [Information][thr:7] Disconnecting.
*/

namespace OpenWifi {

Expand Down Expand Up @@ -437,11 +449,9 @@ namespace OpenWifi {
std::size_t agg_buf_pos=0;

try {
// std::cout << "Available: " << buffer.available() << " ";
Poco::Timespan TS(5,0);
received_bytes = hint->second->socket.receiveBytes(buffer);
if(received_bytes==0) {
// std::cout << hint->second->socket.lastError() << std::endl;
poco_warning(Logger(), "Device Closing connection - 0 bytes received.");
EndConnection( pNf->socket(), __func__, __LINE__ );
return;
Expand Down Expand Up @@ -482,9 +492,6 @@ namespace OpenWifi {
return;
}

// std::cout << line++ << " Available: " << buffer.available() << " Cmd: " << (int) LastCommand << " Received: " << received_bytes
// << " MsgLen: " << msg_len << " Data in buffer: " << buffer.used() << std::endl;

buffer.drain(RTTY_HDR_SIZE);

switch (LastCommand) {
Expand Down Expand Up @@ -534,8 +541,6 @@ namespace OpenWifi {
EmptyBuffer(fd, agg_buffer, agg_buf_pos);
}

// std::cout << "Empty: " << buffer.isEmpty() << std::endl;

if (!good) {
EndConnection(pNf->socket(), __func__, __LINE__);
}
Expand Down Expand Up @@ -580,7 +585,7 @@ namespace OpenWifi {
}

int flags;
unsigned char FrameBuffer[1024];
unsigned char FrameBuffer[64000];

auto ReceivedBytes = Connection->WSSocket_->receiveFrame(FrameBuffer, sizeof(FrameBuffer), flags);
auto Op = flags & Poco::Net::WebSocket::FRAME_OP_BITMASK;
Expand Down Expand Up @@ -1037,7 +1042,6 @@ namespace OpenWifi {
// buffer.drain(msg_len);
return true;
} catch (const Poco::Exception &E) {
std::cout << "Failed to send WS stuff" << std::endl;
Logger().log(E);
} catch (const std::exception &E) {
LogStdException(E, "Cannot send data to UI Client");
Expand Down

0 comments on commit e623774

Please sign in to comment.