MythTV  master
mythhttpthread.cpp
Go to the documentation of this file.
1 // MythTV
3 #include "http/mythhttpserver.h"
4 #include "http/mythhttpsocket.h"
5 #include "http/mythhttpthread.h"
6 
7 #define LOC (QString("%1: ").arg(objectName()))
8 
10  const QString& ThreadName, qintptr Socket, bool Ssl)
11  : MThread(ThreadName),
12  m_server(Server),
13  m_config(std::move(Config)),
14  m_socketFD(Socket),
15  m_ssl(Ssl)
16 {
17 }
18 
20 {
21  RunProlog();
29  exec();
30  delete m_socket;
31  m_socket = nullptr;
32  RunEpilog();
33 }
34 
43 {
44  if (m_socket)
45  emit m_socket->Finish();
46 }
MThread::exec
int exec(void)
Enters the qt event loop. call exit or quit to exit thread.
Definition: mthread.cpp:325
MythHTTPServer::HostsChanged
void HostsChanged(const QStringList &Hosts)
MythHTTPThread::m_server
MythHTTPServer * m_server
Definition: mythhttpthread.h:25
MythHTTPSocket::Finish
void Finish()
MythHTTPSocket::ServicesChanged
void ServicesChanged(const HTTPServices &Services)
Definition: mythhttpsocket.cpp:119
MythHTTPSocket::ThreadUpgraded
void ThreadUpgraded(QThread *Thread)
mythhttpthread.h
MThread::RunProlog
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
Definition: mthread.cpp:196
mythhttpsocket.h
MythHTTPServer::ServicesChanged
void ServicesChanged(const HTTPServices &Services)
MythHTTPThreadPool::ThreadUpgraded
void ThreadUpgraded(QThread *Thread)
Definition: mythhttpthreadpool.cpp:74
MythHTTPThread::m_socket
MythHTTPSocket * m_socket
Definition: mythhttpthread.h:28
MythHTTPThread::m_config
MythHTTPConfig m_config
Definition: mythhttpthread.h:26
MythHTTPSocket::PathsChanged
void PathsChanged(const QStringList &Paths)
Update our list of recognised file paths.
Definition: mythhttpsocket.cpp:109
MThread::RunEpilog
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
Definition: mthread.cpp:209
MythHTTPThread::m_ssl
bool m_ssl
Definition: mythhttpthread.h:29
MythHTTPSocket::HostsChanged
void HostsChanged(const QStringList &Hosts)
Definition: mythhttpsocket.cpp:135
MythHTTPThread::Quit
void Quit()
Tell the socket to complete and disconnect.
Definition: mythhttpthread.cpp:42
MythHTTPServer::HandlersChanged
void HandlersChanged(const HTTPHandlers &Handlers)
mythhttpserver.h
MythHTTPThread::run
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: mythhttpthread.cpp:19
MythHTTPThread::MythHTTPThread
MythHTTPThread(MythHTTPServer *Server, MythHTTPConfig Config, const QString &ThreadName, qintptr Socket, bool Ssl)
Definition: mythhttpthread.cpp:9
MythHTTPSocket
Definition: mythhttpsocket.h:18
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
MythHTTPServer
Definition: mythhttpserver.h:12
MythHTTPSocket::OriginsChanged
void OriginsChanged(const QStringList &Origins)
Update the list of allowed Origins.
Definition: mythhttpsocket.cpp:130
MythHTTPThread::m_socketFD
qintptr m_socketFD
Definition: mythhttpthread.h:27
mythhttpthreadpool.h
MythHTTPServer::PathsChanged
void PathsChanged(const QStringList &Paths)
MythHTTPConfig
Definition: mythhttptypes.h:61
MythHTTPServer::OriginsChanged
void OriginsChanged(const QStringList &Origins)
MythHTTPSocket::HandlersChanged
void HandlersChanged(const HTTPHandlers &Handlers)
Definition: mythhttpsocket.cpp:114