зеркало из https://github.com/mozilla/gecko-dev.git
Родитель
b2b531d4e3
Коммит
a361d7a4c2
|
@ -41,6 +41,7 @@ CPPSRCS = \
|
|||
urpMarshalToolkit.cpp \
|
||||
urpManager.cpp \
|
||||
urpStub.cpp \
|
||||
urpLog.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
|
|
|
@ -41,6 +41,7 @@ CPPSRCS = \
|
|||
urpMarshalToolkit.cpp \
|
||||
urpManager.cpp \
|
||||
urpStub.cpp \
|
||||
urpLog.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
|
|
|
@ -47,6 +47,7 @@ EXTRA_DSO_LDOPTS += \
|
|||
../transport/urpTransport.o \
|
||||
../urpStub.o \
|
||||
../urpMarshalToolkit.o \
|
||||
../urpLog.o \
|
||||
../urpManager.o
|
||||
|
||||
CXXFLAGS += -I../transport/ $(MOZ_TOOLKIT_REGISTRY_CFLAGS) -D_REENTRANT -DOJI_DISABLE -I$(CONNECT_SRC)/public
|
||||
|
|
|
@ -61,7 +61,7 @@ urpConnectComponent::~urpConnectComponent() {
|
|||
NS_IMETHODIMP urpConnectComponent::GetCompMan(char* cntStr,
|
||||
nsISupports** cm) {
|
||||
if (!cm) {
|
||||
printf("--urpConnectComponent::GetCompMan\n");
|
||||
printf("--urpConnectComponent::GetCompMan NS_ERROR_NULL_POINTER\n");
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (!compM) {
|
||||
|
@ -92,7 +92,7 @@ NS_IMETHODIMP urpConnectComponent::GetCompMan(char* cntStr,
|
|||
|
||||
NS_IMETHODIMP urpConnectComponent::GetTransport(char* cntStr, urpTransport** trans) {
|
||||
if(!trans) {
|
||||
printf("--urpConnectComponent::GetTransport\n");
|
||||
printf("--urpConnectComponent::GetTransport NS_ERROR_NULL_POINTER\n");
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if(!transport) {
|
||||
|
|
|
@ -43,6 +43,7 @@ EXTRA_DSO_LDOPTS += \
|
|||
../transport/urpTransport.o \
|
||||
../urpStub.o \
|
||||
../urpMarshalToolkit.o \
|
||||
../urpLog.o \
|
||||
../urpManager.o
|
||||
|
||||
CXXFLAGS += -I../transport/ $(MOZ_TOOLKIT_REGISTRY_CFLAGS) -D_REENTRANT -DOJI_DISABLE -I$(CONNECT_SRC)/public
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "urpIConnectComponent.h"
|
||||
#include "urpConnectComponentCID.h"
|
||||
|
||||
#include "../urpLog.h"
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(urpComponentFactory, nsIFactory)
|
||||
|
||||
static NS_DEFINE_CID(kConnectComponent,URP_CONNECTCOMPONENT_CID);
|
||||
|
@ -38,27 +40,29 @@ urpComponentFactory::urpComponentFactory(const char *_location, const nsCID &aCI
|
|||
}
|
||||
|
||||
urpComponentFactory::~urpComponentFactory() {
|
||||
printf("destructor or urpComponentFactory\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("destructor or urpComponentFactory\n"));
|
||||
nsCRT::free((char*)location);
|
||||
}
|
||||
|
||||
/* void CreateInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result);
|
||||
*/
|
||||
NS_IMETHODIMP urpComponentFactory::CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) {
|
||||
printf("--urpComponentFactory::CreateInstance\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentFactory::CreateInstance\n"));
|
||||
nsresult r;
|
||||
nsIFactory* factory;
|
||||
NS_WITH_SERVICE(urpIConnectComponent, conn, kConnectComponent, &r);
|
||||
if(NS_FAILED(r)) {
|
||||
printf("Error in loading urpIConnectComponent\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
nsIComponentManager* compM;
|
||||
conn->GetCompMan("socket,host=indra,port=20009", (nsISupports**)&compM);
|
||||
compM->FindFactory(aClass, &factory);
|
||||
factory->CreateInstance(aOuter, iid, result);
|
||||
NS_RELEASE(factory);
|
||||
printf("--urpComponentFactory::CreateInstance end\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentFactory::CreateInstance end\n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "nsXPIDLString.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "../urpLog.h"
|
||||
|
||||
|
||||
const char urpComponentTypeName[] = URPCOMPONENTTYPENAME;
|
||||
|
||||
|
@ -55,11 +57,13 @@ urpComponentLoader::urpComponentLoader()
|
|||
mXPCOMKey(0)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
printf("--urpComponentLoader::urpComponentLoader \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::urpComponentLoader \n"));
|
||||
}
|
||||
|
||||
urpComponentLoader::~urpComponentLoader() { //nb
|
||||
printf("--urpComponentLoader::~urpComponentLoader \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::~urpComponentLoader \n"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,7 +72,8 @@ urpComponentLoader::~urpComponentLoader() { //nb
|
|||
*/
|
||||
/* nsIFactory getFactory (in nsIIDRef aCID, in string aLocation, in string aType); */
|
||||
NS_IMETHODIMP urpComponentLoader::GetFactory(const nsIID & aCID, const char *aLocation, const char *aType, nsIFactory **_retval) {
|
||||
printf("--urpComponentLoader::GetFactory \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::GetFactory \n"));
|
||||
if (!_retval)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
#ifdef DEBUG
|
||||
|
@ -90,7 +95,8 @@ NS_IMETHODIMP urpComponentLoader::GetFactory(const nsIID & aCID, const char *aLo
|
|||
*/
|
||||
/* void init (in nsIComponentManager aCompMgr, in nsISupports aRegistry); */
|
||||
NS_IMETHODIMP urpComponentLoader::Init(nsIComponentManager *aCompMgr, nsISupports *aReg) {
|
||||
printf("--urpComponentLoader::Init \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::Init \n"));
|
||||
nsresult rv;
|
||||
mCompMgr = aCompMgr;
|
||||
mRegistry = do_QueryInterface(aReg, &rv);
|
||||
|
@ -111,7 +117,8 @@ NS_IMETHODIMP urpComponentLoader::Init(nsIComponentManager *aCompMgr, nsISupport
|
|||
*/
|
||||
/* void onRegister (in nsIIDRef aCID, in string aType, in string aClassName, in string aContractID, in string aLocation, in boolean aReplace, in boolean aPersist); */
|
||||
NS_IMETHODIMP urpComponentLoader::OnRegister(const nsIID & aCID, const char *aType, const char *aClassName, const char *aContractID, const char *aLocation, PRBool aReplace, PRBool aPersist) { //nb
|
||||
printf("--urpComponentLoader::OnRegister \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::OnRegister \n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -119,7 +126,8 @@ NS_IMETHODIMP urpComponentLoader::OnRegister(const nsIID & aCID, const char *aTy
|
|||
* AutoRegister components in the given directory.
|
||||
*/
|
||||
NS_IMETHODIMP urpComponentLoader::AutoRegisterComponents(PRInt32 aWhen, nsIFile *aDirectory) {
|
||||
printf("--urpComponentLoader::AutoRegisterComponents \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::AutoRegisterComponents \n"));
|
||||
return RegisterComponentsInDir(aWhen,aDirectory);
|
||||
}
|
||||
|
||||
|
@ -218,14 +226,15 @@ NS_IMETHODIMP urpComponentLoader::AutoRegisterComponent(PRInt32 when, nsIFile *c
|
|||
PL_strcasecmp(leafName + len - javaExtensionLen, javaExtension))
|
||||
return NS_OK;
|
||||
|
||||
printf("--urpComponentLoader: registering urpComponent component %s\n",(const char *)leafName);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader: registering urpComponent component %s\n",(const char *)leafName));
|
||||
rv = AttemptRegistration(component, PR_FALSE);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
printf("registered module %s\n", (const char *)leafName);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("registered module %s\n", (const char *)leafName));
|
||||
else if (rv == NS_ERROR_FACTORY_REGISTER_AGAIN)
|
||||
printf("deferred module %s\n", (const char *)leafName);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("deferred module %s\n", (const char *)leafName));
|
||||
else
|
||||
printf("failed to register %s\n", (const char *)leafName);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("failed to register %s\n", (const char *)leafName));
|
||||
*registered = (PRBool) NS_SUCCEEDED(rv);
|
||||
return NS_OK;
|
||||
|
||||
|
@ -248,7 +257,8 @@ nsresult urpComponentLoader::AttemptRegistration(nsIFile *component,
|
|||
in.getline(cidStr,1000);
|
||||
in.getline(contractid,1000);
|
||||
in.getline(desc,1000);
|
||||
printf("%s %s %s", cidStr, contractid, desc);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("%s %s %s", cidStr, contractid, desc));
|
||||
nsCID cid;
|
||||
cid.Parse((const char *)cidStr);
|
||||
mCompMgr->RegisterComponentWithType(cid, desc, contractid, component, registryLocation, PR_TRUE, PR_TRUE, urpComponentTypeName);
|
||||
|
@ -283,8 +293,9 @@ nsresult urpComponentLoader::SetRegistryInfo(const char *registryLocation,
|
|||
if (NS_FAILED(rv = component->GetFileSize(&fileSize)) ||
|
||||
NS_FAILED(rv = mRegistry->SetLongLong(key, fileSizeValueName, &fileSize)))
|
||||
return rv;
|
||||
printf("SetRegistryInfo(%s) => (%d,%d)\n", registryLocation,
|
||||
(int)modDate, (int)fileSize);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("SetRegistryInfo(%s) => (%d,%d)\n", registryLocation,
|
||||
(int)modDate, (int)fileSize));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -323,7 +334,8 @@ PRBool urpComponentLoader::HasChanged(const char *registryLocation, nsIFile *com
|
|||
*/
|
||||
/* boolean registerDeferredComponents (in long aWhen); */
|
||||
NS_IMETHODIMP urpComponentLoader::RegisterDeferredComponents(PRInt32 aWhen, PRBool *aRegistered) {
|
||||
printf("--urpComponentLoader::RegisterDeferredComponents \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::RegisterDeferredComponents \n"));
|
||||
nsresult rv;
|
||||
*aRegistered = PR_FALSE;
|
||||
PRUint32 count;
|
||||
|
@ -368,7 +380,8 @@ NS_IMETHODIMP urpComponentLoader::RegisterDeferredComponents(PRInt32 aWhen, PRBo
|
|||
*/
|
||||
/* void unloadAll (in long aWhen); */
|
||||
NS_IMETHODIMP urpComponentLoader::UnloadAll(PRInt32 aWhen) { //nb
|
||||
printf("--urpComponentLoader::UnloadAll \n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--urpComponentLoader::UnloadAll \n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -381,26 +394,27 @@ static NS_METHOD
|
|||
RegisterRemoteLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
||||
const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info)
|
||||
{
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsICategoryManager> catman =
|
||||
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
||||
printf("--URPLoader got registered\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("--URPLoader got registered\n"));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString previous;
|
||||
rv = catman->AddCategoryEntry("component-loader", urpComponentTypeName,
|
||||
URP_COMPONENTLOADER_ContractID,
|
||||
PR_TRUE, PR_TRUE, getter_Copies(previous));
|
||||
if(NS_FAILED(rv))
|
||||
printf("Adding of remote-comp-loader is failed\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("Adding of remote-comp-loader is failed\n"));
|
||||
else
|
||||
printf("Adding of remote-comp-loader is succeseded\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("Adding of remote-comp-loader is succeseded\n"));
|
||||
nsXPIDLCString urpLoader;
|
||||
rv = catman->GetCategoryEntry("component-loader", urpComponentTypeName,
|
||||
getter_Copies(urpLoader));
|
||||
if (NS_FAILED(rv))
|
||||
printf("didn't got category entry\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("didn't got category entry\n"));
|
||||
else
|
||||
printf("got category entry\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("got category entry\n"));
|
||||
|
||||
return rv;
|
||||
|
||||
|
@ -415,7 +429,8 @@ UnregisterRemoteLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
|||
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString urpLoader;
|
||||
printf("URP component loader is being unregistered\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("URP component loader is being unregistered\n"));
|
||||
rv = catman->GetCategoryEntry("component-loader", urpComponentTypeName,
|
||||
getter_Copies(urpLoader));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
|
|
@ -46,7 +46,7 @@ initImpl::initImpl() {
|
|||
(void**)&serverComponent);
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("Create instance failed in initImpl!!!");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
/*
|
||||
rv = nsComponentManager::CreateInstance("urpTest",
|
||||
|
@ -55,7 +55,7 @@ initImpl::initImpl() {
|
|||
(void**)&anComp);
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("Create instance failed in initImpl sec!!!");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
*/
|
||||
int l = 2000;
|
||||
|
|
|
@ -50,6 +50,7 @@ CPPSRCS = \
|
|||
LIBS = -L./ -L$(DIST)/bin/components/ $(XPCOM_LIBS) $(NSPR_LIBS) $(EXTRA_DSO_LIBS) \
|
||||
../urpStub.o \
|
||||
../urpMarshalToolkit.o \
|
||||
../urpLog.o \
|
||||
../urpManager.o \
|
||||
../transport/llTransport.o ../transport/urpPacket.o \
|
||||
../transport/urpTransport.o \
|
||||
|
@ -60,6 +61,7 @@ EXTRA_DSO_LDOPTS += \
|
|||
../transport/urpTransport.o \
|
||||
../urpStub.o \
|
||||
../urpMarshalToolkit.o \
|
||||
../urpLog.o \
|
||||
../urpManager.o \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ CPPSRCS = \
|
|||
LIBS = -L./ -L$(DIST)/bin/components/ $(XPCOM_LIBS) $(NSPR_LIBS) $(EXTRA_DSO_LIBS) \
|
||||
../../urpStub.o \
|
||||
../../urpMarshalToolkit.o \
|
||||
../../urpLog.o \
|
||||
../../urpManager.o \
|
||||
../../transport/llTransport.o ../../transport/urpPacket.o \
|
||||
../../transport/urpTransport.o \
|
||||
|
|
|
@ -85,7 +85,7 @@ nsIInterfaceInfo *interfaceInfo;
|
|||
PRStatus status = transport->Open(connectString);
|
||||
if(status != PR_SUCCESS) {
|
||||
printf("Error during opening connection\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
urpConnection* conn = transport->GetConnection();
|
||||
urpManager* man = new urpManager(PR_TRUE, nsnull, conn);
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sergey Lunegov <lsv@sparc.spb.su>
|
||||
*/
|
||||
|
||||
#include "urpLog.h"
|
||||
|
||||
PRLogModuleInfo * urpLog::log = NULL;
|
||||
|
||||
PRLogModuleInfo * urpLog::GetLog() {
|
||||
if (log == NULL) {
|
||||
log = PR_NewLogModule(LOG_MODULE);
|
||||
}
|
||||
return log;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sergey Lunegov <lsv@sparc.spb.su>
|
||||
*/
|
||||
|
||||
#include "prlog.h"
|
||||
|
||||
#define LOG_MODULE "starConnect"
|
||||
class urpLog {
|
||||
public:
|
||||
static PRLogModuleInfo *GetLog();
|
||||
private:
|
||||
static PRLogModuleInfo *log;
|
||||
};
|
|
@ -30,6 +30,7 @@
|
|||
#include <unistd.h>
|
||||
#include "urpStub.h"
|
||||
#include "urpMarshalToolkit.h"
|
||||
#include "urpLog.h"
|
||||
|
||||
|
||||
#include "nsIModule.h"
|
||||
|
@ -150,7 +151,7 @@ urpManager::urpManager(PRBool IsClient, bcIORB *orb, urpConnection* conn) {
|
|||
0);
|
||||
if(thr == nsnull) {
|
||||
printf("Error couldn't run listener\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
} else
|
||||
threadTable = new nsHashtable(20);
|
||||
|
@ -170,7 +171,8 @@ void urpManager::SendUrpRequest(bcOID oid, bcIID iid,
|
|||
bcICall *call,
|
||||
PRUint32 paramCount, const nsXPTMethodInfo* info,
|
||||
urpConnection* connection) {
|
||||
printf("this is method sendUrpRequest and mid is %x\n",methodIndex);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("this is method sendUrpRequest and mid is %x\n",methodIndex));
|
||||
long size = 0;
|
||||
long messagesCount = 0;
|
||||
urpPacket* message = new urpPacket();
|
||||
|
@ -225,11 +227,11 @@ void urpManager::SendUrpRequest(bcOID oid, bcIID iid,
|
|||
thrID = *(bcTID*)thr;
|
||||
else {
|
||||
printf("Error with threads in SendUrpRequest\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
} else
|
||||
thrID = (bcTID)PR_GetCurrentThread();
|
||||
printf("OID is written %ld %ld\n", oid, thrID);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("OID is written %ld %ld\n", oid, thrID));
|
||||
mt->WriteThreadID(thrID, message);
|
||||
broker = call->GetORB();
|
||||
mt->WriteParams(call, paramCount, info, interfaceInfo, message, methodIndex);
|
||||
|
@ -239,7 +241,8 @@ printf("OID is written %ld %ld\n", oid, thrID);
|
|||
}
|
||||
|
||||
void urpManager::TransformMethodIDAndIID() {
|
||||
printf("this is method transformMethodIDAndIID\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("this is method transformMethodIDAndIID\n"));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -249,7 +252,8 @@ urpManager::ReadReply(urpPacket* message, char header,
|
|||
nsIInterfaceInfo *interfaceInfo, PRUint16 methodIndex,
|
||||
urpConnection* conn) {
|
||||
nsresult rv = NS_OK;
|
||||
printf("this is method readReply\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("this is method readReply\n"));
|
||||
if(methodIndex != 1 && methodIndex != 2) {
|
||||
urpMarshalToolkit* mt = new urpMarshalToolkit(PR_TRUE);
|
||||
rv = mt->ReadParams(paramCount, info, message, interfaceInfo, methodIndex, call, broker, this, conn);
|
||||
|
@ -422,7 +426,7 @@ urpManager::ReadLongRequest(char header, urpPacket* message,
|
|||
if(clientTID) {
|
||||
if(thrID != tid) {
|
||||
printf("Error: threadIDs are not equal in ReadLongRequest\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
} else
|
||||
threadTable->Put(&thrHK, &tid);
|
||||
|
@ -430,7 +434,8 @@ urpManager::ReadLongRequest(char header, urpPacket* message,
|
|||
|
||||
urpMarshalToolkit* mt = new urpMarshalToolkit(PR_FALSE);
|
||||
|
||||
printf("method readLongRequest: tid %ld %ld\n",tid,oid);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("method readLongRequest: tid %ld %ld\n",tid,oid));
|
||||
char ignore_cache = ((header & IGNORECACHE) != 0); // do not use cache for this request?
|
||||
|
||||
char mustReply;
|
||||
|
@ -456,9 +461,11 @@ printf("method readLongRequest: tid %ld %ld\n",tid,oid);
|
|||
delete mt;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
/*
|
||||
char* name;
|
||||
interfaceInfo->GetName(&name);
|
||||
printf("in handleRequest interface name is %s\n",name);
|
||||
*/
|
||||
nsXPTMethodInfo* info;
|
||||
interfaceInfo->GetMethodInfo(methodId,(const nsXPTMethodInfo **)&info);
|
||||
PRUint32 paramCount = info->GetParamCount();
|
||||
|
@ -479,7 +486,8 @@ nsresult
|
|||
urpManager::SetCall(bcICall* call, PRMonitor *m, bcTID thrID) {
|
||||
monitCall* mc;
|
||||
// = new monitCall(m, call, nsnull, 0);
|
||||
printf("method SetCall %p %p %p %ld\n",call, m, this, thrID);
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("method SetCall %p %p %p %ld\n",call, m, this, thrID));
|
||||
threadHashKey thrHK(thrID);
|
||||
if(!(mc = (monitCall*)monitTable->Get(&thrHK))) {
|
||||
PR_INIT_CLIST((PRCList*)m);
|
||||
|
@ -493,7 +501,8 @@ printf("method SetCall %p %p %p %ld\n",call, m, this, thrID);
|
|||
|
||||
nsresult
|
||||
urpManager::RemoveCall(forReply* fR, bcTID thrID) {
|
||||
printf("method RemoveCall\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("method RemoveCall\n"));
|
||||
threadHashKey thrHK(thrID);
|
||||
monitCall* mc = (monitCall*)monitTable->Get(&thrHK);
|
||||
fR->mess= mc->mess;
|
||||
|
@ -505,7 +514,7 @@ printf("method RemoveCall\n");
|
|||
mc = (monitCall*)monitTable->Remove(&thrHK);
|
||||
delete mc;
|
||||
} else {
|
||||
printf("It is not error\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("It is not error\n"));
|
||||
}
|
||||
} else {
|
||||
fR->iid = mc->iid;
|
||||
|
@ -529,7 +538,7 @@ urpManager::GetThread() {
|
|||
thrID = *(bcTID*)thr;
|
||||
else {
|
||||
printf("Error with threads in SendUrpRequest\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
} else
|
||||
thrID = (bcTID)PR_GetCurrentThread();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "urpMarshalToolkit.h"
|
||||
#include <unistd.h>
|
||||
#include "urpStub.h"
|
||||
#include "urpLog.h"
|
||||
|
||||
|
||||
#include "nsIModule.h"
|
||||
|
@ -71,13 +72,14 @@ urpMarshalToolkit::WriteElement(bcIUnMarshaler *um, nsXPTParamInfo * param, uint
|
|||
void* data = allocator->Alloc(sizeof(void*));
|
||||
nsID *id;
|
||||
char* help;
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
nsresult r = NS_OK;
|
||||
switch(type) {
|
||||
case nsXPTType::T_IID :
|
||||
id = new nsID();
|
||||
um->ReadSimple(id,XPTType2bcXPType(type));
|
||||
help = ((nsID)(*id)).ToString();
|
||||
printf("nsIID %s\n", help);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("nsIID %s\n", help));
|
||||
message->WriteString(help, strlen(help));
|
||||
delete id;
|
||||
PR_Free(help);
|
||||
|
@ -542,9 +544,7 @@ urpMarshalToolkit::WriteType(bcIID iid, urpPacket* message) {
|
|||
cache_index = (short)0xffff;
|
||||
|
||||
message->WriteByte((char)typeClass | (found ? 0x0 : 0x80));
|
||||
printf("write type is %x\n",(char)typeClass | (found ? 0x0 : 0x80));
|
||||
message->WriteShort(cache_index);
|
||||
printf("write type is %x\n",cache_index);
|
||||
|
||||
if(!found) {
|
||||
char* iidStr = iid.ToString();
|
||||
|
@ -574,9 +574,10 @@ void
|
|||
urpMarshalToolkit::WriteOid(bcOID oid, urpPacket* message) {
|
||||
short cache_index;
|
||||
int found = 0;
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
|
||||
if(0) { // here should be checking on whether cache is used
|
||||
printf("cache is used\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("cache is used\n"));
|
||||
cache_index = 0x0;
|
||||
}
|
||||
else
|
||||
|
@ -613,8 +614,9 @@ urpMarshalToolkit::WriteThreadID(bcTID tid, urpPacket* message) {
|
|||
realTID[2] = (tid>>8) & 0xff;
|
||||
realTID[3] = tid & 0xff;
|
||||
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
if(0) { // here should be checking on whether cache is used
|
||||
printf("cache is used\n");
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("cache is used\n"));
|
||||
cache_index = 0x0;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "urpStub.h"
|
||||
|
||||
#include "urpManager.h"
|
||||
#include "urpLog.h"
|
||||
|
||||
|
||||
urpStub::urpStub(urpManager* man, urpConnection* conn) {
|
||||
|
@ -38,14 +39,16 @@ _mOwningThread = PR_CurrentThread();
|
|||
|
||||
|
||||
urpStub::~urpStub() {
|
||||
printf("destructor of urpStub\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("destructor of urpStub\n"));
|
||||
if(manager)
|
||||
delete manager;
|
||||
}
|
||||
|
||||
void urpStub::Dispatch(bcICall *call) {
|
||||
|
||||
printf("this is method Dispatch of urpStub\n");
|
||||
PRLogModuleInfo *log = urpLog::GetLog();
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("this is method Dispatch of urpStub\n"));
|
||||
bcIID iid; bcOID oid; bcMID mid;
|
||||
call->GetParams(&iid, &oid, &mid);
|
||||
nsIInterfaceInfo *interfaceInfo;
|
||||
|
@ -60,19 +63,18 @@ void urpStub::Dispatch(bcICall *call) {
|
|||
}
|
||||
char* name;
|
||||
interfaceInfo->GetName(&name);
|
||||
printf("real interface name is %s\n",name);
|
||||
PR_LOG(log, PR_LOG_DEBUG, ("real interface name is %s\n",name));
|
||||
|
||||
nsXPTMethodInfo* info;
|
||||
interfaceInfo->GetMethodInfo(mid, (const nsXPTMethodInfo **)&info);
|
||||
PRUint32 paramCount = info->GetParamCount();
|
||||
PRMonitor* mon = PR_NewMonitor();
|
||||
PR_EnterMonitor(mon);
|
||||
printf("ThreadID is written %d %p %p %p %p\n",paramCount, call, mon, manager, this);
|
||||
bcTID tid = manager->GetThread();
|
||||
nsresult rv = manager->SetCall(call, mon, tid);
|
||||
if(NS_FAILED(rv)) {
|
||||
printf("Error of SetCall in method Dispatch\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
manager->SendUrpRequest(oid, iid, mid, interfaceInfo, call, paramCount,
|
||||
info, connection);
|
||||
|
@ -81,7 +83,7 @@ printf("ThreadID is written %d %p %p %p %p\n",paramCount, call, mon, manager, th
|
|||
fR->request = 0;
|
||||
if(NS_FAILED(PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT))) {
|
||||
printf("Can't wait on cond var\n");
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
rv = manager->RemoveCall(fR, tid);
|
||||
if(fR->request)
|
||||
|
|
Загрузка…
Ссылка в новой задаче