From dbd00bdf869f81da8a1040e08664afe36a4e72bc Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Wed, 26 May 1999 06:34:44 +0000 Subject: [PATCH] Some fixes to get the http test case running... Fixed the handler factory to correctly return the instance. Changed to CID of the URL being created to NS_STANDARDURL_CID. Fixed a signed/unsigned crash when creating connections... git-svn-id: svn://10.0.0.236/trunk@32661 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/http/src/nsHTTPHandler.cpp | 8 ++++---- .../netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPHandler.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPHandler.cpp index d3c721cc5ad..c6bc483b3a1 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPHandler.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPHandler.cpp @@ -26,10 +26,9 @@ #include "nsITransport.h" #include "nsISocketTransportService.h" #include "nsIServiceManager.h" -#include "nsStandardUrl.h" #include "nsIHTTPEventSink.h" -static NS_DEFINE_CID(kStandardUrlCID, NS_THIS_STANDARDURL_IMPLEMENTATION_CID); +static NS_DEFINE_CID(kStandardUrlCID, NS_STANDARDURL_CID); static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); NS_METHOD CreateOrGetHTTPHandler(nsIHTTPHandler* *o_HTTPHandler) @@ -80,11 +79,12 @@ nsHTTPHandler::NewConnection(nsIURL* i_URL, nsIURL* pURL = nsnull; //Check to see if an instance already exists in the active list PRUint32 count; + PRInt32 index; m_pConnections->Count(&count); - for (--count; count >= 0; --count) + for (index=count-1; index >= 0; --index) { //switch to static_cast... - pConn = (nsHTTPConnection*)((nsIHTTPConnection*) m_pConnections->ElementAt(count)); + pConn = (nsHTTPConnection*)((nsIHTTPConnection*) m_pConnections->ElementAt(index)); //Do other checks here as well... TODO if ((NS_OK == pConn->GetURL(&pURL)) && (pURL == i_URL)) { diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp index 2d6a906d1f0..24272454046 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp @@ -108,7 +108,8 @@ nsHTTPHandlerFactory::CreateInstance(nsISupports *aOuter, return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(inst); - *aResult = inst; + inst->QueryInterface(aIID, aResult); + NS_RELEASE(inst); return rv; }