[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-protocol-cvs
Subject: [Protocol-cvs] http httppars.cpp,1.7,1.8
From: ping () helixcommunity ! org
Date: 2006-01-31 23:39:09
[Download RAW message or body]
Update of /cvsroot/protocol/http
In directory cvs:/tmp/cvs-serv19677/http
Modified Files:
httppars.cpp
Log Message:
CHXHeader implements IHXValues and is creatable from the common class factory. \
Unfortunately, there are many places in our code where IHXValues* is instantiated via \
"new CHXHeader" instead of being created from CCF.
Most of the changes simply use CreateValuesCCF() to create IHXValues*, a few \
additional changes in common are required: 1. IHXValues3 is added to CHXHeader, it \
has one method: PreserveCase(HXBOOL bPreserve) which is only used by the XMLParser. \
2. There are still several places in common where "new CHXHeader" is used, but they \
are wrapped under "#ifndef HELIX_FEATURE_CLIENT" so that they are only compiled in \
for non-Client applications. 3. Added utility functions(CreateFromCCF & \
CreateFromCCFWithRequestHeaderOnly) which supports CCF to CHXRequest and used by the \
client.
After these changes, there is no "new CHXHeader" across all Helix DNA client modules \
except the common class factory in client/medpltfm
CR by Erik
Index: httppars.cpp
===================================================================
RCS file: /cvsroot/protocol/http/httppars.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- httppars.cpp 2 Aug 2005 18:00:40 -0000 1.7
+++ httppars.cpp 31 Jan 2006 23:39:07 -0000 1.8
@@ -57,6 +57,7 @@
#include "hxstrutl.h"
#include "hxstring.h"
#include "chxpckts.h"
+#include "pckunpck.h"
#include "hxauth.h"
#include "httppars.h"
@@ -69,13 +70,16 @@
#endif
-HTTPParser::HTTPParser()
+HTTPParser::HTTPParser(IUnknown* pContext)
{
+ m_pContext = pContext;
+ HX_ADDREF(m_pContext);
}
HTTPParser::~HTTPParser()
{
clearMessageLines();
+ HX_RELEASE(m_pContext);
}
/*
@@ -168,8 +172,18 @@
MIMEToken nextTok = scanner.nextToken(" ");
if(strcasecmp(nextTok.value(), "Digest") == 0)
{
- authValues = new CHXHeader;
- authValues->AddRef();
+ if (m_pContext)
+ {
+ CreateValuesCCF(authValues, m_pContext);
+ }
+ // Client should always set m_pContext
+#ifndef HELIX_FEATURE_CLIENT
+ else
+ {
+ authValues = new CHXHeader;
+ authValues->AddRef();
+ }
+#endif
authValues->SetPropertyULONG32("AuthType", HX_AUTH_DIGEST);
while(nextTok.hasValue())
{
@@ -211,8 +225,18 @@
}
else if(strcasecmp(nextTok.value(), "Basic") == 0)
{
- authValues = new CHXHeader();
- authValues->AddRef();
+ if (m_pContext)
+ {
+ CreateValuesCCF(authValues, m_pContext);
+ }
+ // Client should always set m_pContext
+#ifndef HELIX_FEATURE_CLIENT
+ else
+ {
+ authValues = new CHXHeader();
+ authValues->AddRef();
+ }
+#endif
authValues->SetPropertyULONG32("AuthType", HX_AUTH_BASIC);
while(nextTok.hasValue())
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic