Back to index

enigmail  1.4.3
Defines | Functions | Variables
nsEnigMimeListener.cpp File Reference
#include "enigmail.h"
#include "prlog.h"
#include "nsCOMPtr.h"
#include "nsIInputStream.h"
#include "nsIThread.h"
#include "nsStringAPI.h"
#include "nsNetUtil.h"
#include "mimehdrs2.h"
#include "nsMimeTypes.h"
#include "nsMailHeaders.h"
#include "nsEnigMimeListener.h"

Go to the source code of this file.

Defines

#define FORCE_PR_LOG   /* Allow logging even in release build */
#define ERROR_LOG(args)   PR_LOG(gEnigMimeListenerLog,PR_LOG_ERROR,args)
#define WARNING_LOG(args)   PR_LOG(gEnigMimeListenerLog,PR_LOG_WARNING,args)
#define DEBUG_LOG(args)   PR_LOG(gEnigMimeListenerLog,PR_LOG_DEBUG,args)
#define NS_PIPE_CONSOLE_BUFFER_SIZE   (1024)
#define MK_MIME_ERROR_WRITING_FILE   -1

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS4 (nsEnigMimeListener, nsIEnigMimeListener, nsIRequestObserver, nsIStreamListener, nsIInputStream) nsEnigMimeListener
static nsresult EnigMimeListener_write (const char *buf, PRInt32 size, void *closure)
static void __ReplaceCSubstring (nsACString &string, const char *replace, const char *with)
static void __ReplaceCChar (nsACString &string, const char replace, const char with)

Variables

static const PRUint32 kCharMax = 1024

Define Documentation

#define DEBUG_LOG (   args)    PR_LOG(gEnigMimeListenerLog,PR_LOG_DEBUG,args)

Definition at line 59 of file nsEnigMimeListener.cpp.

#define ERROR_LOG (   args)    PR_LOG(gEnigMimeListenerLog,PR_LOG_ERROR,args)

Definition at line 57 of file nsEnigMimeListener.cpp.

#define FORCE_PR_LOG   /* Allow logging even in release build */

Definition at line 38 of file nsEnigMimeListener.cpp.

Definition at line 65 of file nsEnigMimeListener.cpp.

Definition at line 61 of file nsEnigMimeListener.cpp.

#define WARNING_LOG (   args)    PR_LOG(gEnigMimeListenerLog,PR_LOG_WARNING,args)

Definition at line 58 of file nsEnigMimeListener.cpp.


Function Documentation

static void __ReplaceCChar ( nsACString &  string,
const char  replace,
const char  with 
) [static]

Definition at line 682 of file nsEnigMimeListener.cpp.

{
       PRInt32 i = string.FindChar (replace);
  while (i >= 0 ) {
         string.Replace (i, 1, (const char*) &with, 1);
         i = string.FindChar (replace);
       }
}

Here is the caller graph for this function:

static void __ReplaceCSubstring ( nsACString &  string,
const char *  replace,
const char *  with 
) [static]

Definition at line 672 of file nsEnigMimeListener.cpp.

{
       PRInt32 i = string.Find (replace);
       while ( i >= 0 ) {
       string.Replace (i, strlen (replace), with);
       i = string.Find (replace);
  }
}

Here is the caller graph for this function:

static nsresult EnigMimeListener_write ( const char *  buf,
PRInt32  size,
void *  closure 
) [static]

Definition at line 216 of file nsEnigMimeListener.cpp.

{
  DEBUG_LOG(("nsEnigMimeListener::EnigMimeListener_write: (%p) %d\n", closure, size));

  if (!closure)
    return NS_ERROR_FAILURE;

  nsEnigMimeListener* enigMimeListener = (nsEnigMimeListener *) closure;

  return enigMimeListener->SendStream(buf, size, nsnull, nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMPL_THREADSAFE_ISUPPORTS4 ( nsEnigMimeListener  ,
nsIEnigMimeListener  ,
nsIRequestObserver  ,
nsIStreamListener  ,
nsIInputStream   
)

Definition at line 72 of file nsEnigMimeListener.cpp.

  : mInitialized(PR_FALSE),
    mRequestStarted(PR_FALSE),
    mSkipHeaders(PR_FALSE),
    mSkipBody(PR_FALSE),

    mContentType(""),
    mContentCharset(""),
    mContentBoundary(""),
    mContentProtocol(""),
    mContentMicalg(""),

    mContentEncoding(""),
    mContentDisposition(""),
    mContentLength(-1),

    mDecodeContent(PR_FALSE),
    mDecoderData(nsnull),

    mLinebreak(""),
    mHeaders(""),
    mDataStr(""),
    mHeaderSearchCounter(0),

    mHeadersFinalCR(PR_FALSE),
    mHeadersLinebreak(2),

    mMaxHeaderBytes(0),
    mDataOffset(0),

    mStreamBuf(nsnull),
    mStreamOffset(0),
    mStreamLength(0),
    mSubPartTreatment(PR_FALSE),

    mListener(nsnull),
    mContext(nsnull)
{
    NS_INIT_ISUPPORTS();

#ifdef PR_LOGGING
  if (gEnigMimeListenerLog == nsnull) {
    gEnigMimeListenerLog = PR_NewLogModule("nsEnigMimeListener");
  }
#endif

#ifdef FORCE_PR_LOG
  nsresult rv;
  nsCOMPtr<nsIThread> myThread;
  rv = ENIG_GET_THREAD(myThread);
  DEBUG_LOG(("nsEnigMimeListener:: <<<<<<<<< CTOR(%p): myThread=%p\n",
         this, myThread.get()));
#endif
}

Variable Documentation

const PRUint32 kCharMax = 1024 [static]

Definition at line 63 of file nsEnigMimeListener.cpp.