2000-01-22 12:49:49 +00:00
|
|
|
/* GSWURLUtil.c - GSWeb: Adaptors: URL Utils
|
2003-02-28 18:37:43 +00:00
|
|
|
Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
2003-02-28 18:37:43 +00:00
|
|
|
Date: July 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
//<PREFIX>/<APPLICATION-NAME>[ApplicationSuffix[/<APPLICATION-NUMBER>][/<REQUEST-HANDLER-KEY>[/<REQUEST-HANDLER-PATH>]]][?<QUERY-STRING>]
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "GSWUtil.h"
|
|
|
|
#include "GSWDict.h"
|
2000-03-16 16:16:49 +00:00
|
|
|
#include "GSWString.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
#include "GSWConfig.h"
|
|
|
|
#include "GSWURLUtil.h"
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWURLError
|
|
|
|
GSWParseURL(GSWURLComponents *p_pURLComponents,
|
|
|
|
CONST char *p_pszURL,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
GSWURLError eError=GSWURLError_OK;
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWURLComponent *pURLCPrefix=&p_pURLComponents->stPrefix;
|
|
|
|
GSWURLComponent *pURLCVersion=&p_pURLComponents->stVersion;
|
|
|
|
GSWURLComponent *pURLCAppName=&p_pURLComponents->stAppName;
|
|
|
|
GSWURLComponent *pURLCAppNum=&p_pURLComponents->stAppNumber;
|
|
|
|
GSWURLComponent *pURLCReqHandlerKey=&p_pURLComponents->stRequestHandlerKey;
|
|
|
|
GSWURLComponent *pURLCReqHandlerPath=&p_pURLComponents->stRequestHandlerPath;
|
|
|
|
GSWURLComponent *pURLCQueryString=&p_pURLComponents->stQueryString;
|
2000-01-22 12:49:49 +00:00
|
|
|
int iURLLen=p_pszURL ? strlen(p_pszURL) : 0;
|
2003-02-28 18:37:43 +00:00
|
|
|
CONST char *pszStart=pszStart = (p_pszURL ? p_pszURL : "");
|
2000-01-22 12:49:49 +00:00
|
|
|
CONST char *pszStop=NULL;
|
|
|
|
CONST char *pszNext=NULL;
|
2003-02-28 18:37:43 +00:00
|
|
|
CONST char *pszPrefix=NULL;
|
2000-01-22 12:49:49 +00:00
|
|
|
CONST char *pszS=NULL;
|
2003-02-28 18:37:43 +00:00
|
|
|
CONST char *pszURLEnd=p_pszURL+iURLLen;
|
|
|
|
CONST char *pszQueryStringMark=strchr(pszStart,'?');
|
|
|
|
CONST char *pszTmpStop=(pszQueryStringMark && pszQueryStringMark<pszURLEnd) ?
|
|
|
|
pszQueryStringMark : pszURLEnd;
|
2000-01-22 12:49:49 +00:00
|
|
|
memset(p_pURLComponents,0,sizeof(GSWURLComponents));
|
|
|
|
|
|
|
|
// First, get URL prefix
|
|
|
|
pszPrefix=strcasestr(pszStart,g_szGSWeb_Prefix);
|
|
|
|
if (pszPrefix && pszQueryStringMark && pszQueryStringMark<=pszPrefix)
|
2003-02-28 18:37:43 +00:00
|
|
|
pszPrefix=NULL;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
if (pszPrefix)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
CONST char *pszAppExtension=NULL;
|
|
|
|
CONST char *pszfoundExtension=NULL;
|
|
|
|
pszStop=pszPrefix+strlen(g_szGSWeb_Prefix);
|
|
|
|
pszNext=*pszStop ? pszStop+1 : pszStop; // Drop the trailing /
|
|
|
|
pURLCPrefix->pszStart = pszPrefix;
|
|
|
|
pURLCPrefix->iLength = pszStop-pszStart;
|
|
|
|
pURLCPrefix->iLength = max(pURLCPrefix->iLength,0);
|
|
|
|
pURLCVersion->pszStart = g_szGSWeb_AdaptorVersion;
|
|
|
|
pURLCVersion->iLength = strlen(g_szGSWeb_AdaptorVersion);
|
|
|
|
|
|
|
|
// Get Application Name
|
|
|
|
pszStart=pszNext;
|
|
|
|
pszAppExtension=strcasestr(pszStart,
|
|
|
|
g_szGSWeb_AppExtention[GSWNAMES_INDEX]);
|
|
|
|
if (pszAppExtension)
|
|
|
|
pszfoundExtension=g_szGSWeb_AppExtention[GSWNAMES_INDEX];
|
|
|
|
else
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
pszAppExtension=strcasestr(pszStart,
|
|
|
|
g_szGSWeb_AppExtention[WONAMES_INDEX]);
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pszAppExtension)
|
2003-02-28 18:37:43 +00:00
|
|
|
pszfoundExtension=g_szGSWeb_AppExtention[WONAMES_INDEX];
|
|
|
|
};
|
|
|
|
if (pszAppExtension)
|
|
|
|
{
|
|
|
|
if (pszQueryStringMark && pszQueryStringMark<=pszAppExtension)
|
|
|
|
{
|
|
|
|
pszAppExtension=NULL;
|
|
|
|
pszStop=pszURLEnd;
|
|
|
|
pszNext=pszStop;
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
pszStop=pszAppExtension;
|
|
|
|
pszNext=pszStop+strlen(pszfoundExtension);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pszStop=strchr(pszStart,'/');
|
|
|
|
if (pszStop && pszQueryStringMark && pszQueryStringMark<=pszStop)
|
|
|
|
pszStop=pszQueryStringMark-1;
|
|
|
|
if (pszStop)
|
|
|
|
pszNext=pszStop+1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pszStop=pszTmpStop;
|
|
|
|
pszNext=NULL;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
pURLCAppName->pszStart = pszStart;
|
|
|
|
pURLCAppName->iLength = pszStop-pszStart;
|
|
|
|
pURLCAppName->iLength = max(pURLCAppName->iLength,0);
|
|
|
|
// Drop trailing slashes
|
|
|
|
while(pURLCAppName->iLength &&
|
|
|
|
pURLCAppName->pszStart[pURLCAppName->iLength-1]== '/')
|
|
|
|
pURLCAppName->iLength--;
|
|
|
|
pURLCAppName->iLength = max(pURLCAppName->iLength,0);
|
|
|
|
|
|
|
|
// Get Instance Number
|
|
|
|
pszStart = pszNext;
|
|
|
|
if (!pszStart)
|
|
|
|
{
|
|
|
|
pURLCAppNum->pszStart="";
|
|
|
|
pURLCAppNum->iLength=0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Skip slashes
|
|
|
|
while(*pszStart=='/')
|
|
|
|
pszStart++;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-02-28 18:37:43 +00:00
|
|
|
// Find
|
|
|
|
for (pszS=pszStart;pszS<pszTmpStop && *pszS!='/';pszS++);
|
|
|
|
pszStop= pszS;
|
|
|
|
pszNext=(pszStop<pszTmpStop) ? pszStop+1 : pszStop;
|
|
|
|
pURLCAppNum->pszStart = pszStart;
|
|
|
|
pURLCAppNum->iLength = pszStop-pszStart;
|
|
|
|
pURLCAppNum->iLength = max(pURLCAppNum->iLength,0);
|
|
|
|
|
|
|
|
// -1 case ?
|
|
|
|
if (!(pURLCAppNum->iLength==2
|
|
|
|
&& pURLCAppNum->pszStart[0]=='-'
|
|
|
|
&& pURLCAppNum->pszStart[1]=='1'))
|
|
|
|
{
|
|
|
|
// Test if alldigits
|
|
|
|
for (pszS=pszStart;pszS<pszStop && isdigit(*pszS);pszS++);
|
|
|
|
|
|
|
|
if (pszS!=pszStop)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
// not all digits, so it's the request handler key !
|
|
|
|
pURLCReqHandlerKey->pszStart = pURLCAppNum->pszStart;
|
|
|
|
pURLCReqHandlerKey->iLength = pURLCAppNum->iLength;
|
|
|
|
pURLCReqHandlerKey->iLength =
|
|
|
|
max(pURLCReqHandlerKey->iLength,0);
|
2000-01-22 12:49:49 +00:00
|
|
|
pURLCAppNum->pszStart="";
|
|
|
|
pURLCAppNum->iLength=0;
|
|
|
|
}
|
2003-02-28 18:37:43 +00:00
|
|
|
else
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
pszStart=pszNext;
|
2000-01-22 12:49:49 +00:00
|
|
|
// Skip slashes
|
|
|
|
while(*pszStart=='/')
|
2003-02-28 18:37:43 +00:00
|
|
|
pszStart++;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-02-28 18:37:43 +00:00
|
|
|
for (pszS=pszStart;pszS<pszTmpStop && *pszS!='/';pszS++);
|
2000-01-22 12:49:49 +00:00
|
|
|
pszStop = pszS;
|
2003-02-28 18:37:43 +00:00
|
|
|
pURLCReqHandlerKey->pszStart = pszStart;
|
|
|
|
pURLCReqHandlerKey->iLength = pszStop-pszStart;
|
|
|
|
pURLCReqHandlerKey->iLength =
|
|
|
|
max(pURLCReqHandlerKey->iLength,0);
|
2000-01-22 12:49:49 +00:00
|
|
|
pszNext=(pszStop<pszTmpStop) ? pszStop+1 : pszStop;
|
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
|
|
|
// Get Request Handler Path
|
|
|
|
pszStart = pszNext;
|
|
|
|
for (pszS=pszStart;pszS<pszTmpStop;pszS++);
|
|
|
|
pszStop = pszS;
|
|
|
|
pURLCReqHandlerPath->pszStart = pszStart;
|
|
|
|
pURLCReqHandlerPath->iLength = pszStop-pszStart;
|
|
|
|
pURLCReqHandlerPath->iLength = max(pURLCReqHandlerPath->iLength,0);
|
|
|
|
pszNext=(pszStop<pszTmpStop) ? pszStop+1 : pszStop;
|
|
|
|
pszStart=pszNext;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
// Query String
|
|
|
|
if (!pszStart)
|
|
|
|
pszStart=pszTmpStop;
|
|
|
|
pURLCQueryString->pszStart = pszStart;
|
|
|
|
pURLCQueryString->iLength = pszURLEnd - pszStart;
|
|
|
|
pURLCQueryString->iLength = max(pURLCQueryString->iLength,0);
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
if (!pURLCPrefix->pszStart || pURLCPrefix->iLength<=0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
eError=GSWURLError_InvalidPrefix;
|
2006-12-19 22:41:28 +00:00
|
|
|
GSWLog(__FILE__, __LINE__, GSW_ERROR,p_pLogServerData,"ParseURL GSWURLError_InvalidPrefix");
|
2003-02-28 18:37:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,
|
|
|
|
"pURLCPrefix=%.*s",
|
|
|
|
pURLCPrefix->iLength,pURLCPrefix->pszStart);
|
2003-02-28 18:37:43 +00:00
|
|
|
if (!pURLCAppName->pszStart || pURLCAppName->iLength<=0)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
eError=GSWURLError_InvalidAppName;
|
2006-12-19 22:41:28 +00:00
|
|
|
GSWLog(__FILE__, __LINE__, GSW_ERROR,p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"ParseURL GSWURLError_InvalidAppName");
|
2000-01-22 12:49:49 +00:00
|
|
|
}
|
2003-02-28 18:37:43 +00:00
|
|
|
else
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"pURLCAppName=%.*s",
|
|
|
|
pURLCAppName->iLength,pURLCAppName->pszStart);
|
|
|
|
if (!pURLCAppNum->pszStart)
|
|
|
|
{
|
|
|
|
eError=GSWURLError_InvalidAppNumber;
|
2006-12-19 22:41:28 +00:00
|
|
|
GSWLog(__FILE__, __LINE__, GSW_ERROR,p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"ParseURL GSWURLError_InvalidAppNumber");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"pURLCAppNum=%.*s",
|
|
|
|
pURLCAppNum->iLength,pURLCAppNum->pszStart);
|
|
|
|
if ((!pURLCReqHandlerKey->pszStart ||
|
|
|
|
pURLCReqHandlerKey->iLength<=0)
|
|
|
|
&& pURLCReqHandlerPath->iLength>0)
|
2000-03-16 16:16:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
eError=GSWURLError_InvalidRequestHandlerKey;
|
2006-12-19 22:41:28 +00:00
|
|
|
GSWLog(__FILE__, __LINE__, GSW_ERROR,p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"ParseURL GSWURLError_InvalidRequestHandlerKey");
|
2000-03-16 16:16:49 +00:00
|
|
|
}
|
2003-02-28 18:37:43 +00:00
|
|
|
else
|
2000-03-16 16:16:49 +00:00
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,
|
2003-02-28 18:37:43 +00:00
|
|
|
"pURLCReqHandlerPath=%.*s",
|
|
|
|
pURLCReqHandlerPath->iLength,
|
|
|
|
pURLCReqHandlerPath->pszStart);
|
|
|
|
/*
|
|
|
|
if (!pURLCReqHandlerPath->pszStart ||
|
|
|
|
pURLCReqHandlerPath->iLength<=0)
|
|
|
|
eError=GSWURLError_InvalidRequestHandlerPath;
|
|
|
|
else if (!pURLCQueryString->pszStart ||
|
|
|
|
pURLCQueryString->iLength<=0)
|
|
|
|
eError=GSWURLError_InvalidQueryString;
|
|
|
|
*/
|
2000-03-16 16:16:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2000-03-16 16:16:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,"End ParseURL eError=%d",eError);
|
2000-01-22 12:49:49 +00:00
|
|
|
return eError;
|
|
|
|
};
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
void
|
|
|
|
GSWComposeURL(char *p_pszURL,
|
|
|
|
GSWURLComponents *p_pURLComponents,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWURLComponent *pURLCPrefix=&p_pURLComponents->stPrefix;
|
|
|
|
GSWURLComponent *pURLCAppName=&p_pURLComponents->stAppName;
|
|
|
|
GSWURLComponent *pURLCAppNum=&p_pURLComponents->stAppNumber;
|
|
|
|
GSWURLComponent *pURLCReqHandlerKey=&p_pURLComponents->stRequestHandlerKey;
|
|
|
|
GSWURLComponent *pURLCReqHandlerPath=&p_pURLComponents->stRequestHandlerPath;
|
|
|
|
GSWURLComponent *pURLCQueryString=&p_pURLComponents->stQueryString;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
strncpy(p_pszURL,pURLCPrefix->pszStart, pURLCPrefix->iLength);
|
|
|
|
p_pszURL+=pURLCPrefix->iLength;
|
|
|
|
|
|
|
|
*p_pszURL++='/';
|
|
|
|
strncpy(p_pszURL, pURLCAppName->pszStart, pURLCAppName->iLength);
|
|
|
|
p_pszURL+= pURLCAppName->iLength;
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
strcpy(p_pszURL,g_szGSWeb_AppExtention[GSWNAMES_INDEX]);
|
|
|
|
p_pszURL+=strlen(g_szGSWeb_AppExtention[GSWNAMES_INDEX]);
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
if (pURLCAppNum->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
*p_pszURL++='/';
|
|
|
|
strncpy(p_pszURL,pURLCAppNum->pszStart,pURLCAppNum->iLength);
|
|
|
|
p_pszURL+= pURLCAppNum->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (pURLCReqHandlerKey->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
*p_pszURL++='/';
|
|
|
|
strncpy(p_pszURL, pURLCReqHandlerKey->pszStart,
|
|
|
|
pURLCReqHandlerKey->iLength);
|
|
|
|
p_pszURL+= pURLCReqHandlerKey->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (pURLCReqHandlerPath->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
2000-01-22 12:49:49 +00:00
|
|
|
*p_pszURL++='/';
|
2003-02-28 18:37:43 +00:00
|
|
|
strncpy(p_pszURL, pURLCReqHandlerPath->pszStart,
|
|
|
|
pURLCReqHandlerPath->iLength);
|
2000-01-22 12:49:49 +00:00
|
|
|
p_pszURL+= pURLCReqHandlerPath->iLength;
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
if (pURLCQueryString->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
2000-01-22 12:49:49 +00:00
|
|
|
*p_pszURL++='?';
|
2003-02-28 18:37:43 +00:00
|
|
|
strncpy(p_pszURL,pURLCQueryString->pszStart,
|
|
|
|
pURLCQueryString->iLength);
|
2000-01-22 12:49:49 +00:00
|
|
|
p_pszURL+= pURLCQueryString->iLength;
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
*p_pszURL=0;
|
|
|
|
};
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
int
|
|
|
|
GSWComposeURLLen(GSWURLComponents *p_pURLComponents,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
int iLength=0;
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWURLComponent *pURLCPrefix=&p_pURLComponents->stPrefix;
|
|
|
|
GSWURLComponent *pURLCAppName=&p_pURLComponents->stAppName;
|
|
|
|
GSWURLComponent *pURLCAppNum=&p_pURLComponents->stAppNumber;
|
|
|
|
GSWURLComponent *pURLCReqHandlerKey=&p_pURLComponents->stRequestHandlerKey;
|
|
|
|
GSWURLComponent *pURLCReqHandlerPath=&p_pURLComponents->stRequestHandlerPath;
|
|
|
|
GSWURLComponent *pURLCQueryString=&p_pURLComponents->stQueryString;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
iLength+=pURLCPrefix->iLength;
|
|
|
|
iLength+=1+pURLCAppName->iLength;
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
iLength+=strlen(g_szGSWeb_AppExtention[GSWNAMES_INDEX]);
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pURLCAppNum->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
iLength+= 1+pURLCAppNum->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pURLCReqHandlerKey->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
iLength+=1+pURLCReqHandlerKey->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pURLCReqHandlerPath->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
iLength+= 1+pURLCReqHandlerPath->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pURLCQueryString->iLength>0)
|
2003-02-28 18:37:43 +00:00
|
|
|
iLength+=1+pURLCQueryString->iLength;
|
2000-01-22 12:49:49 +00:00
|
|
|
return iLength;
|
|
|
|
};
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
CONST char *szGSWURLErrorMessage[]=
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
"", //GSWURLError_OK
|
|
|
|
"Invalid prefix in URL", //GSWURLError_InvalidPrefix
|
|
|
|
"Invalid version in URL", //GSWURLError_InvalidVersion
|
|
|
|
"Invalid application name", //GSWURLError_InvalidAppName
|
|
|
|
"Invalid application number in URL", //GSWURLError_InvalidAppNumber,
|
|
|
|
"Invalid request handler key in URL", //GSWURLError_InvalidRequestHandlerKey,
|
|
|
|
"Invalid request handler path in URL",//GSWURLError_InvalidRequestHandlerPath,
|
|
|
|
"Invalid application host name in URL",//GSWURLError_InvalidAppHost,
|
|
|
|
"Invalid page name in URL", //GSWURLError_InvalidPageName,
|
|
|
|
"Invalid session ID in URL", //GSWURLError_InvalidSessionID,
|
|
|
|
"Invalid context ID in URL", //GSWURLError_InvalidContextID,
|
|
|
|
"Invalid sender ID in URL", //GSWURLError_InvalidSenderID,
|
|
|
|
"Invalid query string in URL", //GSWURLError_InvalidQueryString,
|
|
|
|
"Invalid suffix in URL" //GSWURLError_InvalidSuffix
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2003-02-28 18:37:43 +00:00
|
|
|
CONST char *
|
|
|
|
GSWURLErrorMessage(GSWURLError p_eError,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
if (p_eError>=0 &&
|
|
|
|
p_eError<sizeof(szGSWURLErrorMessage)/sizeof(szGSWURLErrorMessage[0]))
|
|
|
|
return szGSWURLErrorMessage[p_eError];
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2003-02-28 18:37:43 +00:00
|
|
|
return "";
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|