diff --git a/mythtv/libs/libmythbase/remotefile.cpp b/mythtv/libs/libmythbase/remotefile.cpp
index eb591fb..dc75022 100644
a
|
b
|
using namespace std; |
36 | 36 | |
37 | 37 | #define MAX_FILE_CHECK 500 // in ms |
38 | 38 | |
| 39 | static bool RemoteSendReceiveStringList(const QString &host, QStringList &strlist) |
| 40 | { |
| 41 | bool ok = false; |
| 42 | |
| 43 | if (gCoreContext->IsMasterBackend()) |
| 44 | { |
| 45 | // since the master backend cannot connect back around to |
| 46 | // itself, and the libraries do not have access to the list |
| 47 | // of connected slave backends to query an existing connection |
| 48 | // start up a new temporary connection directly to the slave |
| 49 | // backend to query the file list |
| 50 | QString ann = QString("ANN Playback %1 0") |
| 51 | .arg(gCoreContext->GetHostName()); |
| 52 | QString addr = gCoreContext->GetBackendServerIP(host); |
| 53 | int port = gCoreContext->GetBackendServerPort(host); |
| 54 | bool mismatch = false; |
| 55 | |
| 56 | MythSocket *sock = gCoreContext->ConnectCommandSocket( |
| 57 | addr, port, ann, &mismatch); |
| 58 | if (sock) |
| 59 | { |
| 60 | ok = sock->SendReceiveStringList(strlist); |
| 61 | sock->DecrRef(); |
| 62 | } |
| 63 | else |
| 64 | strlist.clear(); |
| 65 | } |
| 66 | else |
| 67 | ok = gCoreContext->SendReceiveStringList(strlist); |
| 68 | |
| 69 | return ok; |
| 70 | } |
| 71 | |
39 | 72 | RemoteFile::RemoteFile(const QString &_path, bool write, bool useRA, |
40 | 73 | int _timeout_ms, |
41 | 74 | const QStringList *possibleAuxiliaryFiles) : |
… |
… |
bool RemoteFile::Exists(const QString &url, struct stat *fileinfo) |
498 | 531 | if (!sgroup.isEmpty()) |
499 | 532 | strlist << sgroup; |
500 | 533 | |
501 | | gCoreContext->SendReceiveStringList(strlist); |
502 | | |
503 | 534 | bool result = false; |
504 | | if (!strlist.isEmpty() && strlist[0] == "1") |
| 535 | if (RemoteSendReceiveStringList(host, strlist) && strlist[0] == "1") |
505 | 536 | { |
506 | 537 | if ((strlist.size() >= 15) && fileinfo) |
507 | 538 | { |
… |
… |
QString RemoteFile::GetFileHash(const QString &url) |
557 | 588 | strlist << sgroup; |
558 | 589 | strlist << hostname; |
559 | 590 | |
560 | | gCoreContext->SendReceiveStringList(strlist); |
561 | | if (!strlist.isEmpty()) |
| 591 | if (RemoteSendReceiveStringList(hostname, strlist)) |
562 | 592 | { |
563 | 593 | result = strlist[0]; |
564 | 594 | } |