Merge of rev. 109.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@110 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2006-12-23 22:44:01 +00:00
parent 62a5d7c5ef
commit 03400550cd
8 changed files with 36 additions and 30 deletions

View File

@ -1,3 +1,8 @@
2006-12-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Finished const-ifications as suggested by Erik Johansson in
SF Patch tracker [ 1587272 ].
2006-12-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Erik Johansson's patch for const-ified ixml

View File

@ -3712,7 +3712,7 @@ FreeHandle( int Upnp_Handle )
} /****************** End of FreeHandle *********************/
// **DBG****************************************************
DBGONLY(
//DBGONLY(
/**************************************************************************
* Function: PrintHandleInfo
@ -3753,7 +3753,7 @@ DBGONLY(
IXML_NodeList * NodeList1;
IXML_Node * ChildNode1;
unsigned short NodeType;
DOMString NodeValue;
const DOMString NodeValue;
const DOMString NodeName;
NodeList1 = ixmlNode_getChildNodes( tmpRoot );
for( i = 0; i < 100; i++ ) {
@ -3774,7 +3774,7 @@ DBGONLY(
}
/****************** End of printNodes *********************/
) // dbgonly
// ) // dbgonly
//********************************************************
//* Name: getlocalhostname

View File

@ -125,7 +125,7 @@ is_unreserved( char in )
* Note :
************************************************************************/
int
is_escaped( char *in )
is_escaped( const char *in )
{
if( ( in[0] == '%' ) && ( isxdigit( in[1] ) ) && isxdigit( in[2] ) ) {
@ -204,7 +204,7 @@ replace_escaped( char *in,
* Note :
************************************************************************/
int
parse_uric( char *in,
parse_uric( const char *in,
int max,
token * out )
{
@ -496,12 +496,12 @@ token_cmp( token * in1,
************************************************************************/
int
parse_port( int max,
char *port,
const char *port,
unsigned short *out )
{
char *finger = port;
char *max_ptr = finger + max;
const char *finger = port;
const char *max_ptr = finger + max;
unsigned short temp = 0;
while( ( finger < max_ptr ) && ( isdigit( *finger ) ) ) {
@ -533,7 +533,7 @@ parse_port( int max,
* Note :
************************************************************************/
int
parse_hostport( char *in,
parse_hostport( const char *in,
int max,
hostport_type * out )
{
@ -681,7 +681,7 @@ parse_hostport( char *in,
* Note :
************************************************************************/
int
parse_scheme( char *in,
parse_scheme( const char *in,
int max,
token * out )
{
@ -994,7 +994,7 @@ resolve_rel_url( char *base_url,
* Note :
************************************************************************/
int
parse_uri( char *in,
parse_uri( const char *in,
int max,
uri_type * out )
{
@ -1074,8 +1074,8 @@ parse_uri_and_unescape( char *in,
if( ( ret = parse_uri( in, max, out ) ) != HTTP_SUCCESS )
return ret;
if( out->pathquery.size > 0 )
remove_escaped_chars( out->pathquery.buff, &out->pathquery.size );
remove_escaped_chars( (char *)out->pathquery.buff, &out->pathquery.size );
if( out->fragment.size > 0 )
remove_escaped_chars( out->fragment.buff, &out->fragment.size );
remove_escaped_chars( (char *)out->fragment.buff, &out->fragment.size );
return HTTP_SUCCESS;
}

View File

@ -398,7 +398,7 @@ FindServiceEventURLPath( service_table * table,
************************************************************************/
service_info *
FindServiceControlURLPath( service_table * table,
char *controlURLPath )
const char *controlURLPath )
{
service_info *finger = NULL;
uri_type parsed_url;

View File

@ -246,7 +246,7 @@ service_info * FindServiceEventURLPath( service_table *table,
* Note :
************************************************************************/
service_info * FindServiceControlURLPath( service_table *table,
char * controlURLPath);
const char * controlURLPath);
/************************************************************************
* Function : printService

View File

@ -86,7 +86,7 @@ enum uriType { absolute, relative };
/* Buffer used in parsinghttp messages, urls, etc. generally this simply
* holds a pointer into a larger array */
typedef struct TOKEN {
char * buff;
const char *buff;
int size;
} token;
@ -276,7 +276,7 @@ int token_cmp( token *in1, token *in2);
*
* Note :
************************************************************************/
int parse_port(int max, char * port, unsigned short int * out);
int parse_port(int max, const char *port, unsigned short int *out);
/************************************************************************
* Function : parse_hostport
@ -296,7 +296,7 @@ int parse_port(int max, char * port, unsigned short int * out);
*
* Note :
************************************************************************/
int parse_hostport( char* in, int max, hostport_type *out );
int parse_hostport(const char *in, int max, hostport_type *out );
/************************************************************************
* Function : remove_escaped_chars
@ -391,7 +391,7 @@ char * resolve_rel_url( char * base_url, char * rel_url);
*
* Note :
************************************************************************/
int parse_uri( char * in, int max, uri_type * out);
int parse_uri(const char * in, int max, uri_type * out);
/************************************************************************
* Function : parse_uri_and_unescape

View File

@ -246,18 +246,19 @@ get_node_value( IN IXML_Node * node )
****************************************************************************/
static XINLINE int
get_host_and_path( IN char *ctrl_url,
OUT memptr * host,
OUT memptr * path,
OUT const memptr *host,
OUT const memptr *path,
OUT uri_type * url )
{
if( parse_uri( ctrl_url, strlen( ctrl_url ), url ) != HTTP_SUCCESS ) {
return -1;
}
host->buf = url->hostport.text.buff;
host->length = url->hostport.text.size;
// This is done to ensure that the buffer is kept const
((memptr *)host)->buf = (char *)url->hostport.text.buff;
((memptr *)host)->length = url->hostport.text.size;
path->buf = url->pathquery.buff;
path->length = url->pathquery.size;
((memptr *)path)->buf = (char *)url->pathquery.buff;
((memptr *)path)->length = url->pathquery.size;
return 0;
}
@ -873,8 +874,8 @@ SoapGetServiceVarStatus( IN char *action_url,
IN char *var_name,
OUT char **var_value )
{
memptr host; // value for HOST header
memptr path; // ctrl path in first line in msg
const memptr host; // value for HOST header
const memptr path; // ctrl path in first line in msg
uri_type url;
membuffer request;
int ret_code;

View File

@ -603,13 +603,13 @@ get_device_info( IN http_message_t * request,
service_info *serv_info;
char save_char;
int ret_code = -1; // error by default
char *control_url;
const char *control_url;
char *actionName = NULL;
// null-terminate pathquery of url
control_url = request->uri.pathquery.buff;
save_char = control_url[request->uri.pathquery.size];
control_url[request->uri.pathquery.size] = '\0';
((char *)control_url)[request->uri.pathquery.size] = '\0';
HandleLock( );
@ -666,7 +666,7 @@ get_device_info( IN http_message_t * request,
ret_code = 0;
error_handler:
control_url[request->uri.pathquery.size] = save_char; // restore
((char *)control_url)[request->uri.pathquery.size] = save_char; // restore
HandleUnlock( );
return ret_code;
}