Ticket #2031: myth-interface.patch

File myth-interface.patch, 4.3 KB (added by twhitehe@…, 14 years ago)
  • programs/mythbackend/httpstatus.

    old new  
    1111#include "libmyth/mythcontext.h"
    1212#include "jobqueue.h"
    1313
    1414
    15 HttpStatus::HttpStatus(MainServer *parent, int port)
    16           : QServerSocket(port, 1)
     15HttpStatus::HttpStatus(MainServer *parent, const QString &sip, int port)
     16          : QServerSocket(sip, port, 1)
    1717{
    1818    m_parent = parent;
    1919}
    2020
  • programs/mythbackend/httpstatus.

    old new  
    1111class HttpStatus : public QServerSocket
    1212{
    1313    Q_OBJECT
    1414  public:
    15     HttpStatus(MainServer *parent, int port);
     15    HttpStatus(MainServer *parent, const QString &sip, int port);
    1616
    1717    void newConnection(int socket);
    1818
    1919  private slots:
  • programs/mythbackend/main.

    old new  
    546546            return BACKEND_EXIT_OPENING_VLOCKFILE_ERROR;
    547547        }
    548548    }
    549549
    550     new MainServer(ismaster, port, statusport, &tvList, sched, expirer);
     550    new MainServer(ismaster, myip, port, statusport, &tvList, sched, expirer);
    551551
    552552    if (ismaster)
    553553    {
    554554        QString WOLslaveBackends
  • programs/mythbackend/mainserver.

    old new  
    106106    QWaitCondition waitCond;
    107107    bool threadlives;
    108108};
    109109
    110 MainServer::MainServer(bool master, int port, int statusport,
     110MainServer::MainServer(bool master, const QString &sip, int port, int statusport,
    111111                       QMap<int, EncoderLink *> *tvList,
    112112                       Scheduler *sched, AutoExpire *expirer)
    113113{
    114114    m_sched = sched;
     
    130130    recordfileprefix = gContext->GetFilePrefix();
    131131
    132132    masterBackendOverride = gContext->GetSetting("MasterBackendOverride", 0);
    133133
    134     mythserver = new MythServer(port);
     134    mythserver = new MythServer(sip,port);
    135135    if (!mythserver->ok())
    136136    {
    137         VERBOSE(VB_IMPORTANT, QString("Failed to bind port %1. Exiting.")
    138                 .arg(port));
     137        VERBOSE(VB_IMPORTANT, QString("Failed to bind to %1:%2. Exiting.")
     138                .arg(sip)
     139                .arg(port));
    139140        exit(BACKEND_BUGGY_EXIT_NO_BIND_MAIN);
    140141    }
    141142
    142143    connect(mythserver, SIGNAL(newConnect(RefSocket *)),
    143144            SLOT(newConnection(RefSocket *)));
    144145    connect(mythserver, SIGNAL(endConnect(RefSocket *)),
    145146            SLOT(endConnection(RefSocket *)));
    146147
    147     statusserver = new HttpStatus(this, statusport);   
     148    statusserver = new HttpStatus(this, sip, statusport);   
    148149    if (!statusserver->ok())
    149150    {
    150         VERBOSE(VB_IMPORTANT, QString("Failed to bind to port %1. Exiting.")
     151        VERBOSE(VB_IMPORTANT, QString("Failed to bind to %1:%2. Exiting.")
     152                .arg(sip)
    151153                .arg(statusport));
    152154        exit(BACKEND_BUGGY_EXIT_NO_BIND_STATUS);
    153155    }
    154156
  • programs/mythbackend/mainserver.

    old new  
    2525class MainServer : public QObject
    2626{
    2727    Q_OBJECT
    2828  public:
    29     MainServer(bool master, int port, int statusport,
     29    MainServer(bool master, const QString &sip, int port, int statusport,
    3030               QMap<int, EncoderLink *> *tvList,
    3131               Scheduler *sched, AutoExpire *expirer);
    3232
    3333   ~MainServer();
  • programs/mythbackend/server.

    old new  
    33using namespace std;
    44
    55#include "server.h"
    66
    7 MythServer::MythServer(int port, QObject *parent)
    8           : QServerSocket(port, 1, parent)
     7MythServer::MythServer(const QString &sip, int port, QObject *parent)
     8          : QServerSocket(sip, port, 1, parent)
    99{
    1010}
    1111
    1212void MythServer::newConnection(int socket)
  • programs/mythbackend/server.

    old new  
    3333class MythServer : public QServerSocket
    3434{
    3535    Q_OBJECT
    3636  public:
    37     MythServer(int port, QObject *parent = 0);
     37    MythServer(const QString &sip, int port, QObject *parent = 0);
    3838
    3939    void newConnection(int socket);
    4040
    4141  signals: