From 4878103d8527c133ddcf3bf40dcd8857287811ed Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 7 Apr 2020 16:45:14 +0100 Subject: [PATCH] Windows fixes --- dvbsubtitles.cc | 2 +- log.cc | 4 ++-- tcp.cc | 4 ++++ vconnect.cc | 3 ++- winmain.cc | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dvbsubtitles.cc b/dvbsubtitles.cc index e7dd28a..b9fac68 100644 --- a/dvbsubtitles.cc +++ b/dvbsubtitles.cc @@ -26,7 +26,7 @@ /* Reference ETSI EN 300 743 V1.3.1 (2006-11) */ -#define DVBSDEBUG 0 +//#define DVBSDEBUG #ifdef DVBSDEBUG diff --git a/log.cc b/log.cc index 350db52..31db770 100644 --- a/log.cc +++ b/log.cc @@ -89,9 +89,9 @@ int Log::init(int startLogLevel, const char* fileName, int tenabled) initted = 1; logLevel = startLogLevel; enabled = tenabled; - //logfile = fopen(fileName, "a"); + logfile = fopen(fileName, "a"); // logfile = fopen(stdout, "a"); - logfile = stdout; + //logfile = stdout; // logfile = fopen("/log", "a"); if (logfile) return 1; diff --git a/tcp.cc b/tcp.cc index 5758770..0f2f248 100644 --- a/tcp.cc +++ b/tcp.cc @@ -123,7 +123,11 @@ bool TCP::connect(const std::string& ip, USHORT port) return true; } +#ifdef WIN32 + if ((connectResult != SOCKET_ERROR) || (WSAGetLastError() != WSAEWOULDBLOCK)) +#else if (errno != EINPROGRESS) +#endif { CLOSESOCKET(sockfd); sockfd = -1; diff --git a/vconnect.cc b/vconnect.cc index 1d31768..3786bca 100644 --- a/vconnect.cc +++ b/vconnect.cc @@ -94,6 +94,8 @@ void VConnect::stop() void VConnect::threadMethod() { + logger->log("VConnect", Log::DEBUG, "start threadMethod"); + ULONG delay = 0; int success; @@ -112,7 +114,6 @@ void VConnect::threadMethod() if (!commandLineServer.empty()) // Server is specified, fake a servers array { //servers.emplace_back(commandLineServer, "", 3024, 0); - vdpc.TEMPaddCLIServer(commandLineServer); // FIXME move to new config system NCONFIG } else diff --git a/winmain.cc b/winmain.cc index 7a24e23..2ace407 100644 --- a/winmain.cc +++ b/winmain.cc @@ -69,7 +69,7 @@ Video* video; Audio* audio; Wol* wol; Sleeptimer* sleeptimer; - +std::string commandLineServer; bool wnd_fullscreen=false; bool wnd_topmost=false; @@ -941,7 +941,7 @@ std::string tp2str(const std::chrono::time_point& tp) const std::string& getCommandLineServer() { - return std::string(); + return commandLineServer; } -- 2.39.2