Ticket #9922: fenc-stop-sending-multiple-responses.patch

File fenc-stop-sending-multiple-responses.patch, 1.7 KB (added by Gregory Moyer <moyerg@…>, 9 years ago)
  • mythtv/programs/mythfrontend/networkcontrol.cpp

    diff --git a/mythtv/programs/mythfrontend/networkcontrol.cpp b/mythtv/programs/mythfrontend/networkcontrol.cpp
    index b9a99df..6833fea 100644
    a b void NetworkControl::processNetworkControlCommand(NetworkCommand *nc) 
    317317        result = QString("INVALID command '%1', try 'help' for more info")
    318318                         .arg(nc->getArg(0));
    319319
    320     nrLock.lock();
    321     networkControlReplies.push_back(new NetworkCommand(nc->getClient(),result));
    322     nrLock.unlock();
     320    /*
     321     * Differentiate between a null result and an empty result allowing the
     322     * latter to be sent.
     323     */
     324    if (!result.isNull())
     325    {
     326        nrLock.lock();
     327        networkControlReplies.push_back(new NetworkCommand(nc->getClient(),result));
     328        nrLock.unlock();
    323329
    324     notifyDataAvailable();
     330        notifyDataAvailable();
     331    }
    325332}
    326333
    327334void NetworkControl::deleteClient(void)
    QString NetworkControl::processPlay(NetworkCommand *nc, int clientID) 
    646653            MythEvent me(message);
    647654            gCoreContext->dispatch(me);
    648655
    649             result.clear();
     656            /*
     657             * Set a null string result so that nothing is sent back to the
     658             * client until a response event is seen.
     659             */
     660            result = QString();
    650661        }
    651662        else
    652663        {
    QString NetworkControl::listSchedule(const QString& chanID) const 
    13951406
    13961407QString NetworkControl::listRecordings(QString chanid, QString starttime)
    13971408{
    1398     QString result;
     1409    QString result = "";
    13991410    MSqlQuery query(MSqlQuery::InitCon());
    14001411    QString queryStr;
    14011412    bool appendCRLF = true;