From 4c78c7634125433de126105da64a4e7d910f3f52 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 13 Jun 2017 18:45:40 +0100 Subject: [PATCH] Don't look at IP to see if a connection is local * This fixes an edge case where we are connecting to a local IP that is SSH port forwarded to a remote machine. We don't want to identify remote files as local files and try to open them, so just do the easy check of verifying if the file is available locally. --- renderdoc/core/target_control.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp index 49da31d9c..d3053fe4c 100644 --- a/renderdoc/core/target_control.cpp +++ b/renderdoc/core/target_control.cpp @@ -374,8 +374,7 @@ void RenderDoc::TargetControlServerThread(void *s) struct TargetControl : public ITargetControl { public: - TargetControl(Network::Socket *sock, string clientName, bool forceConnection, bool localhost) - : m_Socket(sock), m_Local(localhost) + TargetControl(Network::Socket *sock, string clientName, bool forceConnection) : m_Socket(sock) { PacketType type; vector payload; @@ -599,7 +598,7 @@ public: string path; ser->Serialise("", path); msg.NewCapture.path = path; - msg.NewCapture.local = m_Local; + msg.NewCapture.local = FileIO::exists(path.c_str()); int32_t thumblen = 0; ser->Serialise("", thumblen); @@ -659,7 +658,6 @@ public: private: Network::Socket *m_Socket; - bool m_Local; string m_Target, m_API, m_BusyClient; uint32_t m_PID; @@ -745,9 +743,7 @@ extern "C" RENDERDOC_API ITargetControl *RENDERDOC_CC RENDERDOC_CreateTargetCont if(sock == NULL) return NULL; - bool localhost = !android && (Network::GetIPOctet(sock->GetRemoteIP(), 0) == 127); - - TargetControl *remote = new TargetControl(sock, clientName, forceConnection != 0, localhost); + TargetControl *remote = new TargetControl(sock, clientName, forceConnection != 0); if(remote->Connected()) return remote;