return SendPropfindDocumentToChannel(requestBaseDoc, channel, streamListener, withDepth);
return SendDocumentToChannel(requestBaseDoc, channel, "PROPFIND", streamListener, withDepth);
nsWebDAVService::PropfindInternal(nsIWebDAVResource *resource,                                  PRUint32 propCount,                                  const char **properties,                                  PRBool withDepth,                                  nsIWebDAVOperationListener *listener,                                  nsISupports *closure,                                  PRBool namesOnly){    nsresult rv;    NS_ENSURE_ARG(resource);    NS_ENSURE_ARG(listener);    nsCOMPtr<nsIURI> resourceURI;    nsCOMPtr<nsIHttpChannel> channel;    rv = ChannelFromResource(resource, getter_AddRefs(channel),                             getter_AddRefs(resourceURI));    if (NS_FAILED(rv))        return rv;    nsCOMPtr<nsIDOMDocument> requestDoc;    nsCOMPtr<nsIDOMElement> propfindElt;    rv = CreatePropfindDocument(resourceURI, getter_AddRefs(requestDoc),                                getter_AddRefs(propfindElt));    NS_ENSURE_SUCCESS(rv, rv);    if (namesOnly) {        nsCOMPtr<nsIDOMElement> allpropElt;        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,                                       mDAVNSString, NS_LITERAL_STRING("propname"),                                       getter_AddRefs(allpropElt));        NS_ENSURE_SUCCESS(rv, rv);    } else if (propCount == 0) {        nsCOMPtr<nsIDOMElement> allpropElt;        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,                                       mDAVNSString, NS_LITERAL_STRING("allprop"),                                       getter_AddRefs(allpropElt));        NS_ENSURE_SUCCESS(rv, rv);    } else {        nsCOMPtr<nsIDOMElement> propElt;        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,                                       mDAVNSString, NS_LITERAL_STRING("prop"),                                       getter_AddRefs(propElt));        NS_ENSURE_SUCCESS(rv, rv);        for (PRUint32 i = 0; i < propCount; i++) {            nsDependentCString fullpropName(properties[i]);            // This string math is _ridiculous_.  It better compile to a total of            // 5 instructions, or I'm ripping it all out and doing my own looping.            nsACString::const_iterator start, saveStart, end, saveEnd;            fullpropName.BeginReading(start);            fullpropName.BeginReading(saveStart);            fullpropName.EndReading(end);            fullpropName.EndReading(saveEnd);            RFindInReadable(NS_LITERAL_CSTRING(" "), start, end);            if (start == end) {                nsCAutoString msg(NS_LITERAL_CSTRING("Illegal property name ")                                  + fullpropName + NS_LITERAL_CSTRING("\n"));                NS_WARNING(msg.get());                return NS_ERROR_INVALID_ARG;            }            if (LOG_ENABLED()) {                nsACString::const_iterator s = start;                                nsCAutoString propNamespace(nsDependentCSubstring(saveStart, s));                nsCAutoString propName(nsDependentCSubstring(++s, saveEnd));                                LOG(("prop ns: '%s', name: '%s'", propNamespace.get(), propName.get()));            }            NS_ConvertASCIItoUTF16 propNamespace(nsDependentCSubstring(saveStart, start)),                propName(nsDependentCSubstring(++start, saveEnd));            nsCOMPtr<nsIDOMElement> junk;            rv = NS_WD_AppendElementWithNS(requestDoc, propElt, propNamespace,                                           propName, getter_AddRefs(junk));            NS_ENSURE_SUCCESS(rv, rv);        }    }    nsCOMPtr<nsIStreamListener> streamListener =         NS_WD_NewPropfindStreamListener(resource, listener, closure,                                        namesOnly);    if (!streamListener)        return NS_ERROR_OUT_OF_MEMORY;        nsCOMPtr<nsIDocument> requestBaseDoc = do_QueryInterface(requestDoc);    return SendPropfindDocumentToChannel(requestBaseDoc, channel,                                         streamListener, withDepth);}