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
This commit is contained in:
rpotts%netscape.com 1999-05-26 06:34:44 +00:00
parent d07ce90146
commit dbd00bdf86
2 changed files with 6 additions and 5 deletions

View File

@ -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))
{

View File

@ -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;
}