[Opalvoip-svn] SF.net SVN: opalvoip:[34864] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2016-07-14 08:12:53
|
Revision: 34864 http://sourceforge.net/p/opalvoip/code/34864 Author: rjongbloed Date: 2016-07-14 08:12:50 +0000 (Thu, 14 Jul 2016) Log Message: ----------- Allow the PURL::LoadResource() to add customer headers to HTTP request. Modified Paths: -------------- ptlib/trunk/include/ptclib/url.h ptlib/trunk/src/ptclib/httpclnt.cxx Modified: ptlib/trunk/include/ptclib/url.h =================================================================== --- ptlib/trunk/include/ptclib/url.h 2016-07-11 18:29:01 UTC (rev 34863) +++ ptlib/trunk/include/ptclib/url.h 2016-07-14 08:12:50 UTC (rev 34864) @@ -365,6 +365,7 @@ PString m_certificate; // File or data PString m_privateKey; // File or data #endif + PStringOptions m_customOptions; // E.g. headers for http }; /**Get the resource the URL is pointing at. The data returned is obtained according to the scheme and the factory Modified: ptlib/trunk/src/ptclib/httpclnt.cxx =================================================================== --- ptlib/trunk/src/ptclib/httpclnt.cxx 2016-07-11 18:29:01 UTC (rev 34863) +++ ptlib/trunk/src/ptclib/httpclnt.cxx 2016-07-14 08:12:50 UTC (rev 34864) @@ -381,6 +381,8 @@ strm << '/'; else strm << url; + if (PTrace::CanTrace(4)) + strm << '\n' << outMIME; strm << PTrace::End; } #endif @@ -1263,7 +1265,7 @@ #if P_SSL http.SetSSLCredentials(params.m_authority, params.m_certificate, params.m_privateKey); #endif - PMIMEInfo outMIME, replyMIME; + PMIMEInfo outMIME = params.m_customOptions, replyMIME; if (!http.GetDocument(url, outMIME, replyMIME)) return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |