rv = serv->GetProtocolHandler("http", getter_AddRefs(handler));  if (ioService == nsnull) { (void)nsServiceManager::ReleaseService(kIOServiceCID, serv); }
rv = ioService->GetProtocolHandler("http", getter_AddRefs(handler));
NS_NewPostDataStream(nsIInputStream **result,                     PRBool isFile,                     const char *data,                     PRUint32 encodeFlags,                     nsIIOService* ioService = nsnull)     // pass in nsIIOService to optimize callers{    nsresult rv;    nsIIOService* serv = ioService;    static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);    if (serv == nsnull) {        rv = nsServiceManager::GetService(kIOServiceCID, NS_GET_IID(nsIIOService),                                          (nsISupports**)&serv);        if (NS_FAILED(rv)) return rv;    }    nsCOMPtr<nsIProtocolHandler> handler;    rv = serv->GetProtocolHandler("http", getter_AddRefs(handler));    if (ioService == nsnull) {        (void)nsServiceManager::ReleaseService(kIOServiceCID, serv);    }    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIHTTPProtocolHandler> http = do_QueryInterface(handler, &rv);    if (NS_FAILED(rv)) return rv;        return http->NewPostDataStream(isFile, data, encodeFlags, result);}