if (method.EqualsIgnoreCase("get")) {  action += "?"; action += input; }
action += "?"; action += input;
InternetSearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engine,				const nsString &fullURL, const nsString &text){	nsresult	rv;	nsAutoString	textTemp(text);//	Note: source can be null//	if (!source)	return(NS_ERROR_NULL_POINTER);	if (!engine)	return(NS_ERROR_NULL_POINTER);	if (!mInner)	return(NS_RDF_NO_VALUE);	nsCOMPtr<nsIUnicodeDecoder>	unicodeDecoder;	nsAutoString			action, method, input;	if (fullURL.Length() > 0)	{		action = fullURL;		method = "get";	}	else	{		nsAutoString		data;		if (NS_FAILED(rv = FindData(engine, data)))	return(rv);		if (data.Length() < 1)				return(NS_RDF_NO_VALUE);				nsAutoString	userVar;		if (NS_FAILED(rv = GetData(data, "search", "action", action)))	return(rv);		if (NS_FAILED(rv = GetData(data, "search", "method", method)))	return(rv);		nsAutoString	encodingStr, queryEncodingStr, resultEncodingStr;		GetData(data, "interpret", "resultEncoding", encodingStr);	// decimal string values		MapEncoding(encodingStr, resultEncodingStr);		// rjc note: ignore "interpret/resultTranslationEncoding" as well as		// "interpret/resultTranslationFont" since we always convert results to Unicode		if (resultEncodingStr.Length() > 0)		{			NS_WITH_SERVICE(nsICharsetConverterManager, charsetConv,				kCharsetConverterManagerCID, &rv);			if (NS_SUCCEEDED(rv) && (charsetConv))			{				rv = charsetConv->GetUnicodeDecoder(&resultEncodingStr,					getter_AddRefs(unicodeDecoder));			}		}		GetData(data, "search", "queryEncoding", encodingStr);		// decimal string values		MapEncoding(encodingStr, queryEncodingStr);		if (queryEncodingStr.Length() > 0)		{			// convert from escaped-UTF_8, to unicode, and then to			// the charset indicated by the dataset in question			char	*utf8data = textTemp.ToNewUTF8String();			if (utf8data)			{				NS_WITH_SERVICE(nsITextToSubURI, textToSubURI,					kTextToSubURICID, &rv);				if (NS_SUCCEEDED(rv) && (textToSubURI))				{					PRUnichar	*uni = nsnull;					if (NS_SUCCEEDED(rv = textToSubURI->UnEscapeAndConvert("UTF-8", utf8data, &uni)) && (uni))					{						char	*charsetData = nsnull;						if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape(nsCAutoString(queryEncodingStr), uni, &charsetData)) && (charsetData))						{							textTemp = charsetData;							Recycle(charsetData);						}						Recycle(uni);					}				}				Recycle(utf8data);			}		}		if (NS_FAILED(rv = GetInputs(data, userVar, textTemp, input)))	return(rv);		if (input.Length() < 1)				return(NS_ERROR_UNEXPECTED);		if (method.EqualsIgnoreCase("get"))		{			// HTTP Get method support			action += "?";			action += input;		}	}	nsCOMPtr<nsIInternetSearchContext>	context;	if (NS_FAILED(rv = NS_NewInternetSearchContext(source, engine, unicodeDecoder, getter_AddRefs(context))))		return(rv);	if (!context)	return(NS_ERROR_UNEXPECTED);	nsCOMPtr<nsIURI>	url;	if (NS_SUCCEEDED(rv = NS_NewURI(getter_AddRefs(url), action)))	{		nsCOMPtr<nsIChannel>	channel;		// XXX: Null LoadGroup ?		if (NS_SUCCEEDED(rv = NS_OpenURI(getter_AddRefs(channel), url, nsnull)))		{			if (method.EqualsIgnoreCase("post"))			{				nsCOMPtr<nsIHTTPChannel>	httpChannel = do_QueryInterface(channel);				if (httpChannel)				{					httpChannel->SetRequestMethod(HM_POST);			        	// construct post data to send			        	nsAutoString	postStr(POSTHEADER_PREFIX);			        	postStr.Append(input.Length(), 10);			        	postStr += POSTHEADER_SUFFIX;			        	postStr += input;			        						nsCOMPtr<nsIInputStream>	postDataStream;					if (NS_SUCCEEDED(rv = NS_NewPostDataStream(PR_FALSE, nsCAutoString(postStr),						0, getter_AddRefs(postDataStream))))					{						httpChannel->SetPostDataStream(postDataStream);					}				}			}			if (NS_SUCCEEDED(rv = channel->AsyncRead(0, -1, context, this)))			{				if (mConnections)				{					mConnections->AppendElement(channel);				}			}		}	}	// dispose of any last HTML results page	if (mInner)	{		nsCOMPtr<nsIRDFNode>	htmlNode;		if (NS_SUCCEEDED(rv = mInner->GetTarget(engine, kNC_HTML, PR_TRUE, getter_AddRefs(htmlNode)))			&& (rv != NS_RDF_NO_VALUE))		{			rv = mInner->Unassert(engine, kNC_HTML, htmlNode);		}	}	// start "loading" animation for this search engine	if (NS_SUCCEEDED(rv) && (mInner))	{		// remove status icon so that loading icon style can be used		nsCOMPtr<nsIRDFNode>		engineIconNode = nsnull;		mInner->GetTarget(engine, kNC_StatusIcon, PR_TRUE, getter_AddRefs(engineIconNode));		if (engineIconNode)		{			rv = mInner->Unassert(engine, kNC_StatusIcon, engineIconNode);		}		nsCOMPtr<nsIRDFLiteral>	literal;		if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(nsAutoString("true").GetUnicode(), getter_AddRefs(literal))))		{			mInner->Assert(engine, kNC_loading, literal, PR_TRUE);		}	}	return(rv);}