compiling dconnect extension by default, but only including it in the

final component library if BUILD_DCONNECT is set in the build environment.
fixing a buffer overrun in ipcMessageWriter (it was not initializing itself
properly)
This commit is contained in:
darin%meer.net 2004-05-17 19:49:42 +00:00
parent a6a8297e30
commit 2295e96050
4 changed files with 20 additions and 6 deletions

View File

@ -84,6 +84,14 @@ SHARED_LIBRARY_LIBS = \
$(DIST)/lib/$(LIB_PREFIX)transmgrcom_s.$(LIB_SUFFIX) \
$(NULL)
ifneq ($(BUILD_DCONNECT),)
DEFINES += -DBUILD_DCONNECT
LOCAL_INCLUDES += -I$(srcdir)/../../extensions/dconnect/src
SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)ipcddconnect_s.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)ipcdutil_s.$(LIB_SUFFIX) \
$(NULL)
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \

View File

@ -96,7 +96,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ipcLockService, Init)
#include "tmTransactionService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(tmTransactionService)
#if 0
#ifdef BUILD_DCONNECT
#include "ipcDConnectService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ipcDConnectService, Init)
@ -133,7 +134,8 @@ ipcDConnectServiceUnregisterProc(nsIComponentManager *aCompMgr,
IPC_DCONNECTSERVICE_CONTRACTID, PR_TRUE);
return NS_OK;
}
#endif
#endif // BUILD_DCONNECT
//-----------------------------------------------------------------------------
// Define a table of CIDs implemented by this module along with other
@ -160,11 +162,14 @@ static const nsModuleComponentInfo components[] = {
IPC_TRANSACTIONSERVICE_CID,
IPC_TRANSACTIONSERVICE_CONTRACTID,
tmTransactionServiceConstructor },
#if 0
#ifdef BUILD_DCONNECT
{ IPC_DCONNECTSERVICE_CLASSNAME,
IPC_DCONNECTSERVICE_CID,
IPC_DCONNECTSERVICE_CONTRACTID,
ipcDConnectServiceConstructor },
ipcDConnectServiceConstructor,
ipcDConnectServiceRegisterProc,
ipcDConnectServiceUnregisterProc },
#endif
};

View File

@ -44,6 +44,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = ipcd
DIRS = lock transmngr
DIRS = lock transmngr dconnect
include $(topsrcdir)/config/rules.mk

View File

@ -55,9 +55,10 @@ public:
ipcMessageWriter(PRUint32 initialCapacity) :
mBuf(NULL),
mBufPtr(NULL), mBufEnd(NULL),
mCapacity(initialCapacity),
mCapacity(0),
mError(PR_FALSE)
{
EnsureCapacity(initialCapacity);
}
~ipcMessageWriter();