Compare commits
5 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7275c1ab6f | ||
![]() |
a7ab0acfe8 | ||
![]() |
85a8da77f2 | ||
![]() |
25620c1967 | ||
![]() |
8bc61b1a5c |
102
ChangeLog
102
ChangeLog
@@ -1,3 +1,105 @@
|
||||
*************************************************************************
|
||||
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
|
||||
*************************************************************************
|
||||
|
||||
2007-04-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* SF Tracker [ 1695399 ] Typo in util.h
|
||||
Submitted By: Luke Kim - nereusuj
|
||||
Unix sleep is in seconds but WIN32 Sleep is in milliseconds.
|
||||
|
||||
2007-04-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* SF Tracker [ 1652827 ] UpnpRegisterRootDevice returned -104
|
||||
Submitted By: Michael Andersen - miwer
|
||||
|
||||
Issue was found to be related to sizeof (size_t) != sizeof (int)
|
||||
on AMD64 systems. Emil Ljungdahl's AMD64 patch has been applied along
|
||||
with some other fixes. Original user report follows:
|
||||
|
||||
When I run upnpd I get the above mentioned error (UPNP_E_OUTOF_MEMORY).
|
||||
I've tried with 1.4.1 and 1.4.2-RC3, it's the same. I don't understand why,
|
||||
because I have plenty of RAM, and I even tried closing some applications,
|
||||
but it didn't help.
|
||||
|
||||
$ upnpd eth1 br0
|
||||
|
||||
The following is logged in the /var/log/messages:
|
||||
Feb 6 01:33:47 server upnpd[6933]: Error registering the root device with
|
||||
descDocUrl: http://192.168.0.1:49152/gatedesc.xml
|
||||
Feb 6 01:33:47 server upnpd[6933]: UpnpRegisterRootDevice returned -104
|
||||
|
||||
|
||||
I tried enabling debugging and it looks like it cannot allocate memory
|
||||
through the membuffer_append function. It's wierd because it's only a few
|
||||
bytes.
|
||||
|
||||
Please note, that I enabled some extra debugging lines that were commented,
|
||||
in order to get more information. See attached files.
|
||||
|
||||
*************************************************************************
|
||||
Version 1.4.3
|
||||
*************************************************************************
|
||||
|
||||
2007-03-13 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* SF Tracker [ 1663004 ] Compile on Cygwin
|
||||
Submitted By: Jon Foster - jongfoster
|
||||
This patch gives basic support for building under Cygwin - it compiles,
|
||||
links, and a simple UPnP device application can initialise. I'm not sure
|
||||
if it actually works yet, but this is definitely a step in the right
|
||||
direction.
|
||||
|
||||
Patch is against the 1.4.1 release. Changes are:
|
||||
|
||||
* threadutil/inc/ithread.h: Fix the ithread mutex support to use
|
||||
documented, portable APIs (if present) rather than the Non-Portable (_NP)
|
||||
ones it uses now. This is required because Cygwin implements only the
|
||||
portable API.
|
||||
|
||||
* threadutil/src/ThreadPool.c: Fake SetPolicyType() to do nothing on Cygwin
|
||||
because otherwise it fails. Should probably investigate why it fails and
|
||||
add a proper implementation later.
|
||||
|
||||
* upnp/src/api/upnpapi.c: On Cygwin, zero out the GlobalHndMutex structure
|
||||
before initialising it. Without this, the initialisation fails. This
|
||||
appears to be a bug in Cygwin.
|
||||
|
||||
* upnp/src/genlib/net/uri/uri.c: Use gethostbyname() on Cygwin.
|
||||
|
||||
2007-03-05 Oxy <oxygenic(at)users.sourceforge.net>
|
||||
* Code adapted and typedefs added to compile cleanly under Windows
|
||||
with Borland C++ Builder and MS Visual C++
|
||||
|
||||
2007-03-03 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
|
||||
* Fixed nasty segmentation fault bug on membuffer.c.
|
||||
|
||||
*************************************************************************
|
||||
Version 1.4.2
|
||||
*************************************************************************
|
||||
|
5
THANKS
5
THANKS
@@ -8,16 +8,20 @@ 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)
|
||||
- Leuk_He
|
||||
- Loigu
|
||||
- Luke Kim
|
||||
- Marcelo Roberto Jimenez
|
||||
- Markus Strobl
|
||||
- Nektarios K. Papadopoulos
|
||||
@@ -25,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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -45,7 +45,7 @@
|
||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
||||
<LINKER value="tlink32"/>
|
||||
<USERDEFINES value="WIN32;LIBUPNP_EXPORTS"/>
|
||||
<USERDEFINES value="WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP"/>
|
||||
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
|
||||
<MAINSOURCE value="libupnp.bpf"/>
|
||||
<INCLUDEPATH value="..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc;..\..\pthreads-w32-1-10-0-release"/>
|
||||
@@ -100,19 +100,21 @@ Item1=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig
|
||||
Item2=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=2
|
||||
Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;D:\DEVELOP\pthreads-w32-1-10-0-release
|
||||
Item1=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib
|
||||
Count=3
|
||||
Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;..\..\pthreads-w32-1-10-0-release
|
||||
Item1=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;D:\DEVELOP\pthreads-w32-1-10-0-release
|
||||
Item2=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[HistoryLists\hlConditionals]
|
||||
Count=3
|
||||
Item0=WIN32;LIBUPNP_EXPORTS
|
||||
Item1=WIN32;EXPORT_SPEC
|
||||
Item2=WIN32
|
||||
Count=4
|
||||
Item0=WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP
|
||||
Item1=WIN32;LIBUPNP_EXPORTS
|
||||
Item2=WIN32;EXPORT_SPEC
|
||||
Item3=WIN32
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=$(BCB)\source\vcl
|
||||
|
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /D "UPNP_USE_MSVCPP" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
||||
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "libupnp - Win32 Debug"
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "UPNP_USE_MSVCPP" /FR /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
||||
@@ -80,7 +80,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
67
configure.ac
67
configure.ac
@@ -10,7 +10,7 @@
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
AC_INIT([libupnp], [1.4.2], [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,10 +167,19 @@ AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_EGREP
|
||||
|
||||
|
||||
#
|
||||
# Default compilation flags
|
||||
#
|
||||
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
|
||||
:
|
||||
@@ -170,14 +187,20 @@ 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,17 +242,19 @@ 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
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
ixml/Makefile
|
||||
ixml/doc/Makefile
|
||||
threadutil/Makefile
|
||||
@@ -222,5 +264,6 @@ AC_CONFIG_FILES([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,9 +47,23 @@ 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
|
||||
*/
|
||||
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
|
||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
|
||||
#else
|
||||
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
|
||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
||||
#endif
|
||||
|
||||
#define ITHREAD_CANCELED PTHREAD_CANCELED
|
||||
|
||||
|
||||
@@ -181,8 +195,11 @@ extern "C" {
|
||||
* Returns EINVAL if the kind is not supported.
|
||||
* See man page for pthread_mutexattr_setkind_np
|
||||
*****************************************************************************/
|
||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
|
||||
#else
|
||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ithread_mutexattr_getkind_np
|
||||
@@ -203,7 +220,11 @@ extern "C" {
|
||||
* Always returns 0.
|
||||
* See man page for pthread_mutexattr_getkind_np
|
||||
*****************************************************************************/
|
||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
|
||||
#else
|
||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
@@ -542,8 +563,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef PTHREAD_MUTEX_RECURSIVE
|
||||
//NK: Added for satisfying the gcc compiler
|
||||
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -90,6 +90,10 @@ FreeThreadPoolJob( ThreadPool * tp,
|
||||
static int
|
||||
SetPolicyType( PolicyType in )
|
||||
{
|
||||
#ifdef __CYGWIN__
|
||||
/* TODO not currently working... */
|
||||
return 0;
|
||||
#else
|
||||
#ifdef WIN32
|
||||
return sched_setscheduler( 0, in);
|
||||
#else
|
||||
@@ -99,6 +103,7 @@ SetPolicyType( PolicyType in )
|
||||
current.sched_priority = DEFAULT_SCHED_PARAM;
|
||||
return sched_setscheduler( 0, in, ¤t );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@@ -65,6 +65,12 @@
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
#ifdef UPNP_USE_MSVCPP // define some things the M$ VC++ doesn't knows
|
||||
typedef __int64 int64_t;
|
||||
#endif
|
||||
#ifdef UPNP_USE_BCBPP // define some things Borland Builder doesn't knows
|
||||
typedef __int64 int64_t;
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
|
@@ -207,6 +207,11 @@ int UpnpInit( IN const char *HostIP,
|
||||
( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit \n" );
|
||||
)
|
||||
//initialize mutex
|
||||
#ifdef __CYGWIN__
|
||||
/* On Cygwin, pthread_mutex_init() fails without this memset. */
|
||||
/* TODO: Fix Cygwin so we don't need this memset(). */
|
||||
memset(&GlobalHndMutex, 0, sizeof(GlobalHndMutex));
|
||||
#endif
|
||||
if( ithread_mutex_init( &GlobalHndMutex, NULL ) != 0 ) {
|
||||
return UPNP_E_INIT_FAILED;
|
||||
}
|
||||
|
@@ -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 );
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
@@ -39,9 +39,16 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#ifndef UPNP_USE_BCBPP
|
||||
#ifndef UPNP_USE_MSVCPP
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -49,7 +56,6 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
#include <malloc.h>
|
||||
@@ -600,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;
|
||||
@@ -642,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__,
|
||||
@@ -760,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;
|
||||
|
||||
@@ -793,30 +800,33 @@ 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 ) {
|
||||
ret_code = http_MakeMessage(
|
||||
request, 1, 1,
|
||||
"QsbcDCUTNc",
|
||||
"Q" "s" "bcDCU" "T" "Nc",
|
||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
||||
"HOST: ", hoststr, hostlen,
|
||||
"HOST: ",
|
||||
hoststr, hostlen,
|
||||
contentType,
|
||||
(off_t)contentLength );
|
||||
} else if( contentLength == UPNP_USING_CHUNKED ) {
|
||||
ret_code = http_MakeMessage(
|
||||
request, 1, 1,
|
||||
"QsbcDCUTKc",
|
||||
"Q" "s" "bcDCU" "TKc",
|
||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
||||
"HOST: ", hoststr, hostlen,
|
||||
"HOST: ",
|
||||
hoststr, hostlen,
|
||||
contentType );
|
||||
} else if( contentLength == UPNP_UNTIL_CLOSE ) {
|
||||
ret_code = http_MakeMessage(
|
||||
request, 1, 1,
|
||||
"QsbcDCUTc",
|
||||
"Q" "s" "bcDCU" "Tc",
|
||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
||||
"HOST: ", hoststr, hostlen,
|
||||
"HOST: ",
|
||||
hoststr, hostlen,
|
||||
contentType );
|
||||
} else {
|
||||
ret_code = UPNP_E_INVALID_PARAM;
|
||||
@@ -1092,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;
|
||||
|
||||
@@ -1127,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 ) {
|
||||
@@ -1140,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__,
|
||||
@@ -1771,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"
|
||||
@@ -1781,15 +1792,17 @@ 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
|
||||
* '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 = 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
|
||||
@@ -1810,7 +1823,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
||||
{
|
||||
char c;
|
||||
char *s = NULL;
|
||||
int num;
|
||||
size_t num;
|
||||
off_t bignum;
|
||||
size_t length;
|
||||
time_t *loc_time;
|
||||
@@ -1893,7 +1906,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
||||
{
|
||||
num = ( int )va_arg( argp, int );
|
||||
|
||||
sprintf( tempbuf, "%d", num );
|
||||
sprintf( tempbuf, "%zu", num );
|
||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
||||
goto error_handler;
|
||||
}
|
||||
@@ -1903,7 +1916,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
||||
{
|
||||
bignum = ( off_t )va_arg( argp, off_t );
|
||||
|
||||
sprintf( tempbuf, "%lld", (long long)bignum );
|
||||
sprintf( tempbuf, "%"PRId64, (int64_t)bignum );
|
||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
||||
goto error_handler;
|
||||
}
|
||||
@@ -2041,7 +2054,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
||||
method = ( http_method_t ) va_arg( argp, http_method_t );
|
||||
method_str = method_to_str( method );
|
||||
url_str = ( const char * )va_arg( argp, const char * );
|
||||
num = ( int )va_arg( argp, int ); // length of url_str
|
||||
num = ( size_t )va_arg( argp, size_t ); // length of url_str
|
||||
|
||||
if (http_MakeMessage(
|
||||
buf, http_major_version, http_minor_version,
|
||||
@@ -2156,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;
|
||||
|
||||
@@ -2201,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 ) {
|
||||
|
@@ -37,6 +37,12 @@
|
||||
#include "config.h"
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#ifndef UPNP_USE_BCBPP
|
||||
#ifndef UPNP_USE_MSVCPP
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "util.h"
|
||||
#include "strintmap.h"
|
||||
#include "membuffer.h"
|
||||
@@ -985,35 +991,35 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
||||
Instr->RangeOffset = FirstByte;
|
||||
Instr->ReadSendSize = LastByte - FirstByte + 1;
|
||||
sprintf( Instr->RangeHeader,
|
||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
||||
(long long)FirstByte,
|
||||
(long long)LastByte,
|
||||
(long long)FileLength ); //Data between two range.
|
||||
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||
(int64_t)FirstByte,
|
||||
(int64_t)LastByte,
|
||||
(int64_t)FileLength ); //Data between two range.
|
||||
} else if( FirstByte >= 0 && LastByte == -1
|
||||
&& FirstByte < FileLength ) {
|
||||
Instr->RangeOffset = FirstByte;
|
||||
Instr->ReadSendSize = FileLength - FirstByte;
|
||||
sprintf( Instr->RangeHeader,
|
||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
||||
(long long)FirstByte,
|
||||
(long long)(FileLength - 1),
|
||||
(long long)FileLength );
|
||||
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||
(int64_t)FirstByte,
|
||||
(int64_t)(FileLength - 1),
|
||||
(int64_t)FileLength );
|
||||
} else if( FirstByte == -1 && LastByte > 0 ) {
|
||||
if( LastByte >= FileLength ) {
|
||||
Instr->RangeOffset = 0;
|
||||
Instr->ReadSendSize = FileLength;
|
||||
sprintf( Instr->RangeHeader,
|
||||
"CONTENT-RANGE: bytes 0-%lld/%lld\r\n",
|
||||
(long long)(FileLength - 1),
|
||||
(long long)FileLength );
|
||||
"CONTENT-RANGE: bytes 0-%"PRId64"/%"PRId64"\r\n",
|
||||
(int64_t)(FileLength - 1),
|
||||
(int64_t)FileLength );
|
||||
} else {
|
||||
Instr->RangeOffset = FileLength - LastByte;
|
||||
Instr->ReadSendSize = LastByte;
|
||||
sprintf( Instr->RangeHeader,
|
||||
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
|
||||
(long long)(FileLength - LastByte + 1),
|
||||
(long long)FileLength,
|
||||
(long long)FileLength );
|
||||
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
||||
(int64_t)(FileLength - LastByte + 1),
|
||||
(int64_t)FileLength,
|
||||
(int64_t)FileLength );
|
||||
}
|
||||
} else {
|
||||
free( RangeInput );
|
||||
@@ -1201,7 +1207,7 @@ process_request( IN http_message_t * req,
|
||||
int resp_major,
|
||||
resp_minor;
|
||||
xboolean alias_grabbed;
|
||||
int dummy;
|
||||
size_t dummy;
|
||||
struct UpnpVirtualDirCallbacks *pVirtualDirCallback;
|
||||
|
||||
print_http_headers( req );
|
||||
|
@@ -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"
|
||||
|
||||
@@ -157,7 +160,7 @@ is_escaped( const char *in )
|
||||
int
|
||||
replace_escaped( char *in,
|
||||
int index,
|
||||
int *max )
|
||||
size_t *max )
|
||||
{
|
||||
int tempInt = 0;
|
||||
char tempChar = 0;
|
||||
@@ -611,14 +614,16 @@ parse_hostport( const char *in,
|
||||
int errCode = 0;
|
||||
|
||||
//call gethostbyname_r (reentrant form of gethostbyname)
|
||||
#if defined(WIN32)
|
||||
// TODO: Use autoconf to discover this rather than the
|
||||
// platform-specific stuff below
|
||||
#if defined(WIN32) || defined(__CYGWIN__)
|
||||
h=gethostbyname(temp_host_name);
|
||||
#elif defined(SPARC_SOLARIS)
|
||||
errCode = gethostbyname_r( temp_host_name,
|
||||
&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,
|
||||
@@ -731,7 +736,7 @@ parse_scheme( const char *in,
|
||||
************************************************************************/
|
||||
int
|
||||
remove_escaped_chars( INOUT char *in,
|
||||
INOUT int *size )
|
||||
INOUT size_t *size )
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
@@ -331,9 +331,10 @@ membuffer_assign( INOUT membuffer * m,
|
||||
return return_code;
|
||||
}
|
||||
// copy
|
||||
if( buf_len ) {
|
||||
memcpy( m->buf, buf, buf_len );
|
||||
m->buf[buf_len] = 0; // null-terminate
|
||||
|
||||
}
|
||||
m->length = buf_len;
|
||||
|
||||
return 0;
|
||||
|
@@ -96,7 +96,7 @@ typedef struct SOCKET_BUFFER{
|
||||
//holds a pointer into a larger array
|
||||
typedef struct TOKEN {
|
||||
char * buff;
|
||||
int size;
|
||||
size_t size;
|
||||
} token;
|
||||
|
||||
|
||||
|
@@ -51,8 +51,7 @@ typedef struct // memptr
|
||||
// note: Total length/capacity should not exceed MAX_INT
|
||||
typedef struct // membuffer
|
||||
{
|
||||
char *buf; // mem buffer; must not write
|
||||
// beyond buf[length-1] (read/write)
|
||||
char *buf; // mem buffer; must not write beyond buf[length-1] (read/write)
|
||||
size_t length; // length of buffer (read-only)
|
||||
size_t capacity; // total allocated memory (read-only)
|
||||
size_t size_inc; // used to increase size; MUST be > 0; (read/write)
|
||||
@@ -148,8 +147,7 @@ int memptr_cmp_nocase( IN memptr* m, IN const char* s );
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
int membuffer_set_size( INOUT membuffer* m,
|
||||
IN size_t new_length );
|
||||
int membuffer_set_size( INOUT membuffer* m, IN size_t new_length );
|
||||
|
||||
/************************************************************************
|
||||
* Function : membuffer_init
|
||||
@@ -200,8 +198,7 @@ void membuffer_destroy( INOUT membuffer* m );
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
int membuffer_assign( INOUT membuffer* m, IN const void* buf,
|
||||
IN size_t buf_len );
|
||||
int membuffer_assign( INOUT membuffer* m, IN const void* buf, IN size_t buf_len );
|
||||
|
||||
/************************************************************************
|
||||
* Function : membuffer_assign_str
|
||||
@@ -237,8 +234,7 @@ int membuffer_assign_str( INOUT membuffer* m, IN const char* c_str );
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
int membuffer_append( INOUT membuffer* m, IN const void* buf,
|
||||
IN size_t buf_len );
|
||||
int membuffer_append( INOUT membuffer* m, IN const void* buf, IN size_t buf_len );
|
||||
|
||||
/************************************************************************
|
||||
* Function : membuffer_append_str
|
||||
@@ -276,8 +272,7 @@ int membuffer_append_str( INOUT membuffer* m, IN const char* c_str );
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
int membuffer_insert( INOUT membuffer* m, IN const void* buf,
|
||||
IN size_t buf_len, int index );
|
||||
int membuffer_insert( INOUT membuffer* m, IN const void* buf, IN size_t buf_len, int index );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
@@ -298,8 +293,7 @@ int membuffer_insert( INOUT membuffer* m, IN const void* buf,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
void membuffer_delete( INOUT membuffer* m, IN int index,
|
||||
IN size_t num_bytes );
|
||||
void membuffer_delete( INOUT membuffer* m, IN int index, IN size_t num_bytes );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
@@ -336,8 +330,7 @@ char* membuffer_detach( INOUT membuffer* m );
|
||||
* Note : 'new_buf' must be allocted using malloc or realloc so
|
||||
* that it can be freed using free()
|
||||
************************************************************************/
|
||||
void membuffer_attach( INOUT membuffer* m, IN char* new_buf,
|
||||
IN size_t buf_len );
|
||||
void membuffer_attach( INOUT membuffer* m, IN char* new_buf, IN size_t buf_len );
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@@ -87,7 +87,7 @@ enum uriType { absolute, relative };
|
||||
* holds a pointer into a larger array */
|
||||
typedef struct TOKEN {
|
||||
const char *buff;
|
||||
int size;
|
||||
size_t size;
|
||||
} token;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ typedef struct URL_LIST {
|
||||
* Parameters :
|
||||
* char * in ; string of characters
|
||||
* int index ; index at which to start checking the characters
|
||||
* int *max ;
|
||||
* size_t *max ;
|
||||
*
|
||||
* Description : Replaces an escaped sequence with its unescaped version
|
||||
* as in http://www.ietf.org/rfc/rfc2396.txt (RFC explaining URIs)
|
||||
@@ -137,7 +137,7 @@ typedef struct URL_LIST {
|
||||
* string are shifted over, and NULL characters are placed at the
|
||||
* end of the string.
|
||||
************************************************************************/
|
||||
int replace_escaped(char * in, int index, int *max);
|
||||
int replace_escaped(char * in, int index, size_t *max);
|
||||
|
||||
/************************************************************************
|
||||
* Function : copy_URL_list
|
||||
@@ -303,7 +303,7 @@ int parse_hostport(const char *in, int max, hostport_type *out );
|
||||
*
|
||||
* Parameters :
|
||||
* INOUT char *in ; string of characters to be modified
|
||||
* INOUT int *size ; size limit for the number of characters
|
||||
* INOUT size_t *size ; size limit for the number of characters
|
||||
*
|
||||
* Description : removes http escaped characters such as: "%20" and
|
||||
* replaces them with their character representation. i.e.
|
||||
@@ -315,7 +315,7 @@ int parse_hostport(const char *in, int max, hostport_type *out );
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
int remove_escaped_chars(char *in,int *size);
|
||||
int remove_escaped_chars(char *in, size_t *size);
|
||||
|
||||
/************************************************************************
|
||||
* Function : remove_dots
|
||||
|
@@ -163,7 +163,7 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
#define sleep Sleep
|
||||
#define sleep(a) Sleep((a)*1000)
|
||||
#define usleep(a) Sleep((a)/1000)
|
||||
#endif
|
||||
|
||||
|
@@ -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
|
||||
|
||||
@@ -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