mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 00:58:14 +08:00
Some work toward Issue 27 and Issue 319
This commit is contained in:
@@ -390,10 +390,10 @@ CClient::sendEvent(CEvent::Type type, void* data)
|
||||
void
|
||||
CClient::sendConnectionFailedEvent(const char* msg)
|
||||
{
|
||||
CFailInfo* info = (CFailInfo*)malloc(sizeof(CFailInfo) + strlen(msg));
|
||||
info->m_retry = true;
|
||||
strcpy(info->m_what, msg);
|
||||
sendEvent(getConnectionFailedEvent(), info);
|
||||
CFailInfo* info = new CFailInfo(msg);
|
||||
info->m_retry = true;
|
||||
CEvent event(getConnectionFailedEvent(), getEventTarget(), info, CEvent::kDontFreeData);
|
||||
EVENTQUEUE->addEvent(event);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -549,7 +549,8 @@ CClient::handleConnectionFailed(const CEvent& event, void*)
|
||||
delete m_stream;
|
||||
m_stream = NULL;
|
||||
LOG((CLOG_DEBUG1 "connection failed"));
|
||||
sendConnectionFailedEvent(info->m_what);
|
||||
sendConnectionFailedEvent(info->m_what.c_str());
|
||||
delete info;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "IClient.h"
|
||||
#include "IClipboard.h"
|
||||
#include "CNetworkAddress.h"
|
||||
#include "INode.h"
|
||||
|
||||
class CEventQueueTimer;
|
||||
class CScreen;
|
||||
@@ -31,12 +32,13 @@ class IStreamFilterFactory;
|
||||
/*!
|
||||
This class implements the top-level client algorithms for synergy.
|
||||
*/
|
||||
class CClient : public IClient {
|
||||
class CClient : public IClient, public INode {
|
||||
public:
|
||||
class CFailInfo {
|
||||
public:
|
||||
CFailInfo(const char* what) : m_retry(false), m_what(what) { }
|
||||
bool m_retry;
|
||||
char m_what[1];
|
||||
CString m_what;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user