From aa2be4e20001f1b763705476f862937bc8d653d7 Mon Sep 17 00:00:00 2001 From: jim westfall Date: Mon, 28 Mar 2011 08:11:17 -0400 Subject: [PATCH] Fixes #9698. Adds support for HEAD http requests. Patch supplied by Jim with slight modification by David Blain. --- mythtv/libs/libmythupnp/servicehost.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mythtv/libs/libmythupnp/servicehost.cpp b/mythtv/libs/libmythupnp/servicehost.cpp index 51ec338c185..6e9dca73582 100644 --- a/mythtv/libs/libmythupnp/servicehost.cpp +++ b/mythtv/libs/libmythupnp/servicehost.cpp @@ -35,7 +35,7 @@ MethodInfo::MethodInfo() { - m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost); + m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost | RequestTypeHead); } ////////////////////////////////////////////////////////////////////////////// @@ -220,7 +220,7 @@ ServiceHost::ServiceHost( const QMetaObject &metaObject, const QString &sExtensi oInfo.m_nMethodIndex = nIdx; oInfo.m_sName = sName.section( '(', 0, 0 ); oInfo.m_oMethod = method; - oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost); + oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost | RequestTypeHead); QString sMethodClassInfo = oInfo.m_sName + "_Method"; @@ -233,7 +233,7 @@ ServiceHost::ServiceHost( const QMetaObject &metaObject, const QString &sExtensi if (sRequestType == "POST") oInfo.m_eRequestType = RequestTypePost; else if (sRequestType == "GET" ) - oInfo.m_eRequestType = RequestTypeGet; + oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypeHead); } m_Methods.insert( oInfo.m_sName, oInfo ); @@ -323,7 +323,8 @@ bool ServiceHost::ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pReque else { switch( pRequest->m_eType ) - { + { + case RequestTypeHead: case RequestTypeGet : sMethodName = "Get" + sMethodName; break; case RequestTypePost: sMethodName = "Put" + sMethodName; break; }