Skip to content

Commit

Permalink
web server: fix two bugs
Browse files Browse the repository at this point in the history
Fixed two unrelated issues.
- A clash on port 6554, where two places in the code were trying to
  listen on the same port. Changed old web server ssl port to 6560
  instead of 6554.
- version method was not included in V2 services, causing Kodi connection
  to fail. Implemented the version method.
  • Loading branch information
bennettpeter committed Jul 25, 2023
1 parent 9076f82 commit dc6fb82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mythtv/libs/libmythbase/http/mythhttpservice.cpp
Expand Up @@ -44,7 +44,20 @@ HTTPResponse MythHTTPService::HTTPRequest(const HTTPRequest2& Request)
// else
// return xsd.GetEnumXSD( Request, Request->m_queries.value("enum"));
}

if ( method == "version" )
{
int nClassIdx = m_staticMetaService->m_meta.indexOfClassInfo( "Version" );
if (nClassIdx >=0)
{
QString sVersion =
m_staticMetaService->m_meta.classInfo(nClassIdx).value();
auto accept = MythHTTPEncoding::GetMimeTypes(MythHTTP::GetHeader(Request->m_headers, "accept"));
HTTPData content = MythSerialiser::Serialise("String", sVersion, accept);
content->m_cacheType = HTTPETag | HTTPShortLife;
HTTPResponse result = MythHTTPResponse::DataResponse(Request, content);
return result;
}
}
// Find the method
LOG(VB_HTTP, LOG_DEBUG, LOC + QString("Looking for method '%1'").arg(method));
HTTPMethodPtr handler = nullptr;
Expand Down
1 change: 1 addition & 0 deletions mythtv/programs/mythbackend/mediaserver.cpp
Expand Up @@ -70,6 +70,7 @@ void MediaServer::Init(bool bIsMaster, bool bDisableUPnp /* = false */)
int nWSPort = nPort + 5;
// UPNP port is now status port + 6 (default 6550)
nPort += 6;
nSSLPort += 6;

auto *pHttpServer = new HttpServer();

Expand Down

0 comments on commit dc6fb82

Please sign in to comment.