Compare commits
2 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7275c1ab6f | ||
![]() |
a7ab0acfe8 |
28
ChangeLog
28
ChangeLog
@@ -1,3 +1,31 @@
|
||||
*************************************************************************
|
||||
Version 1.4.5
|
||||
*************************************************************************
|
||||
|
||||
2007-04-19 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Case insensitive comparison in raw_find_str() (httpparser.c) as
|
||||
suggested by Craig Nelson in SF Tracker [ 1689382 ] DLINK DIR-625
|
||||
patch.
|
||||
|
||||
2007-04-07 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||
* Fix for a bug in makeAction where va_arg was beeing called one
|
||||
extra time.
|
||||
|
||||
2007-04-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* SF Tracker [ 1703533 ] Patch to make it compile under FreeBSD
|
||||
Submitted By: Timothy Redaelli - drittz
|
||||
I made some patches to make it compile under FreeBSD using
|
||||
gethostbyaddr_r when supported.
|
||||
|
||||
2007-04-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* [pupnp-devel] Type mixup on x86_64 causes UPNP_E_OUTOF_MEMORY
|
||||
Submitted By: Glen Masgai
|
||||
after an UpnpSendActionAsync() for example, i get UPNP_E_OUTOF_MEMORY
|
||||
in the callback using 1.4.4 on a x86_64 system. This happens in
|
||||
http_MakeMessage(), which in some cases get called with wrong types
|
||||
(int instead of size_t) in combination with format "b" and "Q".
|
||||
The attached patch should fix this.
|
||||
|
||||
*************************************************************************
|
||||
Version 1.4.4
|
||||
*************************************************************************
|
||||
|
3
THANKS
3
THANKS
@@ -8,12 +8,14 @@ exempt of errors.
|
||||
|
||||
- Arno Willig
|
||||
- Chaos
|
||||
- Craig Nelson
|
||||
- David Maass
|
||||
- Emil Ljungdahl
|
||||
- Erik Johansson
|
||||
- Eric Tanguy
|
||||
- Erwan Velu
|
||||
- Fredrik Svensson
|
||||
- Glen Masgai
|
||||
- Jiri Zouhar
|
||||
- John Dennis
|
||||
- Jonathan (no_dice)
|
||||
@@ -27,4 +29,5 @@ exempt of errors.
|
||||
- Michael (Oxy)
|
||||
- Paul Vixie
|
||||
- Siva Chandran
|
||||
- Timothy Redaelli
|
||||
|
||||
|
@@ -13,7 +13,3 @@ autoreconf --force --install -Wall -Wno-obsolete $* || exit 1
|
||||
echo "Now run ./configure and then make."
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
95
configure.ac
95
configure.ac
@@ -10,7 +10,7 @@
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
AC_INIT([libupnp], [1.4.4], [mroberto@users.sourceforge.net])
|
||||
AC_INIT([libupnp], [1.4.5], [mroberto@users.sourceforge.net])
|
||||
# *Independently* of the above libupnp package version, the libtool version
|
||||
# of the 3 libraries need to be updated whenever there is a change released :
|
||||
# "current:revision:age" (this is NOT the same as the package version), where:
|
||||
@@ -48,6 +48,11 @@ AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
||||
|
||||
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
||||
|
||||
#
|
||||
# Get canonical host names in host and host_os
|
||||
#
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
#
|
||||
# There are 3 configuration files :
|
||||
# 1) "./autoconfig.h" is auto-generated and used only internally during build
|
||||
@@ -131,11 +136,14 @@ RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
|
||||
# version on that.
|
||||
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
|
||||
AC_MSG_CHECKING([for documentation directory])
|
||||
AC_ARG_WITH([documentation],
|
||||
AS_HELP_STRING([--with-documentation=directory_name],
|
||||
AC_ARG_WITH(
|
||||
[documentation],
|
||||
AS_HELP_STRING(
|
||||
[--with-documentation=directory_name],
|
||||
[where documentation is installed
|
||||
@<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@])
|
||||
AS_HELP_STRING([--without-documentation],
|
||||
AS_HELP_STRING(
|
||||
[--without-documentation],
|
||||
[do not install the documentation]),
|
||||
[],
|
||||
[with_documentation=no])
|
||||
@@ -159,25 +167,40 @@ AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_EGREP
|
||||
|
||||
|
||||
#
|
||||
# Default compilation flags
|
||||
#
|
||||
if test x"$enable_debug" = xyes; then
|
||||
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default
|
||||
:
|
||||
else
|
||||
# add optimise for size
|
||||
AX_CFLAGS_GCC_OPTION([-Os])
|
||||
fi
|
||||
echo "--------------------- Default compilation flags -------------------------------"
|
||||
echo host is $host
|
||||
echo host_os is $host_os
|
||||
case $host_os in
|
||||
FreeBSD*)
|
||||
echo "Using FreeBSD specific compiler settings"
|
||||
# Put FreeBSD specific compiler flags here
|
||||
;;
|
||||
*)
|
||||
echo "Using non-specific system compiler settings"
|
||||
if test x"$enable_debug" = xyes; then
|
||||
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default
|
||||
:
|
||||
else
|
||||
# add optimise for size
|
||||
AX_CFLAGS_GCC_OPTION([-Os])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AX_CFLAGS_WARN_ALL
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
|
||||
#
|
||||
# Lot's of stuff to ensure large file support
|
||||
#
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_DEFINE(_LARGE_FILE_SOURCE, [], [Large files support])
|
||||
AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
|
||||
AC_DEFINE([_LARGE_FILE_SOURCE], [], [Large files support])
|
||||
AC_DEFINE([_FILE_OFFSET_BITS], [64], [File Offset size])
|
||||
|
||||
|
||||
#
|
||||
@@ -186,7 +209,24 @@ AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
|
||||
AC_HEADER_STDC
|
||||
# libupnp code doesn't use autoconf variables yet,
|
||||
# so just abort if a header file is not found.
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h],[],[AC_MSG_ERROR([required header file missing])])
|
||||
AC_CHECK_HEADERS(
|
||||
[ \
|
||||
arpa/inet.h \
|
||||
fcntl.h \
|
||||
limits.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
stdlib.h \
|
||||
string.h \
|
||||
sys/ioctl.h \
|
||||
sys/socket.h \
|
||||
sys/time.h \
|
||||
sys/timeb.h \
|
||||
syslog.h \
|
||||
unistd.h \
|
||||
],
|
||||
[],
|
||||
[AC_MSG_ERROR([required header file missing])])
|
||||
|
||||
|
||||
#
|
||||
@@ -202,25 +242,28 @@ TYPE_SOCKLEN_T
|
||||
#
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_FSEEKO
|
||||
AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])
|
||||
|
||||
|
||||
#
|
||||
# Checks for POSIX Threads
|
||||
#
|
||||
ACX_PTHREAD([],[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
||||
ACX_PTHREAD(
|
||||
[],
|
||||
[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
||||
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
ixml/Makefile
|
||||
ixml/doc/Makefile
|
||||
threadutil/Makefile
|
||||
upnp/Makefile
|
||||
upnp/doc/Makefile
|
||||
docs/dist/Makefile
|
||||
libupnp.pc
|
||||
])
|
||||
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
ixml/Makefile
|
||||
ixml/doc/Makefile
|
||||
threadutil/Makefile
|
||||
upnp/Makefile
|
||||
upnp/doc/Makefile
|
||||
docs/dist/Makefile
|
||||
libupnp.pc
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
|
@@ -620,7 +620,7 @@ ixmlNode_cloneNode(IXML_Node *nodeptr,
|
||||
*/
|
||||
|
||||
EXPORT_SPEC BOOL
|
||||
ixmlNode_hasAttributes(IXML_Node *node
|
||||
ixmlNode_hasAttributes(IXML_Node *nodeptr
|
||||
/** The {\bf Node} to query for attributes. */
|
||||
);
|
||||
|
||||
@@ -630,7 +630,7 @@ ixmlNode_hasAttributes(IXML_Node *node
|
||||
*/
|
||||
|
||||
EXPORT_SPEC void
|
||||
ixmlNode_free(IXML_Node *IXML_Node
|
||||
ixmlNode_free(IXML_Node *nodeptr
|
||||
/** The {\bf Node} to free. */
|
||||
);
|
||||
|
||||
|
@@ -47,6 +47,10 @@ extern "C" {
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||
#endif
|
||||
|
||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||
/* This system has SuS2-compliant mutex attributes.
|
||||
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
|
||||
|
@@ -256,8 +256,8 @@ makeAction( IN int response,
|
||||
IN const char *Arg,
|
||||
IN va_list ArgList )
|
||||
{
|
||||
const char *ArgName,
|
||||
*ArgValue;
|
||||
const char *ArgName;
|
||||
const char *ArgValue;
|
||||
char *ActBuff;
|
||||
int Idx = 0;
|
||||
IXML_Document *ActionDoc;
|
||||
@@ -298,7 +298,7 @@ makeAction( IN int response,
|
||||
if( NumArg > 0 ) {
|
||||
//va_start(ArgList, Arg);
|
||||
ArgName = Arg;
|
||||
while( Idx++ != NumArg ) {
|
||||
for ( ; ; ) {
|
||||
ArgValue = va_arg( ArgList, const char * );
|
||||
|
||||
if( ArgName != NULL ) {
|
||||
@@ -313,7 +313,11 @@ makeAction( IN int response,
|
||||
ixmlNode_appendChild( node, ( IXML_Node * ) Ele );
|
||||
}
|
||||
|
||||
ArgName = va_arg( ArgList, const char * );
|
||||
if (++Idx < NumArg) {
|
||||
ArgName = va_arg( ArgList, const char * );
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//va_end(ArgList);
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@
|
||||
* messages.
|
||||
************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For strcasestr() in string.h
|
||||
#include "config.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
@@ -2434,7 +2435,8 @@ raw_find_str( IN memptr * raw_value,
|
||||
c = raw_value->buf[raw_value->length]; // save
|
||||
raw_value->buf[raw_value->length] = 0; // null-terminate
|
||||
|
||||
ptr = strstr( raw_value->buf, str );
|
||||
// Use strcasestr because the string may not always be exact case
|
||||
ptr = strcasestr( raw_value->buf, str );
|
||||
|
||||
raw_value->buf[raw_value->length] = c; // restore
|
||||
|
||||
|
@@ -231,10 +231,10 @@ http_RecvMessage( IN SOCKINFO * info,
|
||||
"<<< (RECVD) <<<\n%s\n-----------------\n",
|
||||
parser->msg.msg.buf );
|
||||
//print_http_headers( &parser->msg );
|
||||
)
|
||||
)
|
||||
|
||||
if( parser->content_length >
|
||||
( unsigned int )g_maxContentLength ) {
|
||||
if( parser->content_length >
|
||||
( unsigned int )g_maxContentLength ) {
|
||||
*http_error_code = HTTP_REQ_ENTITY_TOO_LARGE;
|
||||
return UPNP_E_OUTOF_BOUNDS;
|
||||
}
|
||||
@@ -606,8 +606,8 @@ http_Download( IN const char *url_str,
|
||||
*hoststr,
|
||||
*temp;
|
||||
http_parser_t response;
|
||||
size_t msg_length,
|
||||
hostlen;
|
||||
size_t msg_length;
|
||||
size_t hostlen;
|
||||
memptr ctype;
|
||||
size_t copy_len;
|
||||
membuffer request;
|
||||
@@ -648,9 +648,10 @@ http_Download( IN const char *url_str,
|
||||
|
||||
ret_code = http_MakeMessage(
|
||||
&request, 1, 1,
|
||||
"QsbcDCUc",
|
||||
"Q" "s" "bcDCUc",
|
||||
HTTPMETHOD_GET, url.pathquery.buff, url.pathquery.size,
|
||||
"HOST: ", hoststr, hostlen );
|
||||
"HOST: ",
|
||||
hoststr, hostlen );
|
||||
if( ret_code != 0 ) {
|
||||
DBGONLY( UpnpPrintf
|
||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||
@@ -766,7 +767,7 @@ MakePostMessage( const char *url_str,
|
||||
{
|
||||
int ret_code = 0;
|
||||
char *urlPath = alloca( strlen( url_str ) + 1 );
|
||||
int hostlen = 0;
|
||||
size_t hostlen = 0;
|
||||
char *hoststr,
|
||||
*temp;
|
||||
|
||||
@@ -799,7 +800,7 @@ MakePostMessage( const char *url_str,
|
||||
hostlen = strlen( hoststr );
|
||||
*temp = '/';
|
||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||
"HOSTNAME : %s Length : %d\n", hoststr, hostlen );
|
||||
"HOSTNAME : %s Length : %zd\n", hoststr, hostlen );
|
||||
)
|
||||
|
||||
if( contentLength >= 0 ) {
|
||||
@@ -1101,9 +1102,9 @@ MakeGetMessage( const char *url_str,
|
||||
{
|
||||
int ret_code;
|
||||
char *urlPath = alloca( strlen( url_str ) + 1 );
|
||||
int querylen = 0;
|
||||
size_t querylen = 0;
|
||||
const char *querystr;
|
||||
int hostlen = 0;
|
||||
size_t hostlen = 0;
|
||||
char *hoststr,
|
||||
*temp;
|
||||
|
||||
@@ -1136,7 +1137,7 @@ MakeGetMessage( const char *url_str,
|
||||
hostlen = strlen( hoststr );
|
||||
*temp = '/';
|
||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||
"HOSTNAME : %s Length : %d\n", hoststr, hostlen );
|
||||
"HOSTNAME : %s Length : %zd\n", hoststr, hostlen );
|
||||
)
|
||||
|
||||
if( proxy_str ) {
|
||||
@@ -1149,9 +1150,10 @@ MakeGetMessage( const char *url_str,
|
||||
|
||||
ret_code = http_MakeMessage(
|
||||
request, 1, 1,
|
||||
"QsbcDCUc",
|
||||
"Q" "s" "bcDCUc",
|
||||
HTTPMETHOD_GET, querystr, querylen,
|
||||
"HOST: ", hoststr, hostlen );
|
||||
"HOST: ",
|
||||
hoststr, hostlen );
|
||||
|
||||
if( ret_code != 0 ) {
|
||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||
@@ -1780,8 +1782,8 @@ http_SendStatusResponse( IN SOCKINFO * info,
|
||||
* fmt types:
|
||||
* 'B': arg = int status_code
|
||||
* appends content-length, content-type and HTML body for given code
|
||||
* 'b': arg1 = const char* buf; arg2 = size_t buf_length
|
||||
* memory ptr
|
||||
* 'b': arg1 = const char* buf;
|
||||
* arg2 = size_t buf_length memory ptr
|
||||
* 'C': (no args) appends a HTTP CONNECTION: close header
|
||||
* depending on major,minor version
|
||||
* 'c': (no args) appends CRLF "\r\n"
|
||||
@@ -1790,16 +1792,18 @@ http_SendStatusResponse( IN SOCKINFO * info,
|
||||
* 'G': arg = range information // add range header
|
||||
* 'h': arg = off_t number // appends off_t number
|
||||
* 'K': (no args) // add chunky header
|
||||
* 'N': arg1 = int content_length // content-length header
|
||||
* 'q': arg1 = http_method_t, arg2 = (uri_type *) // request start line and HOST header
|
||||
* 'Q': arg1 = http_method_t; arg2 = char* url;
|
||||
* arg3 = int url_length // start line of request
|
||||
* 'R': arg = int status_code // adds a response start line
|
||||
* 'N': arg1 = off_t content_length // content-length header
|
||||
* 'q': arg1 = http_method_t // request start line and HOST header
|
||||
* arg2 = (uri_type *)
|
||||
* 'Q': arg1 = http_method_t; // start line of request
|
||||
* arg2 = char* url;
|
||||
* arg3 = size_t url_length
|
||||
* 'R': arg = int status_code // adds a response start line
|
||||
* 'S': (no args) appends HTTP SERVER: header
|
||||
* 's': arg = const char* C_string
|
||||
* 'T': arg = char * content_type; format e.g: "text/html";
|
||||
* content-type header
|
||||
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
||||
* 'T': arg = char * content_type; format
|
||||
* e.g: "text/html"; content-type header
|
||||
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
||||
* 'U': (no args) appends HTTP USER-AGENT: header
|
||||
* 'X': arg = const char useragent; "redsonic" HTTP X-User-Agent: useragent
|
||||
*
|
||||
@@ -2165,7 +2169,7 @@ MakeGetMessageEx( const char *url_str,
|
||||
{
|
||||
int errCode = UPNP_E_SUCCESS;
|
||||
char *urlPath = NULL;
|
||||
int hostlen = 0;
|
||||
size_t hostlen = 0;
|
||||
char *hoststr,
|
||||
*temp;
|
||||
|
||||
@@ -2210,16 +2214,16 @@ MakeGetMessageEx( const char *url_str,
|
||||
*temp = '/';
|
||||
|
||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||
"HOSTNAME : %s Length : %d\n", hoststr,
|
||||
hostlen );
|
||||
"HOSTNAME : %s Length : %zd\n",
|
||||
hoststr, hostlen );
|
||||
)
|
||||
|
||||
errCode = http_MakeMessage(
|
||||
request, 1, 1,
|
||||
"QsbcGDCUc",
|
||||
HTTPMETHOD_GET,
|
||||
url->pathquery.buff, url->pathquery.size,
|
||||
"HOST: ", hoststr, hostlen,
|
||||
"Q" "s" "bc" "GDCUc",
|
||||
HTTPMETHOD_GET, url->pathquery.buff, url->pathquery.size,
|
||||
"HOST: ",
|
||||
hoststr, hostlen,
|
||||
pRangeSpecifier );
|
||||
|
||||
if( errCode != 0 ) {
|
||||
|
@@ -34,8 +34,11 @@
|
||||
************************************************************************/
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <osreldate.h>
|
||||
#if __FreeBSD_version < 601103
|
||||
#include <lwres/netdb.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "config.h"
|
||||
#include "uri.h"
|
||||
|
||||
@@ -620,7 +623,7 @@ parse_hostport( const char *in,
|
||||
&h,
|
||||
temp_hostbyname_buff,
|
||||
BUFFER_SIZE, &errcode );
|
||||
#elif defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__) && __FreeBSD_version < 601103
|
||||
h = lwres_gethostbyname_r( temp_host_name,
|
||||
&h_buf,
|
||||
temp_hostbyname_buff,
|
||||
|
@@ -611,9 +611,9 @@ SoapSendAction( IN char *action_url,
|
||||
char *xml_end =
|
||||
"</s:Body>\r\n"
|
||||
"</s:Envelope>\r\n\r\n";
|
||||
int xml_start_len;
|
||||
int xml_end_len;
|
||||
int action_str_len;
|
||||
size_t xml_start_len;
|
||||
size_t xml_end_len;
|
||||
size_t action_str_len;
|
||||
|
||||
*response_node = NULL; // init
|
||||
|
||||
@@ -693,7 +693,7 @@ SoapSendAction( IN char *action_url,
|
||||
err_code = ret_code;
|
||||
}
|
||||
|
||||
error_handler:
|
||||
error_handler:
|
||||
ixmlFreeDOMString( action_str );
|
||||
membuffer_destroy( &request );
|
||||
membuffer_destroy( &responsename );
|
||||
@@ -757,13 +757,13 @@ SoapSendActionEx( IN char *action_url,
|
||||
char *xml_end =
|
||||
"</s:Body>\r\n"
|
||||
"</s:Envelope>\r\n";
|
||||
int xml_start_len;
|
||||
int xml_header_start_len;
|
||||
int xml_header_str_len;
|
||||
int xml_header_end_len;
|
||||
int xml_body_start_len;
|
||||
int action_str_len;
|
||||
int xml_end_len;
|
||||
size_t xml_start_len;
|
||||
size_t xml_header_start_len;
|
||||
size_t xml_header_str_len;
|
||||
size_t xml_header_end_len;
|
||||
size_t xml_body_start_len;
|
||||
size_t action_str_len;
|
||||
size_t xml_end_len;
|
||||
off_t content_length;
|
||||
|
||||
*response_node = NULL; // init
|
||||
@@ -821,7 +821,7 @@ SoapSendActionEx( IN char *action_url,
|
||||
xml_body_start_len + action_str_len + xml_end_len;
|
||||
if (http_MakeMessage(
|
||||
&request, 1, 1,
|
||||
"q" "N" "s" "sssbsc" "Uc" "bbbbbbb",
|
||||
"q" "N" "s" "sssbsc" "Uc" "b" "b" "b" "b" "b" "b" "b",
|
||||
SOAPMETHOD_POST, &url,
|
||||
content_length,
|
||||
ContentTypeHeader,
|
||||
|
Reference in New Issue
Block a user