Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsMsgProtocol.cpp File Reference
#include "msgCore.h"
#include "nsReadableUtils.h"
#include "nsMsgProtocol.h"
#include "nsIMsgMailNewsUrl.h"
#include "nsIStreamTransportService.h"
#include "nsISocketTransportService.h"
#include "nsISocketTransport.h"
#include "nsXPIDLString.h"
#include "nsSpecialSystemDirectory.h"
#include "nsILoadGroup.h"
#include "nsIIOService.h"
#include "nsNetUtil.h"
#include "nsIFileURL.h"
#include "nsFileStream.h"
#include "nsIMsgWindow.h"
#include "nsIMsgStatusFeedback.h"
#include "nsIWebProgressListener.h"
#include "nsIPipe.h"
#include "nsIPrompt.h"
#include "prprf.h"
#include "plbase64.h"
#include "nsIStringBundle.h"
#include "nsIProtocolProxyService.h"
#include "nsIProxyInfo.h"
#include "nsEventQueueUtils.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"

Go to the source code of this file.

Classes

class  nsMsgProtocolStreamProvider

Defines

#define POST_DATA_BUFFER_SIZE   2048
#define MSGS_URL   "chrome://messenger/locale/messenger.properties"

Functions

static NS_DEFINE_CID (kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID)
static NS_DEFINE_CID (kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID)
static
NS_INTERFACE_MAP_END_THREADSAFE
PRUnichar
FormatStringWithHostNameByID (PRInt32 stringID, nsIMsgMailNewsUrl *msgUri)
 NS_IMPL_THREADSAFE_ISUPPORTS1 (nsMsgProtocolStreamProvider, nsIOutputStreamCallback) class nsMsgFilePostHelper

Variables

static PRBool gGotTimeoutPref
static PRInt32 gSocketTimeout = 60

Define Documentation

#define MSGS_URL   "chrome://messenger/locale/messenger.properties"

Definition at line 1552 of file nsMsgProtocol.cpp.


Function Documentation

PRUnichar * FormatStringWithHostNameByID ( PRInt32  stringID,
nsIMsgMailNewsUrl msgUri 
) [static]

Definition at line 1554 of file nsMsgProtocol.cpp.

{
  if (! msgUri)
    return nsnull;

  nsresult rv;
  nsCOMPtr <nsIStringBundle> sBundle = nsnull;

  nsCOMPtr<nsIStringBundleService> sBundleService = 
          do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
  if (NS_FAILED(rv) || (! sBundleService)) 
    return nsnull;

  rv = sBundleService->CreateBundle(MSGS_URL, getter_AddRefs(sBundle));
  if (NS_FAILED(rv)) 
    return nsnull;

  PRUnichar *ptrv = nsnull;
  nsXPIDLCString hostName;
  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = msgUri->GetServer(getter_AddRefs(server));

  if (NS_SUCCEEDED(rv) && server)
   rv = server->GetRealHostName(getter_Copies(hostName));

  nsAutoString hostStr;
  hostStr.AssignWithConversion(hostName.get());
  const PRUnichar *params[] = { hostStr.get() };
  rv = sBundle->FormatStringFromID(stringID, params, 1, &ptrv);
  if (NS_FAILED(rv)) 
    return nsnull;

  return (ptrv);
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kSocketTransportServiceCID  ,
NS_SOCKETTRANSPORTSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kStreamTransportServiceCID  ,
NS_STREAMTRANSPORTSERVICE_CID   
) [static]

Definition at line 1109 of file nsMsgProtocol.cpp.

                          : public nsIStreamListener 
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIREQUESTOBSERVER
  NS_DECL_NSISTREAMLISTENER

  nsMsgFilePostHelper() { mSuspendedPostFileRead = PR_FALSE;}
  nsresult Init(nsIOutputStream * aOutStream, nsMsgAsyncWriteProtocol * aProtInstance, nsIFile *aFileToPost);
  virtual ~nsMsgFilePostHelper() {}
  nsCOMPtr<nsIRequest> mPostFileRequest;
  PRBool mSuspendedPostFileRead;
  void CloseSocket() { mProtInstance = nsnull; }
protected:
  nsCOMPtr<nsIOutputStream> mOutStream;
  nsMsgAsyncWriteProtocol * mProtInstance;
};

Here is the call graph for this function:


Variable Documentation

Definition at line 116 of file nsMsgProtocol.cpp.

PRInt32 gSocketTimeout = 60 [static]

Definition at line 117 of file nsMsgProtocol.cpp.