libs-gsweb/GSWAdaptors/common/GSWApp.c

285 lines
7.9 KiB
C
Raw Normal View History

/* GSWApp.c - GSWeb: Adaptors: GSWApp & GSWAppInstance
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: March 2000
This file is part of the GNUstep Web Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <errno.h>
#include "config.h"
#include "GSWUtil.h"
#include "GSWDict.h"
#include "GSWString.h"
#include "GSWUtil.h"
#include "GSWApp.h"
void GSWApp_InternFreeNotValidInstances(GSWDictElem* p_pElem,void* p_pData);
void GSWApp_InternClearInstances(GSWDictElem* p_pElem,void* p_pData);
void GSWAppInstance_InternClear(GSWDictElem* p_pElem,void* p_pData);
//====================================================================
//--------------------------------------------------------------------
GSWApp* GSWApp_New()
{
GSWApp* pApp=(GSWApp*)calloc(1,sizeof(GSWApp));
memset(pApp,0,sizeof(GSWApp));
pApp->iUsageCounter++;
return pApp;
};
//--------------------------------------------------------------------
void GSWApp_Free(GSWApp* p_pApp)
{
if (!p_pApp)
GSWLog(GSW_CRITICAL,NULL,"No App to free");
else
{
p_pApp->iUsageCounter--;
if (p_pApp->iUsageCounter<0)
GSWLog(GSW_CRITICAL,NULL,"App seems to have been freed too much times");
if (p_pApp->iUsageCounter<=0)
{
if (p_pApp->pszName)
free(p_pApp->pszName);
if (p_pApp->pszGSWExtensionsFrameworkWebServerResources)
free(p_pApp->pszGSWExtensionsFrameworkWebServerResources);
2001-10-28 Manuel Guesdon <mguesdon@orange-concept.com> Compilation is OK but this version hasn't been tested * GSWeb.framework/GSWFileUpload.m: Added Traces corrected bug when uploading string type data. * GSWExtensionsGSW.framework/GSWFileUploadFormComponent.m: handle nil fileInfo retrieving, added isDeleteEnabled * GSWExtensionsGSW.framework/GSWFileUploadFormComponent.gswc/GSWFileUploadFormComponent.html/.gswd: added isDeleteEnabled condition * GSWAdaptors/commun/GSWConfig.c/.h: added adaptorTemplatesPath handle (per application and global) * GSWAdaptors/commun/GSWApp.h/.c: added pszAdaptorTemplatesPath * GSWAdaptors/commun/GSWHTTPResponse.c added parameter to GSWTemplate_* calls * GSWAdaptors/commun/GSWAppRequest.c added parameter to GSWTemplate_* calls * GSWAdaptors/commun/GSWTemplates.h/.c: added GSWApp* parameter o handle per application Templates * GSWeb.framework/GSWResourcesManager.m: traces * GSWeb.framework/GSWApplication.m: o change trace level from "low" to "application" o added filterLanguages: method * GSWeb.framework/GSWContext.m: added filterLanguages: call in _languages * GSWeb.framework/GSWAssociations.m: traces * GSWeb.framework/GSWSession.m: Added Traces * GSWeb.framework/GSWUtils.m: Added warning * GSWeb.framework/GSWRequest.m: Added Traces * GSWeb.framework/GSWWOCompatibility.h/.m: added WOImageButton * GSWeb.framework/GSWPopUpButton.m: Added Traces * GSWeb.framework/GSWResponse.m: fix stringByEscapingHTMLString: o stringByEscapingHTMLAttributeValue: o stringByConvertingToHTMLEntities: o stringByConvertingToHTML: * GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added EOF access type git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11266 72102866-910b-0410-8b05-ffd578937521
2001-10-28 10:29:17 +00:00
if (p_pApp->pszAdaptorTemplatesPath)
free(p_pApp->pszAdaptorTemplatesPath);
GSWDict_FreeElements(&p_pApp->stInstancesDict);
GSWDict_FreeElements(&p_pApp->stHeadersDict);
free(p_pApp);
};
};
};
//--------------------------------------------------------------------
void GSWApp_AddInstance(GSWApp* p_pApp,CONST char* p_pszInstanceNum,GSWAppInstance* p_pInstance)
{
if (!p_pApp)
{
GSWLog(GSW_CRITICAL,NULL,"No App to add instance");
}
else if (!p_pInstance)
{
GSWLog(GSW_CRITICAL,NULL,"No instance to add");
}
else
{
if (p_pInstance->pApp!=p_pApp)
{
GSWLog(GSW_CRITICAL,NULL,"Trying to add instance to another app");
if (p_pInstance->pApp)
p_pInstance->pApp->iUsageCounter--;
p_pInstance->pApp=p_pApp;
p_pInstance->pApp->iUsageCounter++;
};
GSWDict_Add(&p_pApp->stInstancesDict,p_pszInstanceNum,p_pInstance,FALSE);//NotOwner
};
};
//--------------------------------------------------------------------
void GSWApp_InternFreeNotValidInstances(GSWDictElem* p_pElem,void* p_pData)
{
GSWDict* pInstancesDict=(GSWDict*)p_pData;
GSWAppInstance* pInstance=(GSWAppInstance*)p_pElem->pValue;
if (!pInstance->fValid)
{
GSWDict_RemoveKey(pInstancesDict,p_pElem->pszKey);
if (GSWAppInstance_FreeIFND(pInstance))
pInstance=NULL;
};
};
//--------------------------------------------------------------------
void GSWApp_FreeNotValidInstances(GSWApp* p_pApp)
{
GSWDict_PerformForAllElem(&p_pApp->stInstancesDict,
GSWApp_InternFreeNotValidInstances,
&p_pApp->stInstancesDict);
};
//--------------------------------------------------------------------
void GSWApp_InternClearInstances(GSWDictElem* p_pElem,void* p_pData)
{
GSWApp* pApp=(GSWApp*)(p_pElem->pValue);
GSWDict_PerformForAllElem(&pApp->stInstancesDict,
GSWAppInstance_InternClear,
NULL);
};
//--------------------------------------------------------------------
void GSWApp_AppsClearInstances(GSWDict* p_pAppsDict)
{
GSWDict_PerformForAllElem(p_pAppsDict,
GSWApp_InternClearInstances,
NULL);
};
//====================================================================
//--------------------------------------------------------------------
GSWAppInstance* GSWAppInstance_New(GSWApp* p_pApp)
{
GSWAppInstance* pInstance=(GSWAppInstance*)calloc(1,sizeof(GSWAppInstance));
memset(pInstance,0,sizeof(GSWAppInstance));
if (!p_pApp)
GSWLog(GSW_CRITICAL,NULL,"Intance %p created without App",
pInstance);
pInstance->pApp=p_pApp;
return pInstance;
};
//--------------------------------------------------------------------
void GSWAppInstance_Free(GSWAppInstance* p_pInstance)
{
if (p_pInstance)
{
if (p_pInstance->pszHostName)
free(p_pInstance->pszHostName);
if (p_pInstance->pApp)
{
char szBuffer[128]="";
sprintf(szBuffer,"%d",p_pInstance->iInstance);
if (GSWDict_ValueForKey(&p_pInstance->pApp->stInstancesDict,szBuffer)==p_pInstance)
GSWDict_RemoveKey(&p_pInstance->pApp->stInstancesDict,szBuffer);
p_pInstance->pApp->iUsageCounter--;
};
free(p_pInstance);
};
};
//--------------------------------------------------------------------
BOOL GSWAppInstance_FreeIFND(GSWAppInstance* p_pInstance)
{
if (p_pInstance->uOpenedRequestsNb==0)
{
GSWAppInstance_Free(p_pInstance);
return TRUE;
}
else
return FALSE;
};
//--------------------------------------------------------------------
void GSWAppInstance_InternClear(GSWDictElem* p_pElem,void* p_pData)
{
GSWAppInstance* pInstance=(GSWAppInstance*)(p_pElem->pValue);
pInstance->fValid=FALSE;
};
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com> Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it) * GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo * GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes * GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find* * GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter, o management of AppInfo * GSWAdaptors/common/GSWAppRequest.c: managing refused connections * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes * GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation o -awake added * GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions * GSWeb.framework/GSWBundle.m: debug traces commented * GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext: * GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?) * GSWeb.framework/GSWComponentRequestHandler.m: comments added * GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces * GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction * GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex, o correct misspelled names, o added -description, o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:, o changes in -deleteObjectAtIndex:, * GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount, handle bug in omniweb-browser * GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call * GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call * GSWeb.framework/GSWPopUpButton.m: o use [response_ appendContentString:_noSelectionStringValue] instead of [response_ appendContentHTMLString:_noSelectionStringValue] o handle no displayString case o use [response_ appendContentString:_displayStringValue] instead of [response_ appendContentHTMLString:_displayStringValue] * GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO * GSWeb.framework/GSWElementIDString.m: comment some debug traces * GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType * GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace * GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class]) instead of [retValue class] for log * GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers; o added test on _contentType in _contentType o autorelease _dict in -uriElements * GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers o Added GSWResponse (GSWResponseRefused) o return self in -generateResponse * GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo) o added refusing session management * GSWeb.framework/GSWSession.m: o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it * GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts; by NSMutableArray* sessionOrderedTimeOuts; o added traces o added GSWSessionTimeOutManager (GSWSessionRefused) * GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned * GSWeb.framework/GSWTemplateParser.m: added doctype management * GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__ * GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink * GSWeb.framework/attach.m: added if defined for __NetBSD__ * GSWeb.framework/stacktrace.m: added if defined for __NetBSD__ * GSWeb.framework/GSWTemplateParserXML.m: traces commented o test XML node content before adding it * GSWeb.framework/NSObject+IVarAccess+PerformSel.m o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters) * GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse() o debug traces removed git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
//--------------------------------------------------------------------
//--------------------------------------------------------------------
void GSWAppInfo_Init()
{
if (_gswAppInfoDict == NULL) {
_gswAppInfoDict = GSWDict_New(50); // allows 50 different instances of apps
}
}
//--------------------------------------------------------------------
char* GSWAppInfo_MakeDictKeyName(char* pszName, int iInstance)
{
char *name = NULL;
if (name = calloc(1,50)) {
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com> Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it) * GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo * GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes * GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find* * GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter, o management of AppInfo * GSWAdaptors/common/GSWAppRequest.c: managing refused connections * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes * GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation o -awake added * GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions * GSWeb.framework/GSWBundle.m: debug traces commented * GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext: * GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?) * GSWeb.framework/GSWComponentRequestHandler.m: comments added * GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces * GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction * GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex, o correct misspelled names, o added -description, o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:, o changes in -deleteObjectAtIndex:, * GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount, handle bug in omniweb-browser * GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call * GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call * GSWeb.framework/GSWPopUpButton.m: o use [response_ appendContentString:_noSelectionStringValue] instead of [response_ appendContentHTMLString:_noSelectionStringValue] o handle no displayString case o use [response_ appendContentString:_displayStringValue] instead of [response_ appendContentHTMLString:_displayStringValue] * GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO * GSWeb.framework/GSWElementIDString.m: comment some debug traces * GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType * GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace * GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class]) instead of [retValue class] for log * GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers; o added test on _contentType in _contentType o autorelease _dict in -uriElements * GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers o Added GSWResponse (GSWResponseRefused) o return self in -generateResponse * GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo) o added refusing session management * GSWeb.framework/GSWSession.m: o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it * GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts; by NSMutableArray* sessionOrderedTimeOuts; o added traces o added GSWSessionTimeOutManager (GSWSessionRefused) * GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned * GSWeb.framework/GSWTemplateParser.m: added doctype management * GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__ * GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink * GSWeb.framework/attach.m: added if defined for __NetBSD__ * GSWeb.framework/stacktrace.m: added if defined for __NetBSD__ * GSWeb.framework/GSWTemplateParserXML.m: traces commented o test XML node content before adding it * GSWeb.framework/NSObject+IVarAccess+PerformSel.m o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters) * GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse() o debug traces removed git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
if (pszName) {
strncpy(name, pszName,45);
name[45]=0;
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com> Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it) * GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo * GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes * GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find* * GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter, o management of AppInfo * GSWAdaptors/common/GSWAppRequest.c: managing refused connections * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction * GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes * GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation o -awake added * GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions * GSWeb.framework/GSWBundle.m: debug traces commented * GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext: * GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?) * GSWeb.framework/GSWComponentRequestHandler.m: comments added * GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces * GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction * GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex, o correct misspelled names, o added -description, o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:, o changes in -deleteObjectAtIndex:, * GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount, handle bug in omniweb-browser * GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call * GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call * GSWeb.framework/GSWPopUpButton.m: o use [response_ appendContentString:_noSelectionStringValue] instead of [response_ appendContentHTMLString:_noSelectionStringValue] o handle no displayString case o use [response_ appendContentString:_displayStringValue] instead of [response_ appendContentHTMLString:_displayStringValue] * GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO * GSWeb.framework/GSWElementIDString.m: comment some debug traces * GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType * GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace * GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class]) instead of [retValue class] for log * GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers; o added test on _contentType in _contentType o autorelease _dict in -uriElements * GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers o Added GSWResponse (GSWResponseRefused) o return self in -generateResponse * GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo) o added refusing session management * GSWeb.framework/GSWSession.m: o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it * GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts; by NSMutableArray* sessionOrderedTimeOuts; o added traces o added GSWSessionTimeOutManager (GSWSessionRefused) * GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned * GSWeb.framework/GSWTemplateParser.m: added doctype management * GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__ * GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink * GSWeb.framework/attach.m: added if defined for __NetBSD__ * GSWeb.framework/stacktrace.m: added if defined for __NetBSD__ * GSWeb.framework/GSWTemplateParserXML.m: traces commented o test XML node content before adding it * GSWeb.framework/NSObject+IVarAccess+PerformSel.m o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters) * GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse() o debug traces removed git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
}
sprintf(name + strlen(name), "%d", iInstance);
}
return name;
}
//--------------------------------------------------------------------
GSWAppInfo* GSWAppInfo_Find(char* pszName, int iInstance)
{
char *name;
GSWAppInfo* newInfo = NULL;
if (_gswAppInfoDict == NULL) {
GSWAppInfo_Init();
return NULL;
}
name = GSWAppInfo_MakeDictKeyName(pszName, iInstance);
if (name) {
newInfo = GSWDict_ValueForKey(_gswAppInfoDict, name);
free(name); name = NULL;
}
return newInfo;
}
//--------------------------------------------------------------------
void GSWAppInfo_Add(GSWAppInfo* appInfoDict, CONST char* keyName)
{
if (appInfoDict) {
GSWDict_Add(_gswAppInfoDict, keyName, appInfoDict, TRUE);
}
}
//--------------------------------------------------------------------
void GSWAppInfo_Set(char* pszName, int iInstance, BOOL isRefused)
{
char *name;
GSWAppInfo* newInfo = GSWAppInfo_Find(pszName, iInstance);
time_t curTime = (time_t)0;
BOOL addDict = FALSE;
if (newInfo == NULL) {
newInfo=(GSWAppInfo*)calloc(1,sizeof(GSWAppInfo));
addDict = TRUE;
}
if (newInfo && (name = GSWAppInfo_MakeDictKeyName(pszName, iInstance) )) {
newInfo->isRefused = isRefused;
time(&curTime);
newInfo->timeNextRetryTime = curTime + 10; // + 10 sec
if (addDict == TRUE) {
GSWAppInfo_Add(newInfo, name);
}
free(name); name = NULL;
} else {
if (newInfo) {
free(newInfo); newInfo = NULL;
}
}
}
//--------------------------------------------------------------------
void GSWAppInfo_Remove(GSWAppInfo* _appInfo)
{
}