Ticket #8628: remotefile.cpp.patch
File remotefile.cpp.patch, 1.7 KB (added by , 14 years ago) |
---|
-
libs/libmythdb/remotefile.cpp
1 2 #include <assert.h> 1 3 #include <iostream> 2 4 using namespace std; 3 5 … … 52 54 53 55 QString host = qurl.host(); 54 56 int port = qurl.port(); 55 56 57 dir = qurl.path(); 57 58 58 59 if (qurl.hasQuery()) … … 62 63 dir += "#" + qurl.fragment(); 63 64 64 65 QString sgroup = qurl.userName(); 66 QString hostname = GetMythDB()->GetHostName(); 65 67 66 68 MythSocket *lsock = new MythSocket(); 67 69 QString stype = (control) ? "control socket" : "file data socket"; … … 70 72 71 73 if (port <= 0) 72 74 { 73 port = GetMythDB()->GetSettingOnHost("BackendServerPort", host ).toInt();75 port = GetMythDB()->GetSettingOnHost("BackendServerPort", hostname).toInt(); 74 76 75 77 // if we still have no port use the default 76 78 if (port <= 0) 77 79 port = 6543; 78 80 } 79 81 82 if (host.isEmpty()) 83 { 84 host = GetMythDB()->GetSettingOnHost("BackendServerIP", hostname); 85 if (host.isEmpty()) 86 { 87 host = GetMythDB()->GetSetting("BackendServerIP"); 88 if (host.isEmpty()) 89 { 90 VERBOSE(VB_IMPORTANT, 91 QString("\n\t\t\tCould not connect to server %1:%2 (Failed to retrieve BackendServerIP!)") 92 .arg(host).arg(port)); 93 return NULL; 94 } 95 } 96 } 97 80 98 if (!lsock->connect(host, port)) 81 99 { 82 100 VERBOSE(VB_IMPORTANT, loc_err + … … 86 104 return NULL; 87 105 } 88 106 89 QString hostname = GetMythDB()->GetHostName();90 107 91 108 QStringList strlist; 92 109