Compare commits
7 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0014a1ae5 | ||
![]() |
dee7744256 | ||
![]() |
adcc34aeac | ||
![]() |
3a11a7b113 | ||
![]() |
af5db93bb1 | ||
![]() |
579a6fdee4 | ||
![]() |
5a505c72ec |
191
ChangeLog
191
ChangeLog
@@ -1,190 +1,8 @@
|
|||||||
*************************************************************************
|
|
||||||
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
|
|
||||||
*************************************************************************
|
|
||||||
|
|
||||||
2007-02-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* 32/64 bits portability issues on *printf.
|
|
||||||
Use %zd for size_t, and cast to (long long) for off_t.
|
|
||||||
|
|
||||||
2007-02-02 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* Bumped the program version to 1.4.2 in config.ac.
|
|
||||||
|
|
||||||
* Now requires autoconf 2.60.
|
|
||||||
|
|
||||||
* Fixed docdir use.
|
|
||||||
|
|
||||||
* Does not install the documentation by default.
|
|
||||||
|
|
||||||
* Use dist-bzip2 to create a .bz2 distribution file.
|
|
||||||
|
|
||||||
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
|
|
||||||
Submitted By: Jonathan - no_dice
|
|
||||||
Summary: This patch hopefully fixes the remaining types and related
|
|
||||||
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
|
|
||||||
tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520.
|
|
||||||
|
|
||||||
2007-01-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* SF Tracker [ 1628629 ] Multicast interface patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
This patch fixes two problems:
|
|
||||||
1) Specify the IP address for the interface when we do
|
|
||||||
setsockopt IP_ADD_MEMBERSHIP. This makes it possible to run
|
|
||||||
when no default router has been configured.
|
|
||||||
2) Explicitly set the multicast interface through setsockopt
|
|
||||||
IP_MULTICAST_IF. Avoids socket error -207 in some cases.
|
|
||||||
|
|
||||||
* SF Tracker [ 1628590 ] XML parsing segfault patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
This patch fixes a segmentation fault problem that occurrs
|
|
||||||
when parsing XML code than some routers produce.
|
|
||||||
|
|
||||||
2007-01-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* SF Tracker [ 1628552 ] XML white space patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
|
|
||||||
* SF Tracker [ 1628562 ] Maximum total jobs patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
Also, I incremented the libray versions and included some
|
|
||||||
comments in the file configure.ac so that we do not bump
|
|
||||||
the library version excessively, only the necessary numbers
|
|
||||||
on the next release.
|
|
||||||
|
|
||||||
* SF Tracker [ 1628575 ] Linksys WRT54G patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
|
|
||||||
* SF Tracker [ 1628636 ] SSDP packet copy patch
|
|
||||||
Submitted By: Fredrik Svensson - svefredrik
|
|
||||||
Changed NUM_COPY to 1 since, according to section 9.2 of the
|
|
||||||
HTTPU/MU spec, we should never send more than one copy of a
|
|
||||||
reply to an SSDP request. Ref. section 9.2 of
|
|
||||||
http://www.upnp.org/download/draft-goland-http-udp-04.txt
|
|
||||||
|
|
||||||
2006-12-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
|
|
||||||
* Thorough revision of every call of http_MakeMessage() due to a
|
|
||||||
bug introduced in rev.79 "largefile patch added".
|
|
||||||
http_MakeMessage() has a worst than brain damaged "printf" like
|
|
||||||
interface. In rev.79, the "N" format parameter must be an off_t.
|
|
||||||
Every call of this function with an "N" format parameter and an
|
|
||||||
int passed on the stack would fail terribly.
|
|
||||||
|
|
||||||
* SF Bug tracker [ 1590469 ]
|
|
||||||
Typo in ixmlparser.c
|
|
||||||
Submitted By: Erik Johansson - erijo
|
|
||||||
|
|
||||||
* SF Bug Tracker [ 1590466 ] Invalid xml output
|
|
||||||
Submitted By: Erik Johansson - erijo
|
|
||||||
|
|
||||||
* SF Patch tracker [ 1581161 ] VStudio2005 patch
|
|
||||||
Submitted By: David Maass - darkservant
|
|
||||||
|
|
||||||
* SF Patch tracker [ 1587272 ] const-ified ixml
|
|
||||||
Submitted By: Erik Johansson
|
|
||||||
|
|
||||||
* Finished const-ifications as suggested by Erik Johansson in
|
|
||||||
SF Patch tracker [ 1587272 ].
|
|
||||||
|
|
||||||
2006-07-05 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
|
||||||
* [bug-id] 1580440
|
|
||||||
[submitted-by] Erik Johansson - erijo
|
|
||||||
[patched-by] Erik Johansson - erijo
|
|
||||||
The SOAP HTTP message that's generated on upnp errors
|
|
||||||
is missing a \r\n\ between header and body.
|
|
||||||
|
|
||||||
2006-07-07 Oxy <virtual_worlds(at)gmx.de>
|
|
||||||
|
|
||||||
* support for large files (>2 GBytes) added
|
|
||||||
|
|
||||||
|
|
||||||
*************************************************************************
|
|
||||||
Version 1.4.1
|
|
||||||
*************************************************************************
|
|
||||||
|
|
||||||
2006-07-07 Oxy <virtual_worlds(at)gmx.de>
|
2006-07-07 Oxy <virtual_worlds(at)gmx.de>
|
||||||
|
|
||||||
* full support for Windows added, static library and DLL are fully
|
* full support for Windows added, static library and DLL are fully
|
||||||
working, code compiles with Borland Builder C++ and MS Visual
|
working, code compiles with Borland Builder C++ and MS Visual
|
||||||
C/C++
|
C/C++
|
||||||
|
|
||||||
2006-07-05 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
2006-07-05 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||||
|
|
||||||
@@ -210,7 +28,7 @@ Version 1.4.1
|
|||||||
to loigu)
|
to loigu)
|
||||||
|
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
Version 1.4.0
|
Release of version 1.4.0
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
|
|
||||||
2006-05-26 Oxy <virtual_worlds(at)gmx.de>
|
2006-05-26 Oxy <virtual_worlds(at)gmx.de>
|
||||||
@@ -228,13 +46,10 @@ Version 1.4.0
|
|||||||
2006-05-18 Oxy <virtual_worlds(at)gmx.de>
|
2006-05-18 Oxy <virtual_worlds(at)gmx.de>
|
||||||
|
|
||||||
* DSM-320 patch added (fetched from project MediaTomb)
|
* DSM-320 patch added (fetched from project MediaTomb)
|
||||||
|
|
||||||
* httpGet additons atch added, Added proxy support by introducing
|
* httpGet additons atch added, Added proxy support by introducing
|
||||||
UpnpOpenHttpGetProxy. UpnpOpenHttpGet now just calls
|
UpnpOpenHttpGetProxy. UpnpOpenHttpGet now just calls
|
||||||
UpnpOpenHttpGetProxy with the proxy url set to NULL.
|
UpnpOpenHttpGetProxy with the proxy url set to NULL.
|
||||||
|
|
||||||
* Bugfix for typo ("\0" / "0") in ixmlparser.c
|
* Bugfix for typo ("\0" / "0") in ixmlparser.c
|
||||||
|
|
||||||
* Bugfix for M-Search packet
|
* Bugfix for M-Search packet
|
||||||
|
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
|
39
Makefile.am
39
Makefile.am
@@ -5,39 +5,40 @@
|
|||||||
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples
|
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples
|
||||||
|
|
||||||
SUBDIRS = ixml threadutil upnp docs/dist
|
SUBDIRS = ixml threadutil upnp docs/dist
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = libupnp.pc.in LICENSE THANKS libupnp.spec \
|
||||||
libupnp.pc.in \
|
build/libupnp.bpf \
|
||||||
LICENSE \
|
build/libupnp.bpr \
|
||||||
THANKS \
|
build/libupnp.dsp \
|
||||||
libupnp.spec \
|
build/libupnp.dsw \
|
||||||
build/libupnp.bpf \
|
build/inc/autoconfig.h \
|
||||||
build/libupnp.bpr \
|
build/inc/config.h \
|
||||||
build/libupnp.dsp \
|
build/inc/upnpconfig.h
|
||||||
build/libupnp.dsw \
|
|
||||||
build/inc/autoconfig.h \
|
|
||||||
build/inc/config.h \
|
|
||||||
build/inc/upnpconfig.h
|
|
||||||
|
|
||||||
|
|
||||||
# This variable must have 'exec' in its name, in order to be installed
|
# This variable must have 'exec' in its name, in order to be installed
|
||||||
# by 'install-exec' target (instead of default 'install-data')
|
# by 'install-exec' target (instead of default 'install-data')
|
||||||
pkgconfigexecdir = $(libdir)/pkgconfig
|
pkgconfigexecdir = $(libdir)/pkgconfig
|
||||||
pkgconfigexec_DATA = libupnp.pc
|
pkgconfigexec_DATA = libupnp.pc
|
||||||
|
|
||||||
$(pkgconfigexec_DATA): config.status
|
$(pkgconfigexec_DATA): config.status
|
||||||
|
|
||||||
|
|
||||||
if WITH_DOCUMENTATION
|
if WITH_DOCDIR
|
||||||
doc_DATA = LICENSE README NEWS TODO THANKS
|
docdir = @DOCDIR@
|
||||||
|
doc_DATA = LICENSE README NEWS TODO THANKS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
CLEANFILES = IUpnpErrFile.txt IUpnpInfoFile.txt
|
CLEANFILES = IUpnpErrFile.txt IUpnpInfoFile.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
23
THANKS
23
THANKS
@@ -6,25 +6,18 @@ suggesting various improvements or submitting actual code.
|
|||||||
Here is a list of these people. Help us keep it complete and
|
Here is a list of these people. Help us keep it complete and
|
||||||
exempt of errors.
|
exempt of errors.
|
||||||
|
|
||||||
- Arno Willig
|
|
||||||
- Chaos
|
|
||||||
- David Maass
|
|
||||||
- Emil Ljungdahl
|
|
||||||
- Erik Johansson
|
|
||||||
- Eric Tanguy
|
|
||||||
- Erwan Velu
|
- Erwan Velu
|
||||||
- Fredrik Svensson
|
- Paul Vixie
|
||||||
- Jiri Zouhar
|
- Arno Willig
|
||||||
|
- Eric Tanguy
|
||||||
|
- Oskar Liljeblad
|
||||||
|
- Chaos
|
||||||
- John Dennis
|
- John Dennis
|
||||||
- Jonathan (no_dice)
|
- Jiri Zouhar
|
||||||
- Leuk_He
|
|
||||||
- Loigu
|
- Loigu
|
||||||
- Luke Kim
|
- Marcelo Jimenez
|
||||||
- Marcelo Roberto Jimenez
|
|
||||||
- Markus Strobl
|
- Markus Strobl
|
||||||
- Nektarios K. Papadopoulos
|
- Nektarios K. Papadopoulos
|
||||||
- Oskar Liljeblad
|
- Oxy
|
||||||
- Michael (Oxy)
|
|
||||||
- Paul Vixie
|
|
||||||
- Siva Chandran
|
- Siva Chandran
|
||||||
|
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
|
||||||
#define MAX_JOBS_TOTAL 10
|
|
||||||
|
|
||||||
/** @name Compile time configuration options
|
/** @name Compile time configuration options
|
||||||
* The Linux SDK for UPnP Devices contains some compile-time parameters
|
* The Linux SDK for UPnP Devices contains some compile-time parameters
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
<RESFILES value=""/>
|
<RESFILES value=""/>
|
||||||
<DEFFILE value=""/>
|
<DEFFILE value=""/>
|
||||||
<RESDEPEN value="$(RESFILES)"/>
|
<RESDEPEN value="$(RESFILES)"/>
|
||||||
<LIBFILES value="D:\pthreads-w32-1-10-0-release\pthreadBC1.lib"/>
|
<LIBFILES value="..\..\..\pthreads-w32-1-10-0-release\pthreadBC1.lib"/>
|
||||||
<LIBRARIES value=""/>
|
<LIBRARIES value=""/>
|
||||||
<SPARELIBS value=""/>
|
<SPARELIBS value=""/>
|
||||||
<PACKAGES value=""/>
|
<PACKAGES value=""/>
|
||||||
@@ -45,11 +45,11 @@
|
|||||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
||||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
||||||
<LINKER value="tlink32"/>
|
<LINKER value="tlink32"/>
|
||||||
<USERDEFINES value="WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP"/>
|
<USERDEFINES value="WIN32;LIBUPNP_EXPORTS"/>
|
||||||
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
|
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
|
||||||
<MAINSOURCE value="libupnp.bpf"/>
|
<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"/>
|
<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"/>
|
||||||
<LIBPATH value="..\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"/>
|
<LIBPATH value="..\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"/>
|
||||||
<WARNINGS value="-w-par"/>
|
<WARNINGS value="-w-par"/>
|
||||||
</MACROS>
|
</MACROS>
|
||||||
<OPTIONS>
|
<OPTIONS>
|
||||||
@@ -94,27 +94,22 @@ ProductVersion=1.0.0.0
|
|||||||
Comments=
|
Comments=
|
||||||
|
|
||||||
[HistoryLists\hlIncludePath]
|
[HistoryLists\hlIncludePath]
|
||||||
Count=3
|
Count=1
|
||||||
Item0=..\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
|
Item0=..\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
|
||||||
Item1=..\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;D:\DEVELOP\pthreads-w32-1-10-0-release
|
|
||||||
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]
|
[HistoryLists\hlLibraryPath]
|
||||||
Count=3
|
Count=1
|
||||||
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
|
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
|
||||||
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]
|
[HistoryLists\hlDebugSourcePath]
|
||||||
Count=1
|
Count=1
|
||||||
Item0=$(BCB)\source\vcl
|
Item0=$(BCB)\source\vcl
|
||||||
|
|
||||||
[HistoryLists\hlConditionals]
|
[HistoryLists\hlConditionals]
|
||||||
Count=4
|
Count=3
|
||||||
Item0=WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP
|
Item0=WIN32;LIBUPNP_EXPORTS
|
||||||
Item1=WIN32;LIBUPNP_EXPORTS
|
Item1=WIN32;EXPORT_SPEC
|
||||||
Item2=WIN32;EXPORT_SPEC
|
Item2=WIN32
|
||||||
Item3=WIN32
|
|
||||||
|
|
||||||
[Debugging]
|
[Debugging]
|
||||||
DebugSourceDirs=$(BCB)\source\vcl
|
DebugSourceDirs=$(BCB)\source\vcl
|
||||||
|
@@ -43,7 +43,7 @@ RSC=rc.exe
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# 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 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" /D "UPNP_USE_MSVCPP" /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" /FR /YX /FD /c
|
||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
||||||
@@ -53,8 +53,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
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 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"
|
!ELSEIF "$(CFG)" == "libupnp - Win32 Debug"
|
||||||
|
|
||||||
@@ -70,7 +69,7 @@ LINK32=link.exe
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# 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 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" /D "UPNP_USE_MSVCPP" /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" /FR /YX /FD /GZ /c
|
||||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
||||||
@@ -80,7 +79,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
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 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
|
!ENDIF
|
||||||
|
|
||||||
@@ -275,146 +274,6 @@ SOURCE=..\upnp\src\win_dll.c
|
|||||||
# Begin Group "Header-Dateien"
|
# Begin Group "Header-Dateien"
|
||||||
|
|
||||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\client_table.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\config.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\gena.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\gena_ctrlpt.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\gena_device.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\global.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\gmtdate.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\http_client.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\httpparser.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\httpreadwrite.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\inet_pton.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\md5.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\membuffer.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\miniserver.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\netall.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\parsetools.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\server.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\service_table.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\soaplib.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\sock.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\ssdplib.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\statcodes.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\statuscodes.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\strintmap.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\sysdep.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\unixutil.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\upnp_timeout.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\upnpapi.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\upnpclosesocket.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\uri.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\urlconfig.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\util.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\utilall.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\uuid.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\upnp\src\inc\webserver.h
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Ressourcendateien"
|
# Begin Group "Ressourcendateien"
|
||||||
|
|
||||||
|
73
configure.ac
73
configure.ac
@@ -8,9 +8,9 @@
|
|||||||
# (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.59)
|
||||||
|
|
||||||
AC_INIT([libupnp], [1.4.4], [mroberto@users.sourceforge.net])
|
AC_INIT([libupnp], [1.4.1], [virtual_worlds@gmx.de])
|
||||||
# *Independently* of the above libupnp package version, the libtool version
|
# *Independently* of the above libupnp package version, the libtool version
|
||||||
# of the 3 libraries need to be updated whenever there is a change released :
|
# 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:
|
# "current:revision:age" (this is NOT the same as the package version), where:
|
||||||
@@ -19,34 +19,16 @@ AC_INIT([libupnp], [1.4.4], [mroberto@users.sourceforge.net])
|
|||||||
# - interfaces added: age++
|
# - interfaces added: age++
|
||||||
# - interfaces removed: age=0
|
# - interfaces removed: age=0
|
||||||
# *please update only once, before a formal release, not for each change*
|
# *please update only once, before a formal release, not for each change*
|
||||||
#
|
AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||||
# For release 1.4.1, we had:
|
AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||||
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||||
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
|
||||||
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
|
||||||
#
|
|
||||||
# "current:revision:age"
|
|
||||||
#
|
|
||||||
# - Code has changed in ixml
|
|
||||||
# revision: 2 -> 3
|
|
||||||
# - Code has changed in threadutil
|
|
||||||
# revision: 2 -> 3
|
|
||||||
# - Interface added in threadutil
|
|
||||||
# current: 2 -> 3
|
|
||||||
# revisiion: 3 -> 0
|
|
||||||
# age: 0 -> 1
|
|
||||||
# - Code has changed in upnp (revision 2 -> 3)
|
|
||||||
# revision: 2 -> 3
|
|
||||||
AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
|
||||||
AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
|
||||||
AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR(config.aux)
|
AC_CONFIG_AUX_DIR(config.aux)
|
||||||
AC_CONFIG_MACRO_DIR(m4)
|
AC_CONFIG_MACRO_DIR(m4)
|
||||||
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects])
|
||||||
|
|
||||||
#
|
#
|
||||||
# There are 3 configuration files :
|
# There are 3 configuration files :
|
||||||
@@ -60,7 +42,6 @@ AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
|||||||
# installed libraries.
|
# installed libraries.
|
||||||
#
|
#
|
||||||
AC_CONFIG_HEADERS([autoconfig.h upnp/inc/upnpconfig.h])
|
AC_CONFIG_HEADERS([autoconfig.h upnp/inc/upnpconfig.h])
|
||||||
#AC_SYS_LARGEFILE_SENSITIVE
|
|
||||||
|
|
||||||
AC_REVISION([$Revision: 1.11 $])
|
AC_REVISION([$Revision: 1.11 $])
|
||||||
|
|
||||||
@@ -125,28 +106,19 @@ RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
|
|||||||
|
|
||||||
|
|
||||||
# doc installation
|
# doc installation
|
||||||
# autoconf >= 2.60 already defines ${docdir}, but we will not use its
|
AC_MSG_CHECKING([documentation installation])
|
||||||
# default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}.
|
AC_ARG_WITH([docdir],
|
||||||
# That would give us ${datarootdir}/doc/libupnp, and we want the package
|
AC_HELP_STRING([--with-docdir=DIR],
|
||||||
# version on that.
|
[where documentation is installed
|
||||||
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
|
@<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@])
|
||||||
AC_MSG_CHECKING([for documentation directory])
|
AC_HELP_STRING([--without-docdir],
|
||||||
AC_ARG_WITH([documentation],
|
[do not install the documentation]),
|
||||||
AS_HELP_STRING([--with-documentation=directory_name],
|
[DOCDIR="$with_docdir"],
|
||||||
[where documentation is installed
|
[DOCDIR="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"])
|
||||||
@<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@])
|
|
||||||
AS_HELP_STRING([--without-documentation],
|
|
||||||
[do not install the documentation]),
|
|
||||||
[],
|
|
||||||
[with_documentation=no])
|
|
||||||
|
|
||||||
# If something has been entered after an equal sign, assume it is the directory
|
AM_CONDITIONAL(WITH_DOCDIR, test x"$with_docdir" != xno)
|
||||||
if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then
|
AC_SUBST(DOCDIR)
|
||||||
docdir="$with_documentation"
|
AC_MSG_RESULT($DOCDIR)
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(WITH_DOCUMENTATION, test x"$with_documentation" != xno)
|
|
||||||
AC_SUBST(docdir)
|
|
||||||
AC_MSG_RESULT($docdir)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -172,12 +144,9 @@ else
|
|||||||
fi
|
fi
|
||||||
AX_CFLAGS_WARN_ALL
|
AX_CFLAGS_WARN_ALL
|
||||||
|
|
||||||
#
|
# Arrange for large-file support (can be disabled with --disable-largefile).
|
||||||
# Lot's of stuff to ensure large file support
|
# Define _FILE_OFFSET_BITS and _LARGE_FILES if necessary
|
||||||
#
|
AC_SYS_LARGEFILE
|
||||||
AC_TYPE_OFF_T
|
|
||||||
AC_DEFINE(_LARGE_FILE_SOURCE, [], [Large files support])
|
|
||||||
AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
13
docs/dist/Makefile.am
vendored
13
docs/dist/Makefile.am
vendored
@@ -1,7 +1,4 @@
|
|||||||
|
EXTRA_DIST = ./UPnP_Programming_Guide.pdf \
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
./UPnP_Programming_Guide.pdf \
|
|
||||||
./IXML_Programming_Guide.pdf \
|
./IXML_Programming_Guide.pdf \
|
||||||
./html/upnp/icon1.gif \
|
./html/upnp/icon1.gif \
|
||||||
./html/upnp/icon2.gif \
|
./html/upnp/icon2.gif \
|
||||||
@@ -254,10 +251,9 @@ EXTRA_DIST = \
|
|||||||
./html/ixml/ixmlCloneDOMString.html \
|
./html/ixml/ixmlCloneDOMString.html \
|
||||||
./html/ixml/ixmlFreeDOMString.html
|
./html/ixml/ixmlFreeDOMString.html
|
||||||
|
|
||||||
if WITH_DOCUMENTATION
|
if WITH_DOCDIR
|
||||||
docsdir = @docdir@
|
docsdir = @DOCDIR@
|
||||||
nobase_docs_DATA = \
|
nobase_docs_DATA = ./UPnP_Programming_Guide.pdf \
|
||||||
./UPnP_Programming_Guide.pdf \
|
|
||||||
./IXML_Programming_Guide.pdf \
|
./IXML_Programming_Guide.pdf \
|
||||||
./html/upnp/icon1.gif \
|
./html/upnp/icon1.gif \
|
||||||
./html/upnp/icon2.gif \
|
./html/upnp/icon2.gif \
|
||||||
@@ -510,4 +506,3 @@ if WITH_DOCUMENTATION
|
|||||||
./html/ixml/ixmlCloneDOMString.html \
|
./html/ixml/ixmlCloneDOMString.html \
|
||||||
./html/ixml/ixmlFreeDOMString.html
|
./html/ixml/ixmlFreeDOMString.html
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
102
ixml/inc/ixml.h
102
ixml/inc/ixml.h
@@ -260,7 +260,7 @@ ixmlNode_getNodeName(IXML_Node *nodeptr
|
|||||||
* @return [DOMString] A {\bf DOMString} of the {\bf Node} value.
|
* @return [DOMString] A {\bf DOMString} of the {\bf Node} value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC const DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlNode_getNodeValue(IXML_Node *nodeptr
|
ixmlNode_getNodeValue(IXML_Node *nodeptr
|
||||||
/** Pointer to the {\bf Node} to retrieve the value. */
|
/** Pointer to the {\bf Node} to retrieve the value. */
|
||||||
);
|
);
|
||||||
@@ -282,7 +282,7 @@ ixmlNode_getNodeValue(IXML_Node *nodeptr
|
|||||||
EXPORT_SPEC int
|
EXPORT_SPEC int
|
||||||
ixmlNode_setNodeValue(IXML_Node *nodeptr,
|
ixmlNode_setNodeValue(IXML_Node *nodeptr,
|
||||||
/** The {\bf Node} to which to assign a new value. */
|
/** The {\bf Node} to which to assign a new value. */
|
||||||
const char *newNodeValue
|
char *newNodeValue
|
||||||
/** The new value of the {\bf Node}. */
|
/** The new value of the {\bf Node}. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -439,7 +439,7 @@ ixmlNode_getNamespaceURI(IXML_Node *nodeptr
|
|||||||
* or {\tt NULL}.
|
* or {\tt NULL}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC const DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlNode_getPrefix(IXML_Node *nodeptr
|
ixmlNode_getPrefix(IXML_Node *nodeptr
|
||||||
/** The {\bf Node} from which to retrieve the prefix. */
|
/** The {\bf Node} from which to retrieve the prefix. */
|
||||||
);
|
);
|
||||||
@@ -867,7 +867,7 @@ EXPORT_SPEC int
|
|||||||
ixmlDocument_createCDATASectionEx(IXML_Document *doc,
|
ixmlDocument_createCDATASectionEx(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
node. */
|
node. */
|
||||||
const DOMString data,
|
DOMString data,
|
||||||
/** The data to associate with the new
|
/** The data to associate with the new
|
||||||
{\bf CDATASection} node. */
|
{\bf CDATASection} node. */
|
||||||
IXML_CDATASection** cdNode
|
IXML_CDATASection** cdNode
|
||||||
@@ -886,7 +886,7 @@ EXPORT_SPEC IXML_CDATASection*
|
|||||||
ixmlDocument_createCDATASection(IXML_Document *doc,
|
ixmlDocument_createCDATASection(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
node. */
|
node. */
|
||||||
const DOMString data
|
DOMString data
|
||||||
/** The data to associate with the new {\bf
|
/** The data to associate with the new {\bf
|
||||||
CDATASection} node. */
|
CDATASection} node. */
|
||||||
);
|
);
|
||||||
@@ -899,7 +899,7 @@ ixmlDocument_createCDATASection(IXML_Document *doc,
|
|||||||
EXPORT_SPEC IXML_Attr*
|
EXPORT_SPEC IXML_Attr*
|
||||||
ixmlDocument_createAttribute(IXML_Document *doc,
|
ixmlDocument_createAttribute(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new node. */
|
/** The owner {\bf Document} of the new node. */
|
||||||
const char *name
|
char *name
|
||||||
/** The name of the new attribute. */
|
/** The name of the new attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -924,7 +924,7 @@ EXPORT_SPEC int
|
|||||||
ixmlDocument_createAttributeEx(IXML_Document *doc,
|
ixmlDocument_createAttributeEx(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
node. */
|
node. */
|
||||||
const char *name,
|
char *name,
|
||||||
/** The name of the new attribute. */
|
/** The name of the new attribute. */
|
||||||
IXML_Attr** attrNode
|
IXML_Attr** attrNode
|
||||||
/** A pointer to a {\bf Attr} where the new
|
/** A pointer to a {\bf Attr} where the new
|
||||||
@@ -943,7 +943,7 @@ ixmlDocument_createAttributeEx(IXML_Document *doc,
|
|||||||
EXPORT_SPEC IXML_NodeList*
|
EXPORT_SPEC IXML_NodeList*
|
||||||
ixmlDocument_getElementsByTagName(IXML_Document *doc,
|
ixmlDocument_getElementsByTagName(IXML_Document *doc,
|
||||||
/** The {\bf Document} to search. */
|
/** The {\bf Document} to search. */
|
||||||
const DOMString tagName
|
DOMString tagName
|
||||||
/** The tag name to find. */
|
/** The tag name to find. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -970,10 +970,10 @@ EXPORT_SPEC int
|
|||||||
ixmlDocument_createElementNSEx(IXML_Document *doc,
|
ixmlDocument_createElementNSEx(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
node. */
|
node. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI for the new {\bf
|
/** The namespace URI for the new {\bf
|
||||||
Element}. */
|
Element}. */
|
||||||
const DOMString qualifiedName,
|
DOMString qualifiedName,
|
||||||
/** The qualified name of the new {\bf
|
/** The qualified name of the new {\bf
|
||||||
Element}. */
|
Element}. */
|
||||||
IXML_Element** rtElement
|
IXML_Element** rtElement
|
||||||
@@ -992,10 +992,10 @@ ixmlDocument_createElementNSEx(IXML_Document *doc,
|
|||||||
EXPORT_SPEC IXML_Element*
|
EXPORT_SPEC IXML_Element*
|
||||||
ixmlDocument_createElementNS(IXML_Document *doc,
|
ixmlDocument_createElementNS(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new node. */
|
/** The owner {\bf Document} of the new node. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI for the new {\bf
|
/** The namespace URI for the new {\bf
|
||||||
Element}. */
|
Element}. */
|
||||||
const DOMString qualifiedName
|
DOMString qualifiedName
|
||||||
/** The qualified name of the new {\bf
|
/** The qualified name of the new {\bf
|
||||||
Element}. */
|
Element}. */
|
||||||
);
|
);
|
||||||
@@ -1021,9 +1021,9 @@ EXPORT_SPEC int
|
|||||||
ixmlDocument_createAttributeNSEx(IXML_Document *doc,
|
ixmlDocument_createAttributeNSEx(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
{\bf Attr}. */
|
{\bf Attr}. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI for the attribute. */
|
/** The namespace URI for the attribute. */
|
||||||
const DOMString qualifiedName,
|
DOMString qualifiedName,
|
||||||
/** The qualified name of the attribute. */
|
/** The qualified name of the attribute. */
|
||||||
IXML_Attr** attrNode
|
IXML_Attr** attrNode
|
||||||
/** A pointer to an {\bf Attr} where the
|
/** A pointer to an {\bf Attr} where the
|
||||||
@@ -1040,9 +1040,9 @@ EXPORT_SPEC IXML_Attr*
|
|||||||
ixmlDocument_createAttributeNS(IXML_Document *doc,
|
ixmlDocument_createAttributeNS(IXML_Document *doc,
|
||||||
/** The owner {\bf Document} of the new
|
/** The owner {\bf Document} of the new
|
||||||
{\bf Attr}. */
|
{\bf Attr}. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI for the attribute. */
|
/** The namespace URI for the attribute. */
|
||||||
const DOMString qualifiedName
|
DOMString qualifiedName
|
||||||
/** The qualified name of the attribute. */
|
/** The qualified name of the attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1059,11 +1059,11 @@ ixmlDocument_createAttributeNS(IXML_Document *doc,
|
|||||||
EXPORT_SPEC IXML_NodeList*
|
EXPORT_SPEC IXML_NodeList*
|
||||||
ixmlDocument_getElementsByTagNameNS(IXML_Document* doc,
|
ixmlDocument_getElementsByTagNameNS(IXML_Document* doc,
|
||||||
/** The {\bf Document} to search. */
|
/** The {\bf Document} to search. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace of the elements to
|
/** The namespace of the elements to
|
||||||
find or {\tt "*"} to match any
|
find or {\tt "*"} to match any
|
||||||
namespace. */
|
namespace. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the elements to
|
/** The local name of the elements to
|
||||||
find or {\tt "*"} to match any local
|
find or {\tt "*"} to match any local
|
||||||
name. */
|
name. */
|
||||||
@@ -1079,7 +1079,7 @@ EXPORT_SPEC IXML_Element*
|
|||||||
ixmlDocument_getElementById(IXML_Document* doc,
|
ixmlDocument_getElementById(IXML_Document* doc,
|
||||||
/** The owner {\bf Document} of the {\bf
|
/** The owner {\bf Document} of the {\bf
|
||||||
Element}. */
|
Element}. */
|
||||||
const DOMString tagName
|
DOMString tagName
|
||||||
/** The name of the {\bf Element}.*/
|
/** The name of the {\bf Element}.*/
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1174,11 +1174,11 @@ ixmlElement_getTagName(IXML_Element* element
|
|||||||
* attribute.
|
* attribute.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC const DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlElement_getAttribute(IXML_Element* element,
|
ixmlElement_getAttribute(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to retrieve the
|
/** The {\bf Element} from which to retrieve the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the attribute to retrieve. */
|
/** The name of the attribute to retrieve. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1202,9 +1202,9 @@ EXPORT_SPEC int
|
|||||||
ixmlElement_setAttribute(IXML_Element* element,
|
ixmlElement_setAttribute(IXML_Element* element,
|
||||||
/** The {\bf Element} on which to set the
|
/** The {\bf Element} on which to set the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString name,
|
DOMString name,
|
||||||
/** The name of the attribute. */
|
/** The name of the attribute. */
|
||||||
const DOMString value
|
DOMString value
|
||||||
/** The value of the attribute. Note that this is
|
/** The value of the attribute. Note that this is
|
||||||
a non-parsed string and any markup must be
|
a non-parsed string and any markup must be
|
||||||
escaped. */
|
escaped. */
|
||||||
@@ -1224,7 +1224,7 @@ EXPORT_SPEC int
|
|||||||
ixmlElement_removeAttribute(IXML_Element* element,
|
ixmlElement_removeAttribute(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to remove the
|
/** The {\bf Element} from which to remove the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the attribute to remove. */
|
/** The name of the attribute to remove. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1240,7 +1240,7 @@ EXPORT_SPEC IXML_Attr*
|
|||||||
ixmlElement_getAttributeNode(IXML_Element* element,
|
ixmlElement_getAttributeNode(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to get the
|
/** The {\bf Element} from which to get the
|
||||||
attribute node. */
|
attribute node. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the attribute node to find. */
|
/** The name of the attribute node to find. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1309,7 +1309,7 @@ EXPORT_SPEC IXML_NodeList*
|
|||||||
ixmlElement_getElementsByTagName(IXML_Element* element,
|
ixmlElement_getElementsByTagName(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to start
|
/** The {\bf Element} from which to start
|
||||||
the search. */
|
the search. */
|
||||||
const DOMString tagName
|
DOMString tagName
|
||||||
/** The name of the tag for which to
|
/** The name of the tag for which to
|
||||||
search. */
|
search. */
|
||||||
);
|
);
|
||||||
@@ -1322,13 +1322,13 @@ ixmlElement_getElementsByTagName(IXML_Element* element,
|
|||||||
* matching attribute.
|
* matching attribute.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC const DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlElement_getAttributeNS(IXML_Element* element,
|
ixmlElement_getAttributeNS(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to get the
|
/** The {\bf Element} from which to get the
|
||||||
attribute value. */
|
attribute value. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the attribute. */
|
/** The namespace URI of the attribute. */
|
||||||
const DOMString localname
|
DOMString localname
|
||||||
/** The local name of the attribute. */
|
/** The local name of the attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1358,11 +1358,11 @@ EXPORT_SPEC int
|
|||||||
ixmlElement_setAttributeNS(IXML_Element* element,
|
ixmlElement_setAttributeNS(IXML_Element* element,
|
||||||
/** The {\bf Element} on which to set the
|
/** The {\bf Element} on which to set the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the new attribute. */
|
/** The namespace URI of the new attribute. */
|
||||||
const DOMString qualifiedName,
|
DOMString qualifiedName,
|
||||||
/** The qualified name of the attribute. */
|
/** The qualified name of the attribute. */
|
||||||
const DOMString value
|
DOMString value
|
||||||
/** The new value for the attribute. */
|
/** The new value for the attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1380,9 +1380,9 @@ EXPORT_SPEC int
|
|||||||
ixmlElement_removeAttributeNS(IXML_Element* element,
|
ixmlElement_removeAttributeNS(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to remove the
|
/** The {\bf Element} from which to remove the
|
||||||
the attribute. */
|
the attribute. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the attribute. */
|
/** The namespace URI of the attribute. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the attribute.*/
|
/** The local name of the attribute.*/
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1395,9 +1395,9 @@ EXPORT_SPEC IXML_Attr*
|
|||||||
ixmlElement_getAttributeNodeNS(IXML_Element* element,
|
ixmlElement_getAttributeNodeNS(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to get the
|
/** The {\bf Element} from which to get the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the attribute. */
|
/** The namespace URI of the attribute. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the attribute. */
|
/** The local name of the attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1441,10 +1441,10 @@ EXPORT_SPEC IXML_NodeList*
|
|||||||
ixmlElement_getElementsByTagNameNS(IXML_Element* element,
|
ixmlElement_getElementsByTagNameNS(IXML_Element* element,
|
||||||
/** The {\bf Element} from which to start
|
/** The {\bf Element} from which to start
|
||||||
the search. */
|
the search. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the {\bf
|
/** The namespace URI of the {\bf
|
||||||
Element}s to find. */
|
Element}s to find. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the {\bf Element}s
|
/** The local name of the {\bf Element}s
|
||||||
to find. */
|
to find. */
|
||||||
);
|
);
|
||||||
@@ -1461,7 +1461,7 @@ EXPORT_SPEC BOOL
|
|||||||
ixmlElement_hasAttribute(IXML_Element* element,
|
ixmlElement_hasAttribute(IXML_Element* element,
|
||||||
/** The {\bf Element} on which to check for an
|
/** The {\bf Element} on which to check for an
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the attribute for which to check. */
|
/** The name of the attribute for which to check. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1477,9 +1477,9 @@ EXPORT_SPEC BOOL
|
|||||||
ixmlElement_hasAttributeNS(IXML_Element* element,
|
ixmlElement_hasAttributeNS(IXML_Element* element,
|
||||||
/** The {\bf Element} on which to check for the
|
/** The {\bf Element} on which to check for the
|
||||||
attribute. */
|
attribute. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the attribute. */
|
/** The namespace URI of the attribute. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the attribute. */
|
/** The local name of the attribute. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1529,7 +1529,7 @@ ixmlNamedNodeMap_getLength(IXML_NamedNodeMap *nnMap
|
|||||||
EXPORT_SPEC IXML_Node*
|
EXPORT_SPEC IXML_Node*
|
||||||
ixmlNamedNodeMap_getNamedItem(IXML_NamedNodeMap *nnMap,
|
ixmlNamedNodeMap_getNamedItem(IXML_NamedNodeMap *nnMap,
|
||||||
/** The {\bf NamedNodeMap} to search. */
|
/** The {\bf NamedNodeMap} to search. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the {\bf Node} to find. */
|
/** The name of the {\bf Node} to find. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1560,7 +1560,7 @@ EXPORT_SPEC IXML_Node*
|
|||||||
ixmlNamedNodeMap_removeNamedItem(IXML_NamedNodeMap *nnMap,
|
ixmlNamedNodeMap_removeNamedItem(IXML_NamedNodeMap *nnMap,
|
||||||
/** The {\bf NamedNodeMap} from which to
|
/** The {\bf NamedNodeMap} from which to
|
||||||
remove the item. */
|
remove the item. */
|
||||||
const DOMString name
|
DOMString name
|
||||||
/** The name of the item to remove. */
|
/** The name of the item to remove. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1592,10 +1592,10 @@ EXPORT_SPEC IXML_Node*
|
|||||||
ixmlNamedNodeMap_getNamedItemNS(IXML_NamedNodeMap *nnMap,
|
ixmlNamedNodeMap_getNamedItemNS(IXML_NamedNodeMap *nnMap,
|
||||||
/** The {\bf NamedNodeMap} from which to
|
/** The {\bf NamedNodeMap} from which to
|
||||||
remove the {\bf Node}. */
|
remove the {\bf Node}. */
|
||||||
const DOMString *namespaceURI,
|
DOMString *namespaceURI,
|
||||||
/** The namespace URI of the {\bf Node} to
|
/** The namespace URI of the {\bf Node} to
|
||||||
remove. */
|
remove. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the {\bf Node} to
|
/** The local name of the {\bf Node} to
|
||||||
remove. */
|
remove. */
|
||||||
);
|
);
|
||||||
@@ -1627,10 +1627,10 @@ EXPORT_SPEC IXML_Node*
|
|||||||
ixmlNamedNodeMap_removeNamedItemNS(IXML_NamedNodeMap *nnMap,
|
ixmlNamedNodeMap_removeNamedItemNS(IXML_NamedNodeMap *nnMap,
|
||||||
/** The {\bf NamedNodeMap} from which to
|
/** The {\bf NamedNodeMap} from which to
|
||||||
remove the {\bf Node}. */
|
remove the {\bf Node}. */
|
||||||
const DOMString namespaceURI,
|
DOMString namespaceURI,
|
||||||
/** The namespace URI of the {\bf Node}
|
/** The namespace URI of the {\bf Node}
|
||||||
to remove. */
|
to remove. */
|
||||||
const DOMString localName
|
DOMString localName
|
||||||
/** The local name of the {\bf Node} to
|
/** The local name of the {\bf Node} to
|
||||||
remove. */
|
remove. */
|
||||||
);
|
);
|
||||||
@@ -1819,7 +1819,7 @@ ixmlRelaxParser(char errorChar);
|
|||||||
* {\tt NULL} on an error.
|
* {\tt NULL} on an error.
|
||||||
*/
|
*/
|
||||||
EXPORT_SPEC IXML_Document*
|
EXPORT_SPEC IXML_Document*
|
||||||
ixmlParseBuffer(const char *buffer
|
ixmlParseBuffer(char *buffer
|
||||||
/** The buffer that contains the XML text to convert to a
|
/** The buffer that contains the XML text to convert to a
|
||||||
{\bf Document}. */
|
{\bf Document}. */
|
||||||
);
|
);
|
||||||
@@ -1842,7 +1842,7 @@ ixmlParseBuffer(const char *buffer
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC int
|
EXPORT_SPEC int
|
||||||
ixmlParseBufferEx(const char *buffer,
|
ixmlParseBufferEx(char *buffer,
|
||||||
/** The buffer that contains the XML text to convert to a
|
/** The buffer that contains the XML text to convert to a
|
||||||
{\bf Document}. */
|
{\bf Document}. */
|
||||||
IXML_Document** doc
|
IXML_Document** doc
|
||||||
@@ -1857,7 +1857,7 @@ ixmlParseBufferEx(const char *buffer,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC IXML_Document*
|
EXPORT_SPEC IXML_Document*
|
||||||
ixmlLoadDocument(const char* xmlFile
|
ixmlLoadDocument(char* xmlFile
|
||||||
/** The filename of the XML text to convert to a {\bf
|
/** The filename of the XML text to convert to a {\bf
|
||||||
Document}. */
|
Document}. */
|
||||||
);
|
);
|
||||||
@@ -1879,7 +1879,7 @@ ixmlLoadDocument(const char* xmlFile
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC int
|
EXPORT_SPEC int
|
||||||
ixmlLoadDocumentEx(const char* xmlFile,
|
ixmlLoadDocumentEx(char* xmlFile,
|
||||||
/** The filename of the XML text to convert to a {\bf
|
/** The filename of the XML text to convert to a {\bf
|
||||||
Document}. */
|
Document}. */
|
||||||
IXML_Document** doc
|
IXML_Document** doc
|
||||||
|
@@ -373,7 +373,7 @@ ixmlDocument_createTextNode( IN IXML_Document * doc,
|
|||||||
================================================================*/
|
================================================================*/
|
||||||
int
|
int
|
||||||
ixmlDocument_createAttributeEx( IN IXML_Document * doc,
|
ixmlDocument_createAttributeEx( IN IXML_Document * doc,
|
||||||
IN const char *name,
|
IN char *name,
|
||||||
OUT IXML_Attr ** rtAttr )
|
OUT IXML_Attr ** rtAttr )
|
||||||
{
|
{
|
||||||
IXML_Attr *attrNode = NULL;
|
IXML_Attr *attrNode = NULL;
|
||||||
@@ -427,7 +427,7 @@ ixmlDocument_createAttributeEx( IN IXML_Document * doc,
|
|||||||
================================================================*/
|
================================================================*/
|
||||||
IXML_Attr *
|
IXML_Attr *
|
||||||
ixmlDocument_createAttribute( IN IXML_Document * doc,
|
ixmlDocument_createAttribute( IN IXML_Document * doc,
|
||||||
IN const char *name )
|
IN char *name )
|
||||||
{
|
{
|
||||||
IXML_Attr *attrNode = NULL;
|
IXML_Attr *attrNode = NULL;
|
||||||
|
|
||||||
@@ -451,8 +451,8 @@ ixmlDocument_createAttribute( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlDocument_createAttributeNSEx( IN IXML_Document * doc,
|
ixmlDocument_createAttributeNSEx( IN IXML_Document * doc,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString qualifiedName,
|
IN DOMString qualifiedName,
|
||||||
OUT IXML_Attr ** rtAttr )
|
OUT IXML_Attr ** rtAttr )
|
||||||
{
|
{
|
||||||
IXML_Attr *attrNode = NULL;
|
IXML_Attr *attrNode = NULL;
|
||||||
@@ -507,8 +507,8 @@ ixmlDocument_createAttributeNSEx( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Attr *
|
IXML_Attr *
|
||||||
ixmlDocument_createAttributeNS( IN IXML_Document * doc,
|
ixmlDocument_createAttributeNS( IN IXML_Document * doc,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString qualifiedName )
|
IN DOMString qualifiedName )
|
||||||
{
|
{
|
||||||
IXML_Attr *attrNode = NULL;
|
IXML_Attr *attrNode = NULL;
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ ixmlDocument_createAttributeNS( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlDocument_createCDATASectionEx( IN IXML_Document * doc,
|
ixmlDocument_createCDATASectionEx( IN IXML_Document * doc,
|
||||||
IN const DOMString data,
|
IN DOMString data,
|
||||||
OUT IXML_CDATASection ** rtCD )
|
OUT IXML_CDATASection ** rtCD )
|
||||||
{
|
{
|
||||||
int errCode = IXML_SUCCESS;
|
int errCode = IXML_SUCCESS;
|
||||||
@@ -588,7 +588,7 @@ ixmlDocument_createCDATASectionEx( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_CDATASection *
|
IXML_CDATASection *
|
||||||
ixmlDocument_createCDATASection( IN IXML_Document * doc,
|
ixmlDocument_createCDATASection( IN IXML_Document * doc,
|
||||||
IN const DOMString data )
|
IN DOMString data )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_CDATASection *cDSectionNode = NULL;
|
IXML_CDATASection *cDSectionNode = NULL;
|
||||||
@@ -613,8 +613,8 @@ ixmlDocument_createCDATASection( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlDocument_createElementNSEx( IN IXML_Document * doc,
|
ixmlDocument_createElementNSEx( IN IXML_Document * doc,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString qualifiedName,
|
IN DOMString qualifiedName,
|
||||||
OUT IXML_Element ** rtElement )
|
OUT IXML_Element ** rtElement )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -673,8 +673,8 @@ ixmlDocument_createElementNSEx( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Element *
|
IXML_Element *
|
||||||
ixmlDocument_createElementNS( IN IXML_Document * doc,
|
ixmlDocument_createElementNS( IN IXML_Document * doc,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString qualifiedName )
|
IN DOMString qualifiedName )
|
||||||
{
|
{
|
||||||
IXML_Element *newElement = NULL;
|
IXML_Element *newElement = NULL;
|
||||||
|
|
||||||
@@ -698,7 +698,7 @@ ixmlDocument_createElementNS( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_NodeList *
|
IXML_NodeList *
|
||||||
ixmlDocument_getElementsByTagName( IN IXML_Document * doc,
|
ixmlDocument_getElementsByTagName( IN IXML_Document * doc,
|
||||||
IN const char *tagName )
|
IN char *tagName )
|
||||||
{
|
{
|
||||||
IXML_NodeList *returnNodeList = NULL;
|
IXML_NodeList *returnNodeList = NULL;
|
||||||
|
|
||||||
@@ -728,8 +728,8 @@ ixmlDocument_getElementsByTagName( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_NodeList *
|
IXML_NodeList *
|
||||||
ixmlDocument_getElementsByTagNameNS( IN IXML_Document * doc,
|
ixmlDocument_getElementsByTagNameNS( IN IXML_Document * doc,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
IXML_NodeList *returnNodeList = NULL;
|
IXML_NodeList *returnNodeList = NULL;
|
||||||
|
|
||||||
@@ -756,7 +756,7 @@ ixmlDocument_getElementsByTagNameNS( IN IXML_Document * doc,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Element *
|
IXML_Element *
|
||||||
ixmlDocument_getElementById( IN IXML_Document * doc,
|
ixmlDocument_getElementById( IN IXML_Document * doc,
|
||||||
IN const DOMString tagName )
|
IN DOMString tagName )
|
||||||
{
|
{
|
||||||
IXML_Element *rtElement = NULL;
|
IXML_Element *rtElement = NULL;
|
||||||
IXML_Node *nodeptr = ( IXML_Node * ) doc;
|
IXML_Node *nodeptr = ( IXML_Node * ) doc;
|
||||||
|
@@ -71,7 +71,7 @@ ixmlElement_getTagName( IN IXML_Element * element )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlElement_setTagName( IN IXML_Element * element,
|
ixmlElement_setTagName( IN IXML_Element * element,
|
||||||
IN const char *tagName )
|
IN char *tagName )
|
||||||
{
|
{
|
||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
|
|
||||||
@@ -104,9 +104,9 @@ ixmlElement_setTagName( IN IXML_Element * element,
|
|||||||
* does not have a specified value.
|
* does not have a specified value.
|
||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
const DOMString
|
DOMString
|
||||||
ixmlElement_getAttribute( IN IXML_Element * element,
|
ixmlElement_getAttribute( IN IXML_Element * element,
|
||||||
IN const DOMString name )
|
IN DOMString name )
|
||||||
{
|
{
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
|
|
||||||
@@ -142,8 +142,8 @@ ixmlElement_getAttribute( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlElement_setAttribute( IN IXML_Element * element,
|
ixmlElement_setAttribute( IN IXML_Element * element,
|
||||||
IN const char *name,
|
IN char *name,
|
||||||
IN const char *value )
|
IN char *value )
|
||||||
{
|
{
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
IXML_Attr *newAttrNode;
|
IXML_Attr *newAttrNode;
|
||||||
@@ -221,7 +221,7 @@ ixmlElement_setAttribute( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlElement_removeAttribute( IN IXML_Element * element,
|
ixmlElement_removeAttribute( IN IXML_Element * element,
|
||||||
IN const char *name )
|
IN char *name )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
@@ -262,7 +262,7 @@ ixmlElement_removeAttribute( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Attr *
|
IXML_Attr *
|
||||||
ixmlElement_getAttributeNode( IN IXML_Element * element,
|
ixmlElement_getAttributeNode( IN IXML_Element * element,
|
||||||
IN const char *name )
|
IN char *name )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
@@ -483,7 +483,7 @@ ixmlElement_removeAttributeNode( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_NodeList *
|
IXML_NodeList *
|
||||||
ixmlElement_getElementsByTagName( IN IXML_Element * element,
|
ixmlElement_getElementsByTagName( IN IXML_Element * element,
|
||||||
IN const char *tagName )
|
IN char *tagName )
|
||||||
{
|
{
|
||||||
IXML_NodeList *returnNodeList = NULL;
|
IXML_NodeList *returnNodeList = NULL;
|
||||||
|
|
||||||
@@ -508,10 +508,10 @@ ixmlElement_getElementsByTagName( IN IXML_Element * element,
|
|||||||
* not have the specified value.
|
* not have the specified value.
|
||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
const DOMString
|
DOMString
|
||||||
ixmlElement_getAttributeNS( IN IXML_Element * element,
|
ixmlElement_getAttributeNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
|
|
||||||
@@ -553,9 +553,9 @@ ixmlElement_getAttributeNS( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlElement_setAttributeNS( IN IXML_Element * element,
|
ixmlElement_setAttributeNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString qualifiedName,
|
IN DOMString qualifiedName,
|
||||||
IN const DOMString value )
|
IN DOMString value )
|
||||||
{
|
{
|
||||||
IXML_Node *attrNode = NULL;
|
IXML_Node *attrNode = NULL;
|
||||||
IXML_Node newAttrNode;
|
IXML_Node newAttrNode;
|
||||||
@@ -672,8 +672,8 @@ ixmlElement_setAttributeNS( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlElement_removeAttributeNS( IN IXML_Element * element,
|
ixmlElement_removeAttributeNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
|
|
||||||
@@ -719,8 +719,8 @@ ixmlElement_removeAttributeNS( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Attr *
|
IXML_Attr *
|
||||||
ixmlElement_getAttributeNodeNS( IN IXML_Element * element,
|
ixmlElement_getAttributeNodeNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
@@ -861,8 +861,8 @@ ixmlElement_setAttributeNodeNS( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_NodeList *
|
IXML_NodeList *
|
||||||
ixmlElement_getElementsByTagNameNS( IN IXML_Element * element,
|
ixmlElement_getElementsByTagNameNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
IXML_Node *node = ( IXML_Node * ) element;
|
IXML_Node *node = ( IXML_Node * ) element;
|
||||||
IXML_NodeList *nodeList = NULL;
|
IXML_NodeList *nodeList = NULL;
|
||||||
@@ -892,7 +892,7 @@ ixmlElement_getElementsByTagNameNS( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
BOOL
|
BOOL
|
||||||
ixmlElement_hasAttribute( IN IXML_Element * element,
|
ixmlElement_hasAttribute( IN IXML_Element * element,
|
||||||
IN const DOMString name )
|
IN DOMString name )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
@@ -930,8 +930,8 @@ ixmlElement_hasAttribute( IN IXML_Element * element,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
BOOL
|
BOOL
|
||||||
ixmlElement_hasAttributeNS( IN IXML_Element * element,
|
ixmlElement_hasAttributeNS( IN IXML_Element * element,
|
||||||
IN const DOMString namespaceURI,
|
IN DOMString namespaceURI,
|
||||||
IN const DOMString localName )
|
IN DOMString localName )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Node *attrNode;
|
IXML_Node *attrNode;
|
||||||
|
@@ -88,8 +88,8 @@ typedef struct _Parser
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Parser_LoadDocument( IXML_Document **retDoc, const char * xmlFile, BOOL file);
|
int Parser_LoadDocument( IXML_Document **retDoc, char * xmlFile, BOOL file);
|
||||||
BOOL Parser_isValidXmlName( const DOMString name);
|
BOOL Parser_isValidXmlName( DOMString name);
|
||||||
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
|
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
|
||||||
void Parser_freeNodeContent( IXML_Node *IXML_Nodeptr);
|
void Parser_freeNodeContent( IXML_Node *IXML_Nodeptr);
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ void Parser_setErrorChar( char c );
|
|||||||
void ixmlAttr_free(IXML_Attr *attrNode);
|
void ixmlAttr_free(IXML_Attr *attrNode);
|
||||||
void ixmlAttr_init(IXML_Attr *attrNode);
|
void ixmlAttr_init(IXML_Attr *attrNode);
|
||||||
|
|
||||||
int ixmlElement_setTagName(IXML_Element *element, const char *tagName);
|
int ixmlElement_setTagName(IXML_Element *element, char *tagName);
|
||||||
|
|
||||||
void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap);
|
void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap);
|
||||||
int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add);
|
int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add);
|
||||||
@@ -106,12 +106,12 @@ int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node
|
|||||||
void ixmlNode_init(IXML_Node *IXML_Nodeptr);
|
void ixmlNode_init(IXML_Node *IXML_Nodeptr);
|
||||||
BOOL ixmlNode_compare(IXML_Node *srcIXML_Node, IXML_Node *destIXML_Node);
|
BOOL ixmlNode_compare(IXML_Node *srcIXML_Node, IXML_Node *destIXML_Node);
|
||||||
|
|
||||||
void ixmlNode_getElementsByTagName( IXML_Node *n, const char *tagname, IXML_NodeList **list);
|
void ixmlNode_getElementsByTagName( IXML_Node *n, char *tagname, IXML_NodeList **list);
|
||||||
void ixmlNode_getElementsByTagNameNS( IXML_Node *IXML_Node, const char *namespaceURI,
|
void ixmlNode_getElementsByTagNameNS( IXML_Node *IXML_Node, char *namespaceURI,
|
||||||
const char *localName, IXML_NodeList **list);
|
char *localName, IXML_NodeList **list);
|
||||||
|
|
||||||
int ixmlNode_setNodeProperties(IXML_Node* node, IXML_Node *src);
|
int ixmlNode_setNodeProperties(IXML_Node* node, IXML_Node *src);
|
||||||
int ixmlNode_setNodeName( IXML_Node* node, const DOMString qualifiedName);
|
int ixmlNode_setNodeName( IXML_Node* node, DOMString qualifiedName);
|
||||||
|
|
||||||
void ixmlNodeList_init(IXML_NodeList *nList);
|
void ixmlNodeList_init(IXML_NodeList *nList);
|
||||||
int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add);
|
int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add);
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
static void
|
static void
|
||||||
copy_with_escape( INOUT ixml_membuf * buf,
|
copy_with_escape( INOUT ixml_membuf * buf,
|
||||||
IN const char *p )
|
IN char *p )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int plen;
|
int plen;
|
||||||
@@ -87,13 +87,13 @@ void
|
|||||||
ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
||||||
IN ixml_membuf * buf )
|
IN ixml_membuf * buf )
|
||||||
{
|
{
|
||||||
const char *nodeName = NULL;
|
char *nodeName = NULL;
|
||||||
const char *nodeValue = NULL;
|
char *nodeValue = NULL;
|
||||||
IXML_Node *child = NULL,
|
IXML_Node *child = NULL,
|
||||||
*sibling = NULL;
|
*sibling = NULL;
|
||||||
|
|
||||||
if( nodeptr != NULL ) {
|
if( nodeptr != NULL ) {
|
||||||
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
|
nodeName = ( char * )ixmlNode_getNodeName( nodeptr );
|
||||||
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
||||||
|
|
||||||
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
||||||
@@ -103,16 +103,14 @@ ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case eCDATA_SECTION_NODE:
|
case eCDATA_SECTION_NODE:
|
||||||
ixml_membuf_append_str( buf, "<![CDATA[" );
|
|
||||||
ixml_membuf_append_str( buf, nodeValue );
|
ixml_membuf_append_str( buf, nodeValue );
|
||||||
ixml_membuf_append_str( buf, "]]>" );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ePROCESSING_INSTRUCTION_NODE:
|
case ePROCESSING_INSTRUCTION_NODE:
|
||||||
ixml_membuf_append_str( buf, "<?" );
|
ixml_membuf_append_str( buf, "<?" );
|
||||||
ixml_membuf_append_str( buf, nodeName );
|
ixml_membuf_append_str( buf, nodeName );
|
||||||
ixml_membuf_append_str( buf, " " );
|
ixml_membuf_append_str( buf, " " );
|
||||||
copy_with_escape( buf, nodeValue );
|
ixml_membuf_append_str( buf, nodeValue );
|
||||||
ixml_membuf_append_str( buf, "?>\n" );
|
ixml_membuf_append_str( buf, "?>\n" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -124,9 +122,10 @@ ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
|||||||
case eATTRIBUTE_NODE:
|
case eATTRIBUTE_NODE:
|
||||||
ixml_membuf_append_str( buf, nodeName );
|
ixml_membuf_append_str( buf, nodeName );
|
||||||
ixml_membuf_append_str( buf, "=\"" );
|
ixml_membuf_append_str( buf, "=\"" );
|
||||||
copy_with_escape( buf, nodeValue );
|
if( nodeValue != NULL ) {
|
||||||
|
ixml_membuf_append_str( buf, nodeValue );
|
||||||
|
}
|
||||||
ixml_membuf_append_str( buf, "\"" );
|
ixml_membuf_append_str( buf, "\"" );
|
||||||
|
|
||||||
if( nodeptr->nextSibling != NULL ) {
|
if( nodeptr->nextSibling != NULL ) {
|
||||||
ixml_membuf_append_str( buf, " " );
|
ixml_membuf_append_str( buf, " " );
|
||||||
ixmlPrintDomTreeRecursive( nodeptr->nextSibling, buf );
|
ixmlPrintDomTreeRecursive( nodeptr->nextSibling, buf );
|
||||||
@@ -146,7 +145,7 @@ ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
|||||||
if( ( child != NULL )
|
if( ( child != NULL )
|
||||||
&& ( ixmlNode_getNodeType( child ) ==
|
&& ( ixmlNode_getNodeType( child ) ==
|
||||||
eELEMENT_NODE ) ) {
|
eELEMENT_NODE ) ) {
|
||||||
ixml_membuf_append_str( buf, ">\r\n" );
|
ixml_membuf_append_str( buf, ">\n" );
|
||||||
} else {
|
} else {
|
||||||
ixml_membuf_append_str( buf, ">" );
|
ixml_membuf_append_str( buf, ">" );
|
||||||
}
|
}
|
||||||
@@ -164,7 +163,7 @@ ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
|
|||||||
&& ixmlNode_getNodeType( sibling ) == eTEXT_NODE ) {
|
&& ixmlNode_getNodeType( sibling ) == eTEXT_NODE ) {
|
||||||
ixml_membuf_append_str( buf, ">" );
|
ixml_membuf_append_str( buf, ">" );
|
||||||
} else {
|
} else {
|
||||||
ixml_membuf_append_str( buf, ">\r\n" );
|
ixml_membuf_append_str( buf, ">\n" );
|
||||||
}
|
}
|
||||||
ixmlPrintDomTreeRecursive( ixmlNode_getNextSibling
|
ixmlPrintDomTreeRecursive( ixmlNode_getNextSibling
|
||||||
( nodeptr ), buf );
|
( nodeptr ), buf );
|
||||||
@@ -188,15 +187,15 @@ void
|
|||||||
ixmlPrintDomTree( IN IXML_Node * nodeptr,
|
ixmlPrintDomTree( IN IXML_Node * nodeptr,
|
||||||
IN ixml_membuf * buf )
|
IN ixml_membuf * buf )
|
||||||
{
|
{
|
||||||
const char *nodeName = NULL;
|
char *nodeName = NULL;
|
||||||
const char *nodeValue = NULL;
|
char *nodeValue = NULL;
|
||||||
IXML_Node *child = NULL;
|
IXML_Node *child = NULL;
|
||||||
|
|
||||||
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
|
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
|
nodeName = ( char * )ixmlNode_getNodeName( nodeptr );
|
||||||
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
||||||
|
|
||||||
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
||||||
@@ -211,7 +210,7 @@ ixmlPrintDomTree( IN IXML_Node * nodeptr,
|
|||||||
case eATTRIBUTE_NODE:
|
case eATTRIBUTE_NODE:
|
||||||
ixml_membuf_append_str( buf, nodeName );
|
ixml_membuf_append_str( buf, nodeName );
|
||||||
ixml_membuf_append_str( buf, "=\"" );
|
ixml_membuf_append_str( buf, "=\"" );
|
||||||
copy_with_escape( buf, nodeValue );
|
ixml_membuf_append_str( buf, nodeValue );
|
||||||
ixml_membuf_append_str( buf, "\"" );
|
ixml_membuf_append_str( buf, "\"" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ ixmlPrintDomTree( IN IXML_Node * nodeptr,
|
|||||||
child = ixmlNode_getFirstChild( nodeptr );
|
child = ixmlNode_getFirstChild( nodeptr );
|
||||||
if( ( child != NULL )
|
if( ( child != NULL )
|
||||||
&& ( ixmlNode_getNodeType( child ) == eELEMENT_NODE ) ) {
|
&& ( ixmlNode_getNodeType( child ) == eELEMENT_NODE ) ) {
|
||||||
ixml_membuf_append_str( buf, ">\r\n" );
|
ixml_membuf_append_str( buf, ">\n" );
|
||||||
} else {
|
} else {
|
||||||
ixml_membuf_append_str( buf, ">" );
|
ixml_membuf_append_str( buf, ">" );
|
||||||
}
|
}
|
||||||
@@ -239,7 +238,7 @@ ixmlPrintDomTree( IN IXML_Node * nodeptr,
|
|||||||
// Done with children. Output the end tag.
|
// Done with children. Output the end tag.
|
||||||
ixml_membuf_append_str( buf, "</" );
|
ixml_membuf_append_str( buf, "</" );
|
||||||
ixml_membuf_append_str( buf, nodeName );
|
ixml_membuf_append_str( buf, nodeName );
|
||||||
ixml_membuf_append_str( buf, ">\r\n" );
|
ixml_membuf_append_str( buf, ">\n" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -259,15 +258,15 @@ void
|
|||||||
ixmlDomTreetoString( IN IXML_Node * nodeptr,
|
ixmlDomTreetoString( IN IXML_Node * nodeptr,
|
||||||
IN ixml_membuf * buf )
|
IN ixml_membuf * buf )
|
||||||
{
|
{
|
||||||
const char *nodeName = NULL;
|
char *nodeName = NULL;
|
||||||
const char *nodeValue = NULL;
|
char *nodeValue = NULL;
|
||||||
IXML_Node *child = NULL;
|
IXML_Node *child = NULL;
|
||||||
|
|
||||||
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
|
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
|
nodeName = ( char * )ixmlNode_getNodeName( nodeptr );
|
||||||
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
nodeValue = ixmlNode_getNodeValue( nodeptr );
|
||||||
|
|
||||||
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
switch ( ixmlNode_getNodeType( nodeptr ) ) {
|
||||||
@@ -282,7 +281,7 @@ ixmlDomTreetoString( IN IXML_Node * nodeptr,
|
|||||||
case eATTRIBUTE_NODE:
|
case eATTRIBUTE_NODE:
|
||||||
ixml_membuf_append_str( buf, nodeName );
|
ixml_membuf_append_str( buf, nodeName );
|
||||||
ixml_membuf_append_str( buf, "=\"" );
|
ixml_membuf_append_str( buf, "=\"" );
|
||||||
copy_with_escape( buf, nodeValue );
|
ixml_membuf_append_str( buf, nodeValue );
|
||||||
ixml_membuf_append_str( buf, "\"" );
|
ixml_membuf_append_str( buf, "\"" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -325,7 +324,7 @@ ixmlDomTreetoString( IN IXML_Node * nodeptr,
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlLoadDocumentEx( IN const char *xmlFile,
|
ixmlLoadDocumentEx( IN char *xmlFile,
|
||||||
IXML_Document ** doc )
|
IXML_Document ** doc )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -343,7 +342,7 @@ ixmlLoadDocumentEx( IN const char *xmlFile,
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Document *
|
IXML_Document *
|
||||||
ixmlLoadDocument( IN const char *xmlFile )
|
ixmlLoadDocument( IN char *xmlFile )
|
||||||
{
|
{
|
||||||
|
|
||||||
IXML_Document *doc = NULL;
|
IXML_Document *doc = NULL;
|
||||||
@@ -372,7 +371,7 @@ ixmlPrintDocument(IXML_Document *doc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ixml_membuf_init( buf );
|
ixml_membuf_init( buf );
|
||||||
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\r\n" );
|
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\n" );
|
||||||
ixmlPrintDomTree( rootNode, buf );
|
ixmlPrintDomTree( rootNode, buf );
|
||||||
return buf->buf;
|
return buf->buf;
|
||||||
|
|
||||||
@@ -421,7 +420,7 @@ ixmlDocumenttoString(IXML_Document *doc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ixml_membuf_init( buf );
|
ixml_membuf_init( buf );
|
||||||
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\r\n" );
|
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\n" );
|
||||||
ixmlDomTreetoString( rootNode, buf );
|
ixmlDomTreetoString( rootNode, buf );
|
||||||
return buf->buf;
|
return buf->buf;
|
||||||
|
|
||||||
@@ -470,7 +469,7 @@ ixmlRelaxParser(char errorChar)
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlParseBufferEx( IN const char *buffer,
|
ixmlParseBufferEx( IN char *buffer,
|
||||||
IXML_Document ** retDoc )
|
IXML_Document ** retDoc )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ ixmlParseBufferEx( IN const char *buffer,
|
|||||||
return IXML_INVALID_PARAMETER;
|
return IXML_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( buffer[0] == '\0' ) {
|
if( strlen( buffer ) == 0 ) {
|
||||||
return IXML_INVALID_PARAMETER;
|
return IXML_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,7 +491,7 @@ ixmlParseBufferEx( IN const char *buffer,
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Document *
|
IXML_Document *
|
||||||
ixmlParseBuffer( IN const char *buffer )
|
ixmlParseBuffer( IN char *buffer )
|
||||||
{
|
{
|
||||||
IXML_Document *doc = NULL;
|
IXML_Document *doc = NULL;
|
||||||
|
|
||||||
|
@@ -232,30 +232,15 @@ static BOOL Parser_ElementPrefixDefined( Parser * myParser,
|
|||||||
IXML_Node * newNode,
|
IXML_Node * newNode,
|
||||||
char **nsURI );
|
char **nsURI );
|
||||||
static int Parser_setElementNamespace( IXML_Element * newElement,
|
static int Parser_setElementNamespace( IXML_Element * newElement,
|
||||||
const char *nsURI );
|
char *nsURI );
|
||||||
static int Parser_parseDocument( IXML_Document ** retDoc,
|
static int Parser_parseDocument( IXML_Document ** retDoc,
|
||||||
Parser * domParser );
|
Parser * domParser );
|
||||||
static BOOL Parser_hasDefaultNamespace( Parser * xmlParser,
|
static BOOL Parser_hasDefaultNamespace( Parser * xmlParser,
|
||||||
IXML_Node * newNode,
|
IXML_Node * newNode,
|
||||||
char **nsURI );
|
char **nsURI );
|
||||||
static int Parser_getChar( IN const char *src,
|
static int Parser_getChar( IN char *src,
|
||||||
INOUT int *cLen );
|
INOUT int *cLen );
|
||||||
|
|
||||||
/*==============================================================================*
|
|
||||||
* safe_strdup
|
|
||||||
* strdup that handles NULL input.
|
|
||||||
*
|
|
||||||
*===============================================================================*/
|
|
||||||
static char *
|
|
||||||
safe_strdup(const char *s)
|
|
||||||
{
|
|
||||||
assert(s != NULL);
|
|
||||||
if (s == NULL) {
|
|
||||||
return strdup("");
|
|
||||||
}
|
|
||||||
return strdup(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*==============================================================================*
|
/*==============================================================================*
|
||||||
* Parser_isCharInTable
|
* Parser_isCharInTable
|
||||||
* will determine whether character c is in the table of tbl
|
* will determine whether character c is in the table of tbl
|
||||||
@@ -327,9 +312,9 @@ Parser_isNameChar( IN int c,
|
|||||||
*
|
*
|
||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
BOOL
|
BOOL
|
||||||
Parser_isValidXmlName( IN const DOMString name )
|
Parser_isValidXmlName( IN DOMString name )
|
||||||
{
|
{
|
||||||
const char *pstr = NULL;
|
char *pstr = NULL;
|
||||||
int i = 0,
|
int i = 0,
|
||||||
nameLen = 0;
|
nameLen = 0;
|
||||||
|
|
||||||
@@ -340,7 +325,7 @@ Parser_isValidXmlName( IN const DOMString name )
|
|||||||
pstr = name;
|
pstr = name;
|
||||||
if( Parser_isNameChar( *pstr, FALSE ) == TRUE ) {
|
if( Parser_isNameChar( *pstr, FALSE ) == TRUE ) {
|
||||||
for( i = 1; i < nameLen; i++ ) {
|
for( i = 1; i < nameLen; i++ ) {
|
||||||
if( Parser_isNameChar( *( pstr + i ), TRUE ) == FALSE ) { //illegal char
|
if( Parser_isNameChar( *( pstr + 1 ), TRUE ) == FALSE ) { //illegal char
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,11 +419,11 @@ Parser_intToUTF8( IN int c,
|
|||||||
*
|
*
|
||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_UTF8ToInt( IN const char *ss,
|
Parser_UTF8ToInt( IN char *ss,
|
||||||
OUT int *len )
|
OUT int *len )
|
||||||
{
|
{
|
||||||
|
|
||||||
const unsigned char *s = ( const unsigned char * )ss;
|
unsigned char *s = ( unsigned char * )ss;
|
||||||
int c = *s;
|
int c = *s;
|
||||||
|
|
||||||
if( c <= 127 ) { // if c<=127, c is just the character.
|
if( c <= 127 ) { // if c<=127, c is just the character.
|
||||||
@@ -540,14 +525,14 @@ Parser_pushElement( IN Parser * xmlParser,
|
|||||||
memset( pNewStackElement, 0, sizeof( IXML_ElementStack ) );
|
memset( pNewStackElement, 0, sizeof( IXML_ElementStack ) );
|
||||||
// the element member includes both prefix and name
|
// the element member includes both prefix and name
|
||||||
|
|
||||||
pNewStackElement->element = safe_strdup( newElement->nodeName );
|
pNewStackElement->element = strdup( newElement->nodeName );
|
||||||
if( pNewStackElement->element == NULL ) {
|
if( pNewStackElement->element == NULL ) {
|
||||||
free( pNewStackElement );
|
free( pNewStackElement );
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( newElement->prefix != 0 ) {
|
if( newElement->prefix != 0 ) {
|
||||||
pNewStackElement->prefix = safe_strdup( newElement->prefix );
|
pNewStackElement->prefix = strdup( newElement->prefix );
|
||||||
if( pNewStackElement->prefix == NULL ) {
|
if( pNewStackElement->prefix == NULL ) {
|
||||||
Parser_freeElementStackItem( pNewStackElement );
|
Parser_freeElementStackItem( pNewStackElement );
|
||||||
free( pNewStackElement );
|
free( pNewStackElement );
|
||||||
@@ -557,7 +542,7 @@ Parser_pushElement( IN Parser * xmlParser,
|
|||||||
|
|
||||||
if( newElement->namespaceURI != 0 ) {
|
if( newElement->namespaceURI != 0 ) {
|
||||||
pNewStackElement->namespaceUri =
|
pNewStackElement->namespaceUri =
|
||||||
safe_strdup( newElement->namespaceURI );
|
strdup( newElement->namespaceURI );
|
||||||
if( pNewStackElement->namespaceUri == NULL ) {
|
if( pNewStackElement->namespaceUri == NULL ) {
|
||||||
Parser_freeElementStackItem( pNewStackElement );
|
Parser_freeElementStackItem( pNewStackElement );
|
||||||
free( pNewStackElement );
|
free( pNewStackElement );
|
||||||
@@ -617,7 +602,7 @@ Parser_popElement( IN Parser * xmlParser )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_readFileOrBuffer( IN Parser * xmlParser,
|
Parser_readFileOrBuffer( IN Parser * xmlParser,
|
||||||
IN const char *xmlFileName,
|
IN char *xmlFileName,
|
||||||
IN BOOL file )
|
IN BOOL file )
|
||||||
{
|
{
|
||||||
int fileSize = 0;
|
int fileSize = 0;
|
||||||
@@ -649,7 +634,7 @@ Parser_readFileOrBuffer( IN Parser * xmlParser,
|
|||||||
fclose( xmlFilePtr );
|
fclose( xmlFilePtr );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
xmlParser->dataBuffer = safe_strdup( xmlFileName );
|
xmlParser->dataBuffer = strdup( xmlFileName );
|
||||||
if( xmlParser->dataBuffer == NULL ) {
|
if( xmlParser->dataBuffer == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -666,7 +651,7 @@ Parser_readFileOrBuffer( IN Parser * xmlParser,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
Parser_LoadDocument( OUT IXML_Document ** retDoc,
|
Parser_LoadDocument( OUT IXML_Document ** retDoc,
|
||||||
IN const char *xmlFileName,
|
IN char *xmlFileName,
|
||||||
IN BOOL file )
|
IN BOOL file )
|
||||||
{
|
{
|
||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
@@ -1132,10 +1117,10 @@ Parser_skipWhiteSpaces( IN Parser * xmlParser )
|
|||||||
*
|
*
|
||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_getChar( IN const char *src,
|
Parser_getChar( IN char *src,
|
||||||
INOUT int *cLen )
|
INOUT int *cLen )
|
||||||
{
|
{
|
||||||
const char *pnum;
|
char *pnum;
|
||||||
int sum;
|
int sum;
|
||||||
char c;
|
char c;
|
||||||
int i;
|
int i;
|
||||||
@@ -1228,13 +1213,13 @@ fail_entity:
|
|||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_copyToken( IN Parser * xmlParser,
|
Parser_copyToken( IN Parser * xmlParser,
|
||||||
IN const char *src,
|
IN char *src,
|
||||||
IN int len )
|
IN int len )
|
||||||
{
|
{
|
||||||
int i,
|
int i,
|
||||||
c,
|
c,
|
||||||
cl;
|
cl;
|
||||||
const char *psrc,
|
char *psrc,
|
||||||
*pend;
|
*pend;
|
||||||
utf8char uch;
|
utf8char uch;
|
||||||
|
|
||||||
@@ -1578,7 +1563,7 @@ Parser_getNextToken( IN Parser * xmlParser )
|
|||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static char *
|
static char *
|
||||||
Parser_getNameSpace( IN Parser * xmlParser,
|
Parser_getNameSpace( IN Parser * xmlParser,
|
||||||
IN const char *prefix )
|
IN char *prefix )
|
||||||
{
|
{
|
||||||
IXML_ElementStack *pCur;
|
IXML_ElementStack *pCur;
|
||||||
IXML_NamespaceURI *pNsUri;
|
IXML_NamespaceURI *pNsUri;
|
||||||
@@ -1612,7 +1597,7 @@ Parser_addNamespace( IN Parser * xmlParser )
|
|||||||
{
|
{
|
||||||
IXML_Node *pNode;
|
IXML_Node *pNode;
|
||||||
IXML_ElementStack *pCur;
|
IXML_ElementStack *pCur;
|
||||||
const char *namespaceUri;
|
char *namespaceUri;
|
||||||
|
|
||||||
pNode = xmlParser->pNeedPrefixNode;
|
pNode = xmlParser->pNeedPrefixNode;
|
||||||
pCur = xmlParser->pCurElement;
|
pCur = xmlParser->pCurElement;
|
||||||
@@ -1625,7 +1610,7 @@ Parser_addNamespace( IN Parser * xmlParser )
|
|||||||
// it would be wrong that pNode->namespace != NULL.
|
// it would be wrong that pNode->namespace != NULL.
|
||||||
assert( pNode->namespaceURI == NULL );
|
assert( pNode->namespaceURI == NULL );
|
||||||
|
|
||||||
pNode->namespaceURI = safe_strdup( pCur->namespaceUri );
|
pNode->namespaceURI = strdup( pCur->namespaceUri );
|
||||||
if( pNode->namespaceURI == NULL ) {
|
if( pNode->namespaceURI == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1641,7 +1626,7 @@ Parser_addNamespace( IN Parser * xmlParser )
|
|||||||
|
|
||||||
namespaceUri = Parser_getNameSpace( xmlParser, pCur->prefix );
|
namespaceUri = Parser_getNameSpace( xmlParser, pCur->prefix );
|
||||||
if( namespaceUri != NULL ) {
|
if( namespaceUri != NULL ) {
|
||||||
pNode->namespaceURI = safe_strdup( namespaceUri );
|
pNode->namespaceURI = strdup( namespaceUri );
|
||||||
if( pNode->namespaceURI == NULL ) {
|
if( pNode->namespaceURI == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1676,7 +1661,7 @@ Parser_setNodePrefixAndLocalName( IN IXML_Node * node )
|
|||||||
pStrPrefix = strchr( node->nodeName, ':' );
|
pStrPrefix = strchr( node->nodeName, ':' );
|
||||||
if( pStrPrefix == NULL ) {
|
if( pStrPrefix == NULL ) {
|
||||||
node->prefix = NULL;
|
node->prefix = NULL;
|
||||||
node->localName = safe_strdup( node->nodeName );
|
node->localName = strdup( node->nodeName );
|
||||||
if( node->localName == NULL ) {
|
if( node->localName == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1693,7 +1678,7 @@ Parser_setNodePrefixAndLocalName( IN IXML_Node * node )
|
|||||||
memset( node->prefix, 0, nPrefix + 1 );
|
memset( node->prefix, 0, nPrefix + 1 );
|
||||||
strncpy( node->prefix, node->nodeName, nPrefix );
|
strncpy( node->prefix, node->nodeName, nPrefix );
|
||||||
|
|
||||||
node->localName = safe_strdup( pLocalName );
|
node->localName = strdup( pLocalName );
|
||||||
if( node->localName == NULL ) {
|
if( node->localName == NULL ) {
|
||||||
free( node->prefix );
|
free( node->prefix );
|
||||||
node->prefix = NULL; //no need to free really, main loop will frees it
|
node->prefix = NULL; //no need to free really, main loop will frees it
|
||||||
@@ -1733,7 +1718,7 @@ Parser_xmlNamespace( IN Parser * xmlParser,
|
|||||||
}
|
}
|
||||||
///here it goes to segfault on "" when not copying
|
///here it goes to segfault on "" when not copying
|
||||||
if(newNode->nodeValue){
|
if(newNode->nodeValue){
|
||||||
pCur->namespaceUri = safe_strdup( newNode->nodeValue );
|
pCur->namespaceUri = strdup( newNode->nodeValue );
|
||||||
if( pCur->namespaceUri == NULL ) {
|
if( pCur->namespaceUri == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1753,7 +1738,7 @@ Parser_xmlNamespace( IN Parser * xmlParser,
|
|||||||
|
|
||||||
if( ( pCur->prefix != NULL )
|
if( ( pCur->prefix != NULL )
|
||||||
&& ( strcmp( pCur->prefix, newNode->localName ) == 0 ) ) {
|
&& ( strcmp( pCur->prefix, newNode->localName ) == 0 ) ) {
|
||||||
pCur->namespaceUri = safe_strdup( newNode->nodeValue );
|
pCur->namespaceUri = strdup( newNode->nodeValue );
|
||||||
if( pCur->namespaceUri == NULL ) {
|
if( pCur->namespaceUri == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1780,13 +1765,13 @@ Parser_xmlNamespace( IN Parser * xmlParser,
|
|||||||
}
|
}
|
||||||
memset( pNewNs, 0, sizeof( IXML_NamespaceURI ) );
|
memset( pNewNs, 0, sizeof( IXML_NamespaceURI ) );
|
||||||
|
|
||||||
pNewNs->prefix = safe_strdup( newNode->localName );
|
pNewNs->prefix = strdup( newNode->localName );
|
||||||
if( pNewNs->prefix == NULL ) {
|
if( pNewNs->prefix == NULL ) {
|
||||||
free( pNewNs );
|
free( pNewNs );
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
pNewNs->nsURI = safe_strdup( newNode->nodeValue );
|
pNewNs->nsURI = strdup( newNode->nodeValue );
|
||||||
if( pNewNs->nsURI == NULL ) {
|
if( pNewNs->nsURI == NULL ) {
|
||||||
Parser_freeNsURI( pNewNs );
|
Parser_freeNsURI( pNewNs );
|
||||||
free( pNewNs );
|
free( pNewNs );
|
||||||
@@ -1804,7 +1789,7 @@ Parser_xmlNamespace( IN Parser * xmlParser,
|
|||||||
free( pNs->nsURI );
|
free( pNs->nsURI );
|
||||||
}
|
}
|
||||||
|
|
||||||
pNs->nsURI = safe_strdup( newNode->nodeValue );
|
pNs->nsURI = strdup( newNode->nodeValue );
|
||||||
if( pNs->nsURI == NULL ) {
|
if( pNs->nsURI == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1841,7 +1826,7 @@ Parser_processSTag( IN Parser * xmlParser,
|
|||||||
|
|
||||||
pCurToken = ( xmlParser->tokenBuf ).buf;
|
pCurToken = ( xmlParser->tokenBuf ).buf;
|
||||||
if( pCurToken != NULL ) {
|
if( pCurToken != NULL ) {
|
||||||
node->nodeName = safe_strdup( pCurToken );
|
node->nodeName = strdup( pCurToken );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1992,7 +1977,7 @@ Parser_processCDSect( IN char **pSrc,
|
|||||||
strncpy( node->nodeValue, pCDataStart, tokenLength );
|
strncpy( node->nodeValue, pCDataStart, tokenLength );
|
||||||
node->nodeValue[tokenLength] = '\0';
|
node->nodeValue[tokenLength] = '\0';
|
||||||
|
|
||||||
node->nodeName = safe_strdup( CDATANODENAME );
|
node->nodeName = strdup( CDATANODENAME );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
// no need to free node->nodeValue at all, bacause node contents
|
// no need to free node->nodeValue at all, bacause node contents
|
||||||
// will be freed by the main loop.
|
// will be freed by the main loop.
|
||||||
@@ -2017,13 +2002,13 @@ Parser_processCDSect( IN char **pSrc,
|
|||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_setElementNamespace( IN IXML_Element * newElement,
|
Parser_setElementNamespace( IN IXML_Element * newElement,
|
||||||
IN const char *nsURI )
|
IN char *nsURI )
|
||||||
{
|
{
|
||||||
if( newElement != NULL ) {
|
if( newElement != NULL ) {
|
||||||
if( newElement->n.namespaceURI != NULL ) {
|
if( newElement->n.namespaceURI != NULL ) {
|
||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
} else {
|
} else {
|
||||||
( newElement->n ).namespaceURI = safe_strdup( nsURI );
|
( newElement->n ).namespaceURI = strdup( nsURI );
|
||||||
if( ( newElement->n ).namespaceURI == NULL ) {
|
if( ( newElement->n ).namespaceURI == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2122,7 +2107,7 @@ Parser_processContent( IN Parser * xmlParser,
|
|||||||
|
|
||||||
pCurToken = ( xmlParser->tokenBuf ).buf;
|
pCurToken = ( xmlParser->tokenBuf ).buf;
|
||||||
if( pCurToken != NULL ) {
|
if( pCurToken != NULL ) {
|
||||||
node->nodeValue = safe_strdup( pCurToken );
|
node->nodeValue = strdup( pCurToken );
|
||||||
if( node->nodeValue == NULL ) {
|
if( node->nodeValue == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2130,7 +2115,7 @@ Parser_processContent( IN Parser * xmlParser,
|
|||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
node->nodeName = safe_strdup( TEXTNODENAME );
|
node->nodeName = strdup( TEXTNODENAME );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
@@ -2167,7 +2152,7 @@ Parser_processETag( IN Parser * xmlParser,
|
|||||||
if( pCurToken == NULL ) {
|
if( pCurToken == NULL ) {
|
||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
node->nodeName = safe_strdup( pCurToken );
|
node->nodeName = strdup( pCurToken );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2335,7 +2320,7 @@ Parser_processAttribute( IN Parser * xmlParser,
|
|||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
// copy in the attribute name
|
// copy in the attribute name
|
||||||
node->nodeName = safe_strdup( pCurToken );
|
node->nodeName = strdup( pCurToken );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2388,7 +2373,7 @@ Parser_processAttribute( IN Parser * xmlParser,
|
|||||||
|
|
||||||
pCurToken = ( xmlParser->tokenBuf ).buf;
|
pCurToken = ( xmlParser->tokenBuf ).buf;
|
||||||
if( pCurToken != NULL ) { // attribute has value, like a="c"
|
if( pCurToken != NULL ) { // attribute has value, like a="c"
|
||||||
node->nodeValue = safe_strdup( pCurToken );
|
node->nodeValue = strdup( pCurToken );
|
||||||
if( node->nodeValue == NULL ) {
|
if( node->nodeValue == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2471,7 +2456,7 @@ Parser_getNextNode( IN Parser * xmlParser,
|
|||||||
goto ErrorHandler;
|
goto ErrorHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
node->nodeName = safe_strdup( lastElement );
|
node->nodeName = strdup( lastElement );
|
||||||
if( node->nodeName == NULL ) {
|
if( node->nodeName == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
unsigned long
|
unsigned long
|
||||||
ixmlNamedNodeMap_getItemNumber( IN IXML_NamedNodeMap * nnMap,
|
ixmlNamedNodeMap_getItemNumber( IN IXML_NamedNodeMap * nnMap,
|
||||||
IN const char *name )
|
IN char *name )
|
||||||
{
|
{
|
||||||
IXML_Node *tempNode;
|
IXML_Node *tempNode;
|
||||||
unsigned long returnItemNo = 0;
|
unsigned long returnItemNo = 0;
|
||||||
@@ -92,7 +92,7 @@ ixmlNamedNodeMap_init( IN IXML_NamedNodeMap * nnMap )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Node *
|
IXML_Node *
|
||||||
ixmlNamedNodeMap_getNamedItem( IN IXML_NamedNodeMap * nnMap,
|
ixmlNamedNodeMap_getNamedItem( IN IXML_NamedNodeMap * nnMap,
|
||||||
IN const char *name )
|
IN char *name )
|
||||||
{
|
{
|
||||||
long index;
|
long index;
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ ixmlNode_getLocalName( IN IXML_Node * nodeptr )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlNode_setNamespaceURI( IN IXML_Node * nodeptr,
|
ixmlNode_setNamespaceURI( IN IXML_Node * nodeptr,
|
||||||
IN const char *namespaceURI )
|
IN char *namespaceURI )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( nodeptr == NULL ) {
|
if( nodeptr == NULL ) {
|
||||||
@@ -207,7 +207,7 @@ ixmlNode_setNamespaceURI( IN IXML_Node * nodeptr,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlNode_setPrefix( IN IXML_Node * nodeptr,
|
ixmlNode_setPrefix( IN IXML_Node * nodeptr,
|
||||||
IN const char *prefix )
|
IN char *prefix )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( nodeptr == NULL ) {
|
if( nodeptr == NULL ) {
|
||||||
@@ -240,7 +240,7 @@ ixmlNode_setPrefix( IN IXML_Node * nodeptr,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlNode_setLocalName( IN IXML_Node * nodeptr,
|
ixmlNode_setLocalName( IN IXML_Node * nodeptr,
|
||||||
IN const char *localName )
|
IN char *localName )
|
||||||
{
|
{
|
||||||
|
|
||||||
assert( nodeptr != NULL );
|
assert( nodeptr != NULL );
|
||||||
@@ -288,10 +288,10 @@ ixmlNode_getNamespaceURI( IN IXML_Node * nodeptr )
|
|||||||
* the prefix of the node.
|
* the prefix of the node.
|
||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
const DOMString
|
DOMString
|
||||||
ixmlNode_getPrefix( IN IXML_Node * nodeptr )
|
ixmlNode_getPrefix( IN IXML_Node * nodeptr )
|
||||||
{
|
{
|
||||||
const DOMString prefix = NULL;
|
DOMString prefix = NULL;
|
||||||
|
|
||||||
if( nodeptr != NULL ) {
|
if( nodeptr != NULL ) {
|
||||||
prefix = nodeptr->prefix;
|
prefix = nodeptr->prefix;
|
||||||
@@ -309,7 +309,7 @@ ixmlNode_getPrefix( IN IXML_Node * nodeptr )
|
|||||||
* the nodeValue of the node.
|
* the nodeValue of the node.
|
||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
const DOMString
|
DOMString
|
||||||
ixmlNode_getNodeValue( IN IXML_Node * nodeptr )
|
ixmlNode_getNodeValue( IN IXML_Node * nodeptr )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ ixmlNode_getNodeValue( IN IXML_Node * nodeptr )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlNode_setNodeValue( IN IXML_Node * nodeptr,
|
ixmlNode_setNodeValue( IN IXML_Node * nodeptr,
|
||||||
IN const char *newNodeValue )
|
IN char *newNodeValue )
|
||||||
{
|
{
|
||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
|
|
||||||
@@ -1425,7 +1425,7 @@ ixmlNode_hasAttributes( IXML_Node * nodeptr )
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
void
|
void
|
||||||
ixmlNode_getElementsByTagNameRecursive( IN IXML_Node * n,
|
ixmlNode_getElementsByTagNameRecursive( IN IXML_Node * n,
|
||||||
IN const char *tagname,
|
IN char *tagname,
|
||||||
OUT IXML_NodeList ** list )
|
OUT IXML_NodeList ** list )
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -1457,7 +1457,7 @@ ixmlNode_getElementsByTagNameRecursive( IN IXML_Node * n,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
void
|
void
|
||||||
ixmlNode_getElementsByTagName( IN IXML_Node * n,
|
ixmlNode_getElementsByTagName( IN IXML_Node * n,
|
||||||
IN const char *tagname,
|
IN char *tagname,
|
||||||
OUT IXML_NodeList ** list )
|
OUT IXML_NodeList ** list )
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -1484,8 +1484,8 @@ ixmlNode_getElementsByTagName( IN IXML_Node * n,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
void
|
void
|
||||||
ixmlNode_getElementsByTagNameNSRecursive( IN IXML_Node * n,
|
ixmlNode_getElementsByTagNameNSRecursive( IN IXML_Node * n,
|
||||||
IN const char *namespaceURI,
|
IN char *namespaceURI,
|
||||||
IN const char *localName,
|
IN char *localName,
|
||||||
OUT IXML_NodeList ** list )
|
OUT IXML_NodeList ** list )
|
||||||
{
|
{
|
||||||
const DOMString nsURI;
|
const DOMString nsURI;
|
||||||
@@ -1525,8 +1525,8 @@ ixmlNode_getElementsByTagNameNSRecursive( IN IXML_Node * n,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
void
|
void
|
||||||
ixmlNode_getElementsByTagNameNS( IN IXML_Node * n,
|
ixmlNode_getElementsByTagNameNS( IN IXML_Node * n,
|
||||||
IN const char *namespaceURI,
|
IN char *namespaceURI,
|
||||||
IN const char *localName,
|
IN char *localName,
|
||||||
OUT IXML_NodeList ** list )
|
OUT IXML_NodeList ** list )
|
||||||
{
|
{
|
||||||
const DOMString nsURI;
|
const DOMString nsURI;
|
||||||
@@ -1560,7 +1560,7 @@ ixmlNode_getElementsByTagNameNS( IN IXML_Node * n,
|
|||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
int
|
int
|
||||||
ixmlNode_setNodeName( IN IXML_Node * node,
|
ixmlNode_setNodeName( IN IXML_Node * node,
|
||||||
IN const DOMString qualifiedName )
|
IN DOMString qualifiedName )
|
||||||
{
|
{
|
||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
|
|
||||||
|
13
libupnp.spec
13
libupnp.spec
@@ -1,14 +1,15 @@
|
|||||||
Version: 1.4.2
|
Version: 1.4.1
|
||||||
Summary: Universal Plug and Play (UPnP) SDK
|
Summary: Universal Plug and Play (UPnP) SDK
|
||||||
Name: libupnp
|
Name: libupnp
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
URL: http://www.libupnp.org/
|
URL: http://www.libupnp.org/
|
||||||
Source: http://puzzle.dl.sourceforge.net/sourceforge/pupnp/%{name}-%{version}.tar.bz2
|
Source: http://puzzle.dl.sourceforge.net/sourceforge/pupnp/%{name}-%{version}.tar.gz
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
%define docdeveldir %{_docdir}/%{name}-devel-%{version}
|
%define docdir %{_docdir}/%{name}-%{version}-%{release}
|
||||||
|
%define docdeveldir %{_docdir}/%{name}-devel-%{version}-%{release}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The Universal Plug and Play (UPnP) SDK for Linux provides
|
The Universal Plug and Play (UPnP) SDK for Linux provides
|
||||||
@@ -28,7 +29,7 @@ the UPnP SDK libraries.
|
|||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --with-documentation
|
%configure --with-docdir=%{docdir}/
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@@ -77,9 +78,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
|
|||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Feb 02 2007 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.2-1
|
|
||||||
- Update to version 1.4.2
|
|
||||||
|
|
||||||
* Wed Jul 05 2006 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.1-1
|
* Wed Jul 05 2006 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.1-1
|
||||||
- Update to version 1.4.1
|
- Update to version 1.4.1
|
||||||
|
|
||||||
@@ -119,4 +117,3 @@ rm -rf %{buildroot}
|
|||||||
* Thu Dec 22 2005 Eric Tanguy 1.2.1a-1
|
* Thu Dec 22 2005 Eric Tanguy 1.2.1a-1
|
||||||
- Modify spec file from
|
- Modify spec file from
|
||||||
http://rpm.pbone.net/index.php3/stat/4/idpl/2378737/com/libupnp-1.2.1a_DSM320-3.i386.rpm.html
|
http://rpm.pbone.net/index.php3/stat/4/idpl/2378737/com/libupnp-1.2.1a_DSM320-3.i386.rpm.html
|
||||||
|
|
||||||
|
@@ -61,33 +61,32 @@ typedef enum priority {LOW_PRIORITY,
|
|||||||
#define DEFAULT_JOBS_PER_THREAD 10 //default jobs per thread used by TPAttrInit
|
#define DEFAULT_JOBS_PER_THREAD 10 //default jobs per thread used by TPAttrInit
|
||||||
#define DEFAULT_STARVATION_TIME 500 //default starvation time used by TPAttrInit
|
#define DEFAULT_STARVATION_TIME 500 //default starvation time used by TPAttrInit
|
||||||
#define DEFAULT_IDLE_TIME 10 * 1000 //default idle time used by TPAttrInit
|
#define DEFAULT_IDLE_TIME 10 * 1000 //default idle time used by TPAttrInit
|
||||||
#define DEFAULT_FREE_ROUTINE NULL //default free routine used TPJobInit
|
#define DEFAULT_FREE_ROUTINE NULL //default free routine used TPJobInit
|
||||||
#define DEFAULT_MAX_JOBS_TOTAL 100 //default max jobs used TPAttrInit
|
|
||||||
|
|
||||||
#define STATS 1 //always include stats because code change is minimal
|
#define STATS 1 //always include stats because code change is minimal
|
||||||
|
|
||||||
|
|
||||||
//Statistics
|
//Statistics
|
||||||
#ifdef WIN32 // todo: check why STATSONLY fails during compilation
|
#ifdef WIN32 // todo: check why STATSONLY fails during compilation
|
||||||
#undef STATS
|
#undef STATS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
#define STATSONLY(x) x
|
#define STATSONLY(x) x
|
||||||
#else
|
#else
|
||||||
#define STATSONLY(x)
|
#define STATSONLY(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//DEBUGGING
|
//DEBUGGING
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define DBGONLY(x) x
|
#define DBGONLY(x) x
|
||||||
#else
|
#else
|
||||||
#define DBGONLY(x)
|
#define DBGONLY(x)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -98,7 +97,7 @@ typedef enum priority {LOW_PRIORITY,
|
|||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#define EXPORT
|
#define EXPORT
|
||||||
typedef int PolicyType;
|
typedef int PolicyType;
|
||||||
#define DEFAULT_POLICY SCHED_OTHER
|
#define DEFAULT_POLICY SCHED_OTHER
|
||||||
#define DEFAULT_SCHED_PARAM 0 //default priority
|
#define DEFAULT_SCHED_PARAM 0 //default priority
|
||||||
@@ -115,30 +114,28 @@ typedef void (*free_routine)(void *arg);
|
|||||||
* Name: ThreadPoolAttr
|
* Name: ThreadPoolAttr
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Attributes for thread pool. Used to set and change parameters of
|
* Attributes for thread pool. Used to set and change parameters of
|
||||||
* thread pool
|
* thread pool
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct THREADPOOLATTR
|
typedef struct THREADPOOLATTR
|
||||||
{
|
{
|
||||||
int minThreads; // minThreads, ThreadPool will always maintain at least
|
int minThreads; //minThreads, ThreadPool will always maintain at least
|
||||||
// this many threads
|
//this many threads
|
||||||
|
|
||||||
|
int maxThreads; //maxThreads, ThreadPool will never have more than this
|
||||||
|
//number of threads
|
||||||
|
|
||||||
|
int maxIdleTime; //maxIdleTime (in milliseconds)
|
||||||
|
// this is the maximum time a thread will remain idle
|
||||||
|
// before dying
|
||||||
|
|
||||||
int maxThreads; // maxThreads, ThreadPool will never have more than this
|
int jobsPerThread; //jobs per thread to maintain
|
||||||
// number of threads
|
|
||||||
|
int starvationTime; //the time a low priority or med priority
|
||||||
int maxIdleTime; // maxIdleTime (in milliseconds)
|
//job waits before getting bumped
|
||||||
// this is the maximum time a thread will remain idle
|
//up a priority (in milliseconds)
|
||||||
// before dying
|
|
||||||
|
PolicyType schedPolicy; //scheduling policy to use
|
||||||
int jobsPerThread; // jobs per thread to maintain
|
|
||||||
|
|
||||||
int maxJobsTotal; // maximum number of jobs that can be queued totally.
|
|
||||||
|
|
||||||
int starvationTime; // the time a low priority or med priority
|
|
||||||
// job waits before getting bumped
|
|
||||||
// up a priority (in milliseconds)
|
|
||||||
|
|
||||||
PolicyType schedPolicy; // scheduling policy to use
|
|
||||||
|
|
||||||
} ThreadPoolAttr;
|
} ThreadPoolAttr;
|
||||||
|
|
||||||
@@ -155,7 +152,7 @@ typedef struct THREADPOOLJOB
|
|||||||
free_routine free_func; //free function
|
free_routine free_func; //free function
|
||||||
struct timeb requestTime; //time of request
|
struct timeb requestTime; //time of request
|
||||||
int priority; //priority of request
|
int priority; //priority of request
|
||||||
int jobId; //id
|
int jobId; //id
|
||||||
} ThreadPoolJob;
|
} ThreadPoolJob;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -171,20 +168,20 @@ typedef struct TPOOLSTATS
|
|||||||
{
|
{
|
||||||
double totalTimeHQ; //total time spent by all jobs in high priority Q
|
double totalTimeHQ; //total time spent by all jobs in high priority Q
|
||||||
int totalJobsHQ; //total jobs in HQ run so far
|
int totalJobsHQ; //total jobs in HQ run so far
|
||||||
double avgWaitHQ; //average wait in HQ
|
double avgWaitHQ; //average wait in HQ
|
||||||
double totalTimeMQ; //total time spent by all jobs in med priority Q
|
double totalTimeMQ; //total time spent by all jobs in med priority Q
|
||||||
int totalJobsMQ; //total jobs in MQ run so far
|
int totalJobsMQ; //total jobs in MQ run so far
|
||||||
double avgWaitMQ; //average wait in MQ
|
double avgWaitMQ; //average wait in MQ
|
||||||
double totalTimeLQ; //total time spent by all jobs in low priority Q
|
double totalTimeLQ; //total time spent by all jobs in low priority Q
|
||||||
int totalJobsLQ; //total jobs in LQ run so far
|
int totalJobsLQ; //total jobs in LQ run so far
|
||||||
double avgWaitLQ; //average wait in LQ
|
double avgWaitLQ; //average wait in LQ
|
||||||
double totalWorkTime; //total time spent working for all threads
|
double totalWorkTime; //total time spent working for all threads
|
||||||
double totalIdleTime; //total time spent idle for all threads
|
double totalIdleTime; //total time spent idle for all threads
|
||||||
int workerThreads; //number of current workerThreads
|
int workerThreads; //number of current workerThreads
|
||||||
int idleThreads; //number of current idle threads
|
int idleThreads; //number of current idle threads
|
||||||
int persistentThreads; //number of persistent threads
|
int persistentThreads; //number of persistent threads
|
||||||
int totalThreads; //total number of current threads
|
int totalThreads; //total number of current threads
|
||||||
int maxThreads; //max threads so far
|
int maxThreads; //max threads so far
|
||||||
int currentJobsHQ; // current jobs in Q
|
int currentJobsHQ; // current jobs in Q
|
||||||
int currentJobsLQ; //current jobs in Q
|
int currentJobsLQ; //current jobs in Q
|
||||||
int currentJobsMQ; //current jobs in Q
|
int currentJobsMQ; //current jobs in Q
|
||||||
@@ -524,19 +521,6 @@ int TPAttrSetStarvationTime(ThreadPoolAttr *attr, int starvationTime);
|
|||||||
int TPAttrSetSchedPolicy(ThreadPoolAttr *attr, PolicyType schedPolicy);
|
int TPAttrSetSchedPolicy(ThreadPoolAttr *attr, PolicyType schedPolicy);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: TPAttrSetMaxJobsTotal
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Sets the maximum number jobs that can be qeued totally.
|
|
||||||
* Parameters:
|
|
||||||
* attr - must be valid thread pool attributes.
|
|
||||||
* maxJobsTotal - maximum number of jobs
|
|
||||||
* Returns:
|
|
||||||
* Always returns 0.
|
|
||||||
*****************************************************************************/
|
|
||||||
int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolGetStats
|
* Function: ThreadPoolGetStats
|
||||||
*
|
*
|
||||||
|
@@ -47,21 +47,11 @@ extern "C" {
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#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_FAST_NP PTHREAD_MUTEX_FAST_NP
|
||||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
||||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ITHREAD_CANCELED PTHREAD_CANCELED
|
#define ITHREAD_CANCELED PTHREAD_CANCELED
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Name: ithread_t
|
* Name: ithread_t
|
||||||
@@ -191,11 +181,8 @@ extern "C" {
|
|||||||
* Returns EINVAL if the kind is not supported.
|
* Returns EINVAL if the kind is not supported.
|
||||||
* See man page for pthread_mutexattr_setkind_np
|
* 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
|
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ithread_mutexattr_getkind_np
|
* Function: ithread_mutexattr_getkind_np
|
||||||
@@ -216,11 +203,7 @@ extern "C" {
|
|||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
* See man page for pthread_mutexattr_getkind_np
|
* 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
|
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -559,10 +542,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef PTHREAD_MUTEX_RECURSIVE
|
|
||||||
//NK: Added for satisfying the gcc compiler
|
//NK: Added for satisfying the gcc compiler
|
||||||
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
|
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,9 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef STATS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: CmpThreadPoolJob
|
* Function: CmpThreadPoolJob
|
||||||
@@ -90,10 +92,6 @@ FreeThreadPoolJob( ThreadPool * tp,
|
|||||||
static int
|
static int
|
||||||
SetPolicyType( PolicyType in )
|
SetPolicyType( PolicyType in )
|
||||||
{
|
{
|
||||||
#ifdef __CYGWIN__
|
|
||||||
/* TODO not currently working... */
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
return sched_setscheduler( 0, in);
|
return sched_setscheduler( 0, in);
|
||||||
#else
|
#else
|
||||||
@@ -103,7 +101,6 @@ SetPolicyType( PolicyType in )
|
|||||||
current.sched_priority = DEFAULT_SCHED_PARAM;
|
current.sched_priority = DEFAULT_SCHED_PARAM;
|
||||||
return sched_setscheduler( 0, in, ¤t );
|
return sched_setscheduler( 0, in, ¤t );
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -909,7 +906,6 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
|||||||
int rc = EOUTOFMEM;
|
int rc = EOUTOFMEM;
|
||||||
|
|
||||||
int tempId = -1;
|
int tempId = -1;
|
||||||
int totalJobs;
|
|
||||||
|
|
||||||
ThreadPoolJob *temp = NULL;
|
ThreadPoolJob *temp = NULL;
|
||||||
|
|
||||||
@@ -926,13 +922,6 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
|||||||
|| ( job->priority == MED_PRIORITY )
|
|| ( job->priority == MED_PRIORITY )
|
||||||
|| ( job->priority == HIGH_PRIORITY ) );
|
|| ( job->priority == HIGH_PRIORITY ) );
|
||||||
|
|
||||||
totalJobs = tp->highJobQ.size + tp->lowJobQ.size + tp->medJobQ.size;
|
|
||||||
if (totalJobs >= tp->attr.maxJobsTotal) {
|
|
||||||
fprintf(stderr, "total jobs = %d, too many jobs", totalJobs);
|
|
||||||
ithread_mutex_unlock( &tp->mutex );
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( jobId == NULL )
|
if( jobId == NULL )
|
||||||
jobId = &tempId;
|
jobId = &tempId;
|
||||||
|
|
||||||
@@ -1278,7 +1267,6 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
|||||||
attr->minThreads = DEFAULT_MIN_THREADS;
|
attr->minThreads = DEFAULT_MIN_THREADS;
|
||||||
attr->schedPolicy = DEFAULT_POLICY;
|
attr->schedPolicy = DEFAULT_POLICY;
|
||||||
attr->starvationTime = DEFAULT_STARVATION_TIME;
|
attr->starvationTime = DEFAULT_STARVATION_TIME;
|
||||||
attr->maxJobsTotal = DEFAULT_MAX_JOBS_TOTAL;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1530,29 +1518,6 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
|||||||
stats->totalIdleTime );}
|
stats->totalIdleTime );}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: TPAttrSetMaxJobsTotal
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Sets the maximum number jobs that can be qeued totally.
|
|
||||||
* Parameters:
|
|
||||||
* attr - must be valid thread pool attributes.
|
|
||||||
* maxJobsTotal - maximum number of jobs
|
|
||||||
* Returns:
|
|
||||||
* Always returns 0.
|
|
||||||
*****************************************************************************/
|
|
||||||
int TPAttrSetMaxJobsTotal( ThreadPoolAttr * attr,
|
|
||||||
int maxJobsTotal ) {
|
|
||||||
assert( attr != NULL );
|
|
||||||
|
|
||||||
if( attr == NULL ) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
attr->maxJobsTotal = maxJobsTotal;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolGetStats
|
* Function: ThreadPoolGetStats
|
||||||
*
|
*
|
||||||
|
@@ -132,7 +132,8 @@ upnp_tv_ctrlpt_SOURCES = \
|
|||||||
sample/tvctrlpt/upnp_tv_ctrlpt.h \
|
sample/tvctrlpt/upnp_tv_ctrlpt.h \
|
||||||
sample/tvctrlpt/linux/upnp_tv_ctrlpt_main.c
|
sample/tvctrlpt/linux/upnp_tv_ctrlpt_main.c
|
||||||
|
|
||||||
if WITH_DOCUMENTATION
|
if WITH_DOCDIR
|
||||||
|
docdir = @DOCDIR@
|
||||||
examplesdir = $(docdir)/examples
|
examplesdir = $(docdir)/examples
|
||||||
examples_DATA = $(upnp_tv_ctrlpt_SOURCES) $(upnp_tv_device_SOURCES)
|
examples_DATA = $(upnp_tv_ctrlpt_SOURCES) $(upnp_tv_device_SOURCES)
|
||||||
endif
|
endif
|
||||||
|
@@ -36,14 +36,6 @@
|
|||||||
|
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
#if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
|
|
||||||
#if defined __GNUC__
|
|
||||||
#warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
|
|
||||||
#else
|
|
||||||
#error libupnp requires largefile mode - use AC_SYS_LARGEFILE
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -65,12 +57,6 @@
|
|||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC
|
#define EXPORT_SPEC
|
||||||
#endif
|
#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
|
#else
|
||||||
#define EXPORT_SPEC
|
#define EXPORT_SPEC
|
||||||
#endif
|
#endif
|
||||||
@@ -79,7 +65,6 @@
|
|||||||
#define UpnpCloseSocket close
|
#define UpnpCloseSocket close
|
||||||
#else
|
#else
|
||||||
#define UpnpCloseSocket closesocket
|
#define UpnpCloseSocket closesocket
|
||||||
#define fseeko fseek
|
|
||||||
#endif
|
#endif
|
||||||
#define UPNP_SOCKETERROR -1
|
#define UPNP_SOCKETERROR -1
|
||||||
#define UPNP_INVALID_SOCKET -1
|
#define UPNP_INVALID_SOCKET -1
|
||||||
@@ -94,8 +79,6 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#define NUM_HANDLE 200
|
#define NUM_HANDLE 200
|
||||||
#define LINE_SIZE 180
|
#define LINE_SIZE 180
|
||||||
#define NAME_SIZE 256
|
#define NAME_SIZE 256
|
||||||
@@ -892,7 +875,7 @@ struct File_Info
|
|||||||
/** The length of the file. A length less than 0 indicates the size
|
/** The length of the file. A length less than 0 indicates the size
|
||||||
* is unknown, and data will be sent until 0 bytes are returned from
|
* is unknown, and data will be sent until 0 bytes are returned from
|
||||||
* a read call. */
|
* a read call. */
|
||||||
off_t file_length;
|
int file_length;
|
||||||
|
|
||||||
/** The time at which the contents of the file was modified;
|
/** The time at which the contents of the file was modified;
|
||||||
* The time system is always local (not GMT). */
|
* The time system is always local (not GMT). */
|
||||||
@@ -986,7 +969,7 @@ struct UpnpVirtualDirCallbacks
|
|||||||
int (*seek) (
|
int (*seek) (
|
||||||
IN UpnpWebFileHandle fileHnd, /** The handle of the file to move the
|
IN UpnpWebFileHandle fileHnd, /** The handle of the file to move the
|
||||||
file pointer. */
|
file pointer. */
|
||||||
IN off_t offset, /** The number of bytes to move in the
|
IN long offset, /** The number of bytes to move in the
|
||||||
file. Positive values move foward and
|
file. Positive values move foward and
|
||||||
negative values move backward. Note
|
negative values move backward. Note
|
||||||
that this must be positive if the
|
that this must be positive if the
|
||||||
@@ -2724,3 +2707,4 @@ EXPORT_SPEC void UpnpFree(
|
|||||||
//@} The API
|
//@} The API
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1974,7 +1974,9 @@ TvDeviceStart( char *ip_address,
|
|||||||
ip_address = UpnpGetServerIpAddress( );
|
ip_address = UpnpGetServerIpAddress( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( port == 0 ) {
|
||||||
port = UpnpGetServerPort( );
|
port = UpnpGetServerPort( );
|
||||||
|
}
|
||||||
|
|
||||||
SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n",
|
SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n",
|
||||||
ip_address, port );
|
ip_address, port );
|
||||||
|
@@ -207,11 +207,6 @@ int UpnpInit( IN const char *HostIP,
|
|||||||
( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit \n" );
|
( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit \n" );
|
||||||
)
|
)
|
||||||
//initialize mutex
|
//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 ) {
|
if( ithread_mutex_init( &GlobalHndMutex, NULL ) != 0 ) {
|
||||||
return UPNP_E_INIT_FAILED;
|
return UPNP_E_INIT_FAILED;
|
||||||
}
|
}
|
||||||
@@ -249,7 +244,6 @@ int UpnpInit( IN const char *HostIP,
|
|||||||
TPAttrSetMinThreads( &attr, MIN_THREADS );
|
TPAttrSetMinThreads( &attr, MIN_THREADS );
|
||||||
TPAttrSetJobsPerThread( &attr, JOBS_PER_THREAD );
|
TPAttrSetJobsPerThread( &attr, JOBS_PER_THREAD );
|
||||||
TPAttrSetIdleTime( &attr, THREAD_IDLE_TIME );
|
TPAttrSetIdleTime( &attr, THREAD_IDLE_TIME );
|
||||||
TPAttrSetMaxJobsTotal( &attr, MAX_JOBS_TOTAL );
|
|
||||||
|
|
||||||
if( ThreadPoolInit( &gSendThreadPool, &attr ) != UPNP_E_SUCCESS ) {
|
if( ThreadPoolInit( &gSendThreadPool, &attr ) != UPNP_E_SUCCESS ) {
|
||||||
UpnpSdkInit = 0;
|
UpnpSdkInit = 0;
|
||||||
@@ -961,7 +955,7 @@ GetDescDocumentAndURL( IN Upnp_DescType descriptionType,
|
|||||||
char aliasStr[LINE_SIZE];
|
char aliasStr[LINE_SIZE];
|
||||||
char *temp_str = NULL;
|
char *temp_str = NULL;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
off_t fileLen;
|
unsigned fileLen;
|
||||||
unsigned num_read;
|
unsigned num_read;
|
||||||
time_t last_modified;
|
time_t last_modified;
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
@@ -3345,20 +3339,19 @@ UpnpDownloadXmlDoc( const char *url,
|
|||||||
return ret_code;
|
return ret_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: MoNKi: Do not check this?? Some routers (Linksys WRT54GS) sends
|
||||||
|
"CONTENT-TYPE: application/octet-stream". If the data sended is not
|
||||||
|
an xml file, ixmlParseBufferEx will fail and the function will return
|
||||||
|
UPNP_E_INVALID_DESC too.*/
|
||||||
|
|
||||||
if( strncasecmp( content_type, "text/xml", strlen( "text/xml" ) ) ) {
|
if( strncasecmp( content_type, "text/xml", strlen( "text/xml" ) ) ) {
|
||||||
DBGONLY(
|
|
||||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Not text/xml\n" );
|
|
||||||
)
|
|
||||||
// Linksys WRT54G router returns
|
|
||||||
// "CONTENT-TYPE: application/octet-stream".
|
|
||||||
// Let's be nice to Linksys and try to parse document anyway.
|
|
||||||
// If the data sended is not a xml file, ixmlParseBufferEx
|
|
||||||
// will fail and the function will return UPNP_E_INVALID_DESC too.
|
|
||||||
#if 0
|
|
||||||
free( xml_buf );
|
free( xml_buf );
|
||||||
return UPNP_E_INVALID_DESC;
|
DBGONLY( UpnpPrintf( UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
#endif
|
"Not text/xml\n" );
|
||||||
|
)
|
||||||
|
return UPNP_E_INVALID_DESC;
|
||||||
}
|
}
|
||||||
|
// end of TODO Do not check this
|
||||||
|
|
||||||
ret_code = ixmlParseBufferEx( xml_buf, xmlDoc );
|
ret_code = ixmlParseBufferEx( xml_buf, xmlDoc );
|
||||||
free( xml_buf );
|
free( xml_buf );
|
||||||
@@ -3718,6 +3711,8 @@ FreeHandle( int Upnp_Handle )
|
|||||||
|
|
||||||
} /****************** End of FreeHandle *********************/
|
} /****************** End of FreeHandle *********************/
|
||||||
|
|
||||||
|
// **DBG****************************************************
|
||||||
|
DBGONLY(
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Function: PrintHandleInfo
|
* Function: PrintHandleInfo
|
||||||
@@ -3731,61 +3726,56 @@ FreeHandle( int Upnp_Handle )
|
|||||||
* Return Values: int
|
* Return Values: int
|
||||||
* UPNP_E_SUCCESS if successful else return appropriate error
|
* UPNP_E_SUCCESS if successful else return appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int PrintHandleInfo( IN UpnpClient_Handle Hnd )
|
int PrintHandleInfo( IN UpnpClient_Handle Hnd ) {
|
||||||
{
|
struct Handle_Info * HndInfo; if( HandleTable[Hnd] != NULL ) {
|
||||||
struct Handle_Info * HndInfo;
|
HndInfo = HandleTable[Hnd];
|
||||||
if (HandleTable[Hnd] != NULL) {
|
DBGONLY( UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
HndInfo = HandleTable[Hnd];
|
"Printing information for Handle_%d\n",
|
||||||
DBGONLY(
|
Hnd );
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Printing information for Handle_%d\n", Hnd);
|
"HType_%d\n", HndInfo->HType );
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
DEVICEONLY(
|
||||||
"HType_%d\n", HndInfo->HType);
|
if( HndInfo->HType !=
|
||||||
DEVICEONLY(
|
HND_CLIENT ) UpnpPrintf( UPNP_ALL, API, __FILE__,
|
||||||
if(HndInfo->HType != HND_CLIENT)
|
__LINE__, "DescURL_%s\n",
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
HndInfo->DescURL ); )
|
||||||
"DescURL_%s\n", HndInfo->DescURL );
|
)
|
||||||
)
|
}
|
||||||
)
|
else
|
||||||
} else {
|
{
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;}
|
||||||
}
|
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return UPNP_E_SUCCESS;}
|
||||||
/****************** End of PrintHandleInfo *********************/
|
/****************** End of PrintHandleInfo *********************/
|
||||||
|
|
||||||
void printNodes( IXML_Node * tmpRoot, int depth )
|
void printNodes( IXML_Node * tmpRoot, int depth ) {
|
||||||
{
|
int i;
|
||||||
int i;
|
IXML_NodeList * NodeList1;
|
||||||
IXML_NodeList *NodeList1;
|
IXML_Node * ChildNode1;
|
||||||
IXML_Node *ChildNode1;
|
unsigned short NodeType;
|
||||||
unsigned short NodeType;
|
DOMString NodeValue;
|
||||||
const DOMString NodeValue;
|
const DOMString NodeName;
|
||||||
const DOMString NodeName;
|
NodeList1 = ixmlNode_getChildNodes( tmpRoot );
|
||||||
NodeList1 = ixmlNode_getChildNodes(tmpRoot);
|
for( i = 0; i < 100; i++ ) {
|
||||||
for (i = 0; i < 100; ++i) {
|
ChildNode1 = ixmlNodeList_item( NodeList1, i );
|
||||||
ChildNode1 = ixmlNodeList_item(NodeList1, i);
|
if( ChildNode1 == NULL ) {
|
||||||
if (ChildNode1 == NULL) {
|
break;}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printNodes(ChildNode1, depth+1);
|
|
||||||
NodeType = ixmlNode_getNodeType(ChildNode1);
|
|
||||||
NodeValue = ixmlNode_getNodeValue(ChildNode1);
|
|
||||||
NodeName = ixmlNode_getNodeName(ChildNode1);
|
|
||||||
DBGONLY(
|
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
|
||||||
"DEPTH-%2d-IXML_Node Type %d, "
|
|
||||||
"IXML_Node Name: %s, IXML_Node Value: %s\n",
|
|
||||||
depth, NodeType, NodeName, NodeValue);
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
printNodes( ChildNode1, depth + 1 );
|
||||||
|
NodeType = ixmlNode_getNodeType( ChildNode1 );
|
||||||
|
NodeValue = ixmlNode_getNodeValue( ChildNode1 );
|
||||||
|
NodeName = ixmlNode_getNodeName( ChildNode1 );
|
||||||
|
DBGONLY( UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
|
"DEPTH-%2d-IXML_Node Type %d, "
|
||||||
|
"IXML_Node Name: %s, IXML_Node Value: %s\n",
|
||||||
|
depth, NodeType, NodeName, NodeValue ); )
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
/****************** End of printNodes *********************/
|
/****************** End of printNodes *********************/
|
||||||
|
|
||||||
|
) // dbgonly
|
||||||
|
|
||||||
//********************************************************
|
//********************************************************
|
||||||
//* Name: getlocalhostname
|
//* Name: getlocalhostname
|
||||||
//* Description: Function to get local IP address
|
//* Description: Function to get local IP address
|
||||||
|
@@ -196,12 +196,11 @@ addToAction( IN int response,
|
|||||||
|
|
||||||
if( response ) {
|
if( response ) {
|
||||||
sprintf( ActBuff,
|
sprintf( ActBuff,
|
||||||
"<u:%sResponse xmlns:u=\"%s\">\r\n</u:%sResponse>",
|
"<u:%sResponse xmlns:u=\"%s\"></u:%sResponse>",
|
||||||
ActionName, ServType, ActionName );
|
ActionName, ServType, ActionName );
|
||||||
} else {
|
} else {
|
||||||
sprintf( ActBuff,
|
sprintf( ActBuff, "<u:%s xmlns:u=\"%s\"></u:%s>",
|
||||||
"<u:%s xmlns:u=\"%s\">\r\n</u:%s>",
|
ActionName, ServType, ActionName );
|
||||||
ActionName, ServType, ActionName );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ixmlParseBufferEx( ActBuff, ActionDoc );
|
rc = ixmlParseBufferEx( ActBuff, ActionDoc );
|
||||||
@@ -275,13 +274,11 @@ makeAction( IN int response,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( response ) {
|
if( response ) {
|
||||||
sprintf( ActBuff,
|
sprintf( ActBuff, "<u:%sResponse xmlns:u=\"%s\"></u:%sResponse>",
|
||||||
"<u:%sResponse xmlns:u=\"%s\">\r\n</u:%sResponse>",
|
ActionName, ServType, ActionName );
|
||||||
ActionName, ServType, ActionName );
|
|
||||||
} else {
|
} else {
|
||||||
sprintf( ActBuff,
|
sprintf( ActBuff, "<u:%s xmlns:u=\"%s\"></u:%s>",
|
||||||
"<u:%s xmlns:u=\"%s\">\r\n</u:%s>",
|
ActionName, ServType, ActionName );
|
||||||
ActionName, ServType, ActionName );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ixmlParseBufferEx( ActBuff, &ActionDoc ) != IXML_SUCCESS ) {
|
if( ixmlParseBufferEx( ActBuff, &ActionDoc ) != IXML_SUCCESS ) {
|
||||||
|
@@ -219,11 +219,10 @@ gena_unsubscribe( IN char *url,
|
|||||||
// make request msg
|
// make request msg
|
||||||
membuffer_init( &request );
|
membuffer_init( &request );
|
||||||
request.size_inc = 30;
|
request.size_inc = 30;
|
||||||
return_code = http_MakeMessage(
|
return_code = http_MakeMessage( &request, 1, 1,
|
||||||
&request, 1, 1,
|
"q" "ssc" "U" "c",
|
||||||
"q" "ssc" "Uc",
|
HTTPMETHOD_UNSUBSCRIBE, &dest_url,
|
||||||
HTTPMETHOD_UNSUBSCRIBE, &dest_url,
|
"SID: ", sid );
|
||||||
"SID: ", sid );
|
|
||||||
|
|
||||||
//Not able to make the message so destroy the existing buffer
|
//Not able to make the message so destroy the existing buffer
|
||||||
if( return_code != 0 ) {
|
if( return_code != 0 ) {
|
||||||
@@ -306,21 +305,20 @@ gena_subscribe( IN char *url,
|
|||||||
request.size_inc = 30;
|
request.size_inc = 30;
|
||||||
if( renewal_sid ) {
|
if( renewal_sid ) {
|
||||||
// renew subscription
|
// renew subscription
|
||||||
return_code = http_MakeMessage(
|
return_code = http_MakeMessage( &request, 1, 1,
|
||||||
&request, 1, 1,
|
"q" "ssc" "ssc" "c",
|
||||||
"q" "ssc" "sscc",
|
HTTPMETHOD_SUBSCRIBE, &dest_url,
|
||||||
HTTPMETHOD_SUBSCRIBE, &dest_url,
|
"SID: ", renewal_sid,
|
||||||
"SID: ", renewal_sid,
|
"TIMEOUT: Second-", timeout_str );
|
||||||
"TIMEOUT: Second-", timeout_str );
|
|
||||||
} else {
|
} else {
|
||||||
// subscribe
|
// subscribe
|
||||||
return_code = http_MakeMessage(
|
return_code = http_MakeMessage( &request, 1, 1,
|
||||||
&request, 1, 1,
|
"q" "sssdsscc",
|
||||||
"q" "sssdsc" "sc" "sscc",
|
HTTPMETHOD_SUBSCRIBE, &dest_url,
|
||||||
HTTPMETHOD_SUBSCRIBE, &dest_url,
|
"CALLBACK: <http://", LOCAL_HOST,
|
||||||
"CALLBACK: <http://", LOCAL_HOST, ":", LOCAL_PORT, "/>",
|
":", LOCAL_PORT,
|
||||||
"NT: upnp:event",
|
"/>\r\n" "NT: upnp:event\r\n"
|
||||||
"TIMEOUT: Second-", timeout_str );
|
"TIMEOUT: Second-", timeout_str );
|
||||||
}
|
}
|
||||||
if( return_code != 0 ) {
|
if( return_code != 0 ) {
|
||||||
return return_code;
|
return return_code;
|
||||||
|
@@ -219,11 +219,9 @@ notify_send_and_recv( IN uri_type * destination_url,
|
|||||||
}
|
}
|
||||||
// make start line and HOST header
|
// make start line and HOST header
|
||||||
membuffer_init( &start_msg );
|
membuffer_init( &start_msg );
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage( &start_msg, 1, 1,
|
||||||
&start_msg, 1, 1,
|
"q" "s",
|
||||||
"q" "s",
|
HTTPMETHOD_NOTIFY, &url, mid_msg->buf ) != 0 ) {
|
||||||
HTTPMETHOD_NOTIFY, &url,
|
|
||||||
mid_msg->buf ) != 0 ) {
|
|
||||||
membuffer_destroy( &start_msg );
|
membuffer_destroy( &start_msg );
|
||||||
sock_destroy( &info, SD_BOTH );
|
sock_destroy( &info, SD_BOTH );
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
@@ -298,12 +296,11 @@ genaNotify( IN char *headers,
|
|||||||
|
|
||||||
// make 'end' msg (the part that won't vary with the destination)
|
// make 'end' msg (the part that won't vary with the destination)
|
||||||
endmsg.size_inc = 30;
|
endmsg.size_inc = 30;
|
||||||
if( http_MakeMessage(
|
if( http_MakeMessage( &mid_msg, 1, 1,
|
||||||
&mid_msg, 1, 1,
|
"s" "ssc" "sdcc",
|
||||||
"s" "ssc" "sdcc",
|
headers,
|
||||||
headers,
|
"SID: ", sub->sid,
|
||||||
"SID: ", sub->sid,
|
"SEQ: ", sub->ToSendEventKey ) != 0 ) {
|
||||||
"SEQ: ", sub->ToSendEventKey ) != 0 ) {
|
|
||||||
membuffer_destroy( &mid_msg );
|
membuffer_destroy( &mid_msg );
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -574,7 +571,7 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: "
|
sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: "
|
||||||
"%zd\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
"%d\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
||||||
strlen( propertySet ) + 1 );
|
strlen( propertySet ) + 1 );
|
||||||
|
|
||||||
//schedule thread for initial notification
|
//schedule thread for initial notification
|
||||||
@@ -1168,14 +1165,10 @@ respond_ok( IN SOCKINFO * info,
|
|||||||
|
|
||||||
membuffer_init( &response );
|
membuffer_init( &response );
|
||||||
response.size_inc = 30;
|
response.size_inc = 30;
|
||||||
if( http_MakeMessage(
|
if( http_MakeMessage( &response, major, minor,
|
||||||
&response, major, minor,
|
"R" "D" "S" "N" "Xc" "ssc" "sc" "c",
|
||||||
"R" "D" "S" "N" "Xc" "ssc" "scc",
|
HTTP_OK, 0, X_USER_AGENT,
|
||||||
HTTP_OK,
|
"SID: ", sub->sid, timeout_str ) != 0 ) {
|
||||||
(off_t)0,
|
|
||||||
X_USER_AGENT,
|
|
||||||
"SID: ", sub->sid,
|
|
||||||
timeout_str ) != 0 ) {
|
|
||||||
membuffer_destroy( &response );
|
membuffer_destroy( &response );
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
typedef int socklen_t;
|
#define socklen_t int
|
||||||
#define EAFNOSUPPORT 97
|
#define EAFNOSUPPORT 97
|
||||||
#endif
|
#endif
|
||||||
#include "unixutil.h"
|
#include "unixutil.h"
|
||||||
@@ -651,11 +651,6 @@ get_miniserver_sockets( MiniServerSockArray * out,
|
|||||||
sizeof( struct sockaddr_in )
|
sizeof( struct sockaddr_in )
|
||||||
);
|
);
|
||||||
if( sockError == UPNP_SOCKETERROR ) {
|
if( sockError == UPNP_SOCKETERROR ) {
|
||||||
#ifdef WIN32
|
|
||||||
errCode = WSAGetLastError();
|
|
||||||
#else
|
|
||||||
errCode = errno;
|
|
||||||
#endif
|
|
||||||
if( errno == EADDRINUSE )
|
if( errno == EADDRINUSE )
|
||||||
errCode = 1;
|
errCode = 1;
|
||||||
} else
|
} else
|
||||||
|
@@ -39,16 +39,9 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#ifndef UPNP_USE_BCBPP
|
|
||||||
#ifndef UPNP_USE_MSVCPP
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -56,6 +49,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@@ -312,8 +306,8 @@ http_SendMessage( IN SOCKINFO * info,
|
|||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
FILE *Fp;
|
FILE *Fp;
|
||||||
int num_read,
|
int num_read,
|
||||||
num_written;
|
num_written,
|
||||||
off_t amount_to_be_read = 0;
|
amount_to_be_read = 0;
|
||||||
va_list argp;
|
va_list argp;
|
||||||
char *file_buf = NULL,
|
char *file_buf = NULL,
|
||||||
*ChunkBuf = NULL;
|
*ChunkBuf = NULL;
|
||||||
@@ -373,7 +367,7 @@ http_SendMessage( IN SOCKINFO * info,
|
|||||||
return UPNP_E_FILE_READ_ERROR;
|
return UPNP_E_FILE_READ_ERROR;
|
||||||
}
|
}
|
||||||
} else if( Instr && Instr->IsRangeActive ) {
|
} else if( Instr && Instr->IsRangeActive ) {
|
||||||
if( fseeko( Fp, Instr->RangeOffset, SEEK_CUR ) != 0 ) {
|
if( fseek( Fp, Instr->RangeOffset, SEEK_CUR ) != 0 ) {
|
||||||
free( ChunkBuf );
|
free( ChunkBuf );
|
||||||
return UPNP_E_FILE_READ_ERROR;
|
return UPNP_E_FILE_READ_ERROR;
|
||||||
}
|
}
|
||||||
@@ -643,14 +637,13 @@ http_Download( IN const char *url_str,
|
|||||||
*temp = '/';
|
*temp = '/';
|
||||||
DBGONLY( UpnpPrintf
|
DBGONLY( UpnpPrintf
|
||||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
"HOSTNAME : %s Length : %zu\n", hoststr, hostlen );
|
"HOSTNAME : %s Length : %d\n", hoststr, hostlen );
|
||||||
)
|
)
|
||||||
|
|
||||||
ret_code = http_MakeMessage(
|
ret_code = http_MakeMessage( &request, 1, 1, "QsbcDCUc",
|
||||||
&request, 1, 1,
|
HTTPMETHOD_GET, url.pathquery.buff,
|
||||||
"QsbcDCUc",
|
url.pathquery.size, "HOST: ", hoststr,
|
||||||
HTTPMETHOD_GET, url.pathquery.buff, url.pathquery.size,
|
hostlen );
|
||||||
"HOST: ", hoststr, hostlen );
|
|
||||||
if( ret_code != 0 ) {
|
if( ret_code != 0 ) {
|
||||||
DBGONLY( UpnpPrintf
|
DBGONLY( UpnpPrintf
|
||||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
@@ -714,7 +707,7 @@ http_Download( IN const char *url_str,
|
|||||||
|
|
||||||
// save mem for body only
|
// save mem for body only
|
||||||
*document = realloc( msg_start, *doc_length + 1 ); //LEAK_FIX_MK
|
*document = realloc( msg_start, *doc_length + 1 ); //LEAK_FIX_MK
|
||||||
// *document = Realloc( msg_start,msg_length, *doc_length + 1 );//LEAK_FIX_MK
|
//*document = Realloc( msg_start,msg_length, *doc_length + 1 );//LEAK_FIX_MK
|
||||||
|
|
||||||
// shrink can't fail
|
// shrink can't fail
|
||||||
assert( ( int )msg_length > *doc_length );
|
assert( ( int )msg_length > *doc_length );
|
||||||
@@ -802,31 +795,22 @@ MakePostMessage( const char *url_str,
|
|||||||
"HOSTNAME : %s Length : %d\n", hoststr, hostlen );
|
"HOSTNAME : %s Length : %d\n", hoststr, hostlen );
|
||||||
)
|
)
|
||||||
|
|
||||||
if( contentLength >= 0 ) {
|
if( contentLength >= 0 ) {
|
||||||
ret_code = http_MakeMessage(
|
ret_code = http_MakeMessage( request, 1, 1, "QsbcDCUTNc",
|
||||||
request, 1, 1,
|
HTTPMETHOD_POST, url->pathquery.buff,
|
||||||
"Q" "s" "bcDCU" "T" "Nc",
|
url->pathquery.size, "HOST: ",
|
||||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
hoststr, hostlen, contentType,
|
||||||
"HOST: ",
|
contentLength );
|
||||||
hoststr, hostlen,
|
|
||||||
contentType,
|
|
||||||
(off_t)contentLength );
|
|
||||||
} else if( contentLength == UPNP_USING_CHUNKED ) {
|
} else if( contentLength == UPNP_USING_CHUNKED ) {
|
||||||
ret_code = http_MakeMessage(
|
ret_code = http_MakeMessage( request, 1, 1, "QsbcDCUTKc",
|
||||||
request, 1, 1,
|
HTTPMETHOD_POST, url->pathquery.buff,
|
||||||
"Q" "s" "bcDCU" "TKc",
|
url->pathquery.size, "HOST: ",
|
||||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
hoststr, hostlen, contentType );
|
||||||
"HOST: ",
|
|
||||||
hoststr, hostlen,
|
|
||||||
contentType );
|
|
||||||
} else if( contentLength == UPNP_UNTIL_CLOSE ) {
|
} else if( contentLength == UPNP_UNTIL_CLOSE ) {
|
||||||
ret_code = http_MakeMessage(
|
ret_code = http_MakeMessage( request, 1, 1, "QsbcDCUTc",
|
||||||
request, 1, 1,
|
HTTPMETHOD_POST, url->pathquery.buff,
|
||||||
"Q" "s" "bcDCU" "Tc",
|
url->pathquery.size, "HOST: ",
|
||||||
HTTPMETHOD_POST, url->pathquery.buff, url->pathquery.size,
|
hoststr, hostlen, contentType );
|
||||||
"HOST: ",
|
|
||||||
hoststr, hostlen,
|
|
||||||
contentType );
|
|
||||||
} else {
|
} else {
|
||||||
ret_code = UPNP_E_INVALID_PARAM;
|
ret_code = UPNP_E_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
@@ -1147,11 +1131,9 @@ MakeGetMessage( const char *url_str,
|
|||||||
querylen = url->pathquery.size;
|
querylen = url->pathquery.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret_code = http_MakeMessage(
|
ret_code = http_MakeMessage( request, 1, 1, "QsbcDCUc",
|
||||||
request, 1, 1,
|
HTTPMETHOD_GET, querystr, querylen,
|
||||||
"QsbcDCUc",
|
"HOST: ", hoststr, hostlen );
|
||||||
HTTPMETHOD_GET, querystr, querylen,
|
|
||||||
"HOST: ", hoststr, hostlen );
|
|
||||||
|
|
||||||
if( ret_code != 0 ) {
|
if( ret_code != 0 ) {
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
@@ -1747,11 +1729,8 @@ http_SendStatusResponse( IN SOCKINFO * info,
|
|||||||
membuffer_init( &membuf );
|
membuffer_init( &membuf );
|
||||||
membuf.size_inc = 70;
|
membuf.size_inc = 70;
|
||||||
|
|
||||||
ret = http_MakeMessage(
|
ret = http_MakeMessage( &membuf, response_major, response_minor, "RSCB", http_status_code, // response start line
|
||||||
&membuf, response_major, response_minor,
|
http_status_code ); // body
|
||||||
"RSCB",
|
|
||||||
http_status_code, // response start line
|
|
||||||
http_status_code ); // body
|
|
||||||
if( ret == 0 ) {
|
if( ret == 0 ) {
|
||||||
timeout = HTTP_DEFAULT_TIMEOUT;
|
timeout = HTTP_DEFAULT_TIMEOUT;
|
||||||
ret = http_SendMessage( info, &timeout, "b",
|
ret = http_SendMessage( info, &timeout, "b",
|
||||||
@@ -1778,30 +1757,28 @@ http_SendStatusResponse( IN SOCKINFO * info,
|
|||||||
* specified in the input parameters.
|
* specified in the input parameters.
|
||||||
*
|
*
|
||||||
* fmt types:
|
* fmt types:
|
||||||
* 'B': arg = int status_code
|
* 's': arg = const char* C_string
|
||||||
* appends content-length, content-type and HTML body for given code
|
|
||||||
* 'b': arg1 = const char* buf; arg2 = size_t buf_length
|
* 'b': arg1 = const char* buf; arg2 = size_t buf_length
|
||||||
* memory ptr
|
* memory ptr
|
||||||
|
* 'c': (no args) appends CRLF "\r\n"
|
||||||
|
* 'd': arg = int number // appends decimal number
|
||||||
|
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
||||||
|
* 'D': (no args) appends HTTP DATE: header
|
||||||
|
* 'S': (no args) appends HTTP SERVER: header
|
||||||
|
* 'U': (no args) appends HTTP USER-AGENT: header
|
||||||
* 'C': (no args) appends a HTTP CONNECTION: close header
|
* 'C': (no args) appends a HTTP CONNECTION: close header
|
||||||
* depending on major,minor version
|
* depending on major,minor version
|
||||||
* 'c': (no args) appends CRLF "\r\n"
|
|
||||||
* 'D': (no args) appends HTTP DATE: header
|
|
||||||
* 'd': arg = int number // appends decimal number
|
|
||||||
* '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
|
* '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;
|
* 'Q': arg1 = http_method_t; arg2 = char* url;
|
||||||
* arg3 = int url_length // start line of request
|
* arg3 = int url_length // start line of request
|
||||||
* 'R': arg = int status_code // adds a response start line
|
* 'R': arg = int status_code // adds a response start line
|
||||||
* 'S': (no args) appends HTTP SERVER: header
|
* 'B': arg = int status_code
|
||||||
* 's': arg = const char* C_string
|
* appends content-length, content-type and HTML body for given code
|
||||||
* 'T': arg = char * content_type; format e.g: "text/html";
|
* 'T': arg = char * content_type; format e.g: "text/html";
|
||||||
* content-type header
|
* content-type header
|
||||||
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
* --- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld@users.sourceforge.net>
|
||||||
* 'U': (no args) appends HTTP USER-AGENT: header
|
* 'X': arg = const char useragent; "redsonic" HTTP X-User-Agent: useragent
|
||||||
* 'X': arg = const char useragent; "redsonic" HTTP X-User-Agent: useragent
|
* --- PATCH END ---
|
||||||
*
|
*
|
||||||
* Return : int;
|
* Return : int;
|
||||||
* 0 - On Success
|
* 0 - On Success
|
||||||
@@ -1819,8 +1796,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
char *s = NULL;
|
char *s = NULL;
|
||||||
size_t num;
|
int num;
|
||||||
off_t bignum;
|
|
||||||
size_t length;
|
size_t length;
|
||||||
time_t *loc_time;
|
time_t *loc_time;
|
||||||
time_t curr_time;
|
time_t curr_time;
|
||||||
@@ -1902,17 +1878,7 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
{
|
{
|
||||||
num = ( int )va_arg( argp, int );
|
num = ( int )va_arg( argp, int );
|
||||||
|
|
||||||
sprintf( tempbuf, "%zu", num );
|
sprintf( tempbuf, "%d", num );
|
||||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
|
||||||
goto error_handler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if( c == 'h' ) // off_t
|
|
||||||
{
|
|
||||||
bignum = ( off_t )va_arg( argp, off_t );
|
|
||||||
|
|
||||||
sprintf( tempbuf, "%"PRId64, (int64_t)bignum );
|
|
||||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
@@ -1959,13 +1925,12 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
|
|
||||||
else if( c == 'N' ) {
|
else if( c == 'N' ) {
|
||||||
// content-length header
|
// content-length header
|
||||||
bignum = ( off_t )va_arg( argp, off_t );
|
num = ( int )va_arg( argp, int );
|
||||||
|
|
||||||
assert( bignum >= 0 );
|
assert( num >= 0 );
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage
|
||||||
buf, http_major_version, http_minor_version,
|
( buf, http_major_version, http_minor_version, "sdc",
|
||||||
"shc",
|
"CONTENT-LENGTH: ", num ) != 0 ) {
|
||||||
"CONTENT-LENGTH: ", bignum ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1975,14 +1940,14 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
|
|
||||||
temp_str = ( c == 'S' ) ? "SERVER: " : "USER-AGENT: ";
|
temp_str = ( c == 'S' ) ? "SERVER: " : "USER-AGENT: ";
|
||||||
get_sdk_info( tempbuf );
|
get_sdk_info( tempbuf );
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage
|
||||||
buf, http_major_version, http_minor_version,
|
( buf, http_major_version, http_minor_version, "ss",
|
||||||
"ss",
|
temp_str, tempbuf ) != 0 ) {
|
||||||
temp_str, tempbuf ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld@users.sourceforge.net> */
|
||||||
else if( c == 'X' ) // C string
|
else if( c == 'X' ) // C string
|
||||||
{
|
{
|
||||||
s = ( char * )va_arg( argp, char * );
|
s = ( char * )va_arg( argp, char * );
|
||||||
@@ -1997,6 +1962,9 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- PATCH END --- */
|
||||||
|
|
||||||
|
|
||||||
else if( c == 'R' ) {
|
else if( c == 'R' ) {
|
||||||
// response start line
|
// response start line
|
||||||
// e.g.: 'HTTP/1.1 200 OK'
|
// e.g.: 'HTTP/1.1 200 OK'
|
||||||
@@ -2011,11 +1979,9 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
|
|
||||||
// str
|
// str
|
||||||
status_msg = http_get_code_text( status_code );
|
status_msg = http_get_code_text( status_code );
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage
|
||||||
buf, http_major_version, http_minor_version,
|
( buf, http_major_version, http_minor_version, "ssc",
|
||||||
"ssc",
|
tempbuf, status_msg ) != 0 ) {
|
||||||
tempbuf,
|
|
||||||
status_msg ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2030,14 +1996,11 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
"<html><body><h1>",
|
"<html><body><h1>",
|
||||||
status_code, http_get_code_text( status_code ),
|
status_code, http_get_code_text( status_code ),
|
||||||
"</h1></body></html>" );
|
"</h1></body></html>" );
|
||||||
bignum = strlen( tempbuf );
|
num = strlen( tempbuf );
|
||||||
|
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage( buf, http_major_version, http_minor_version, "NTcs", num, // content-length
|
||||||
buf, http_major_version, http_minor_version,
|
"text/html", // content-type
|
||||||
"NTcs",
|
tempbuf ) != 0 ) // body
|
||||||
bignum, // content-length
|
|
||||||
"text/html", // content-type
|
|
||||||
tempbuf ) != 0 ) // body
|
|
||||||
{
|
{
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
@@ -2046,18 +2009,17 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
else if( c == 'Q' ) {
|
else if( c == 'Q' ) {
|
||||||
// request start line
|
// request start line
|
||||||
// GET /foo/bar.html HTTP/1.1\r\n
|
// GET /foo/bar.html HTTP/1.1\r\n
|
||||||
|
//
|
||||||
|
|
||||||
method = ( http_method_t ) va_arg( argp, http_method_t );
|
method = ( http_method_t ) va_arg( argp, http_method_t );
|
||||||
method_str = method_to_str( method );
|
method_str = method_to_str( method );
|
||||||
url_str = ( const char * )va_arg( argp, const char * );
|
url_str = ( const char * )va_arg( argp, const char * );
|
||||||
num = ( size_t )va_arg( argp, size_t ); // length of url_str
|
num = ( int )va_arg( argp, int ); // length of url_str
|
||||||
|
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage( buf, http_major_version, http_minor_version, "ssbsdsdc", method_str, // method
|
||||||
buf, http_major_version, http_minor_version,
|
" ", url_str, num, // url
|
||||||
"ssbsdsdc",
|
" HTTP/", http_major_version, ".",
|
||||||
method_str, // method
|
http_minor_version ) != 0 ) {
|
||||||
" ", url_str, num, // url
|
|
||||||
" HTTP/", http_major_version, ".", http_minor_version ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2074,11 +2036,10 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage
|
||||||
buf, http_major_version, http_minor_version,
|
( buf, http_major_version, http_minor_version, "Q" "sbc",
|
||||||
"Q" "sbc",
|
method, url.pathquery.buff, url.pathquery.size, "HOST: ",
|
||||||
method, url.pathquery.buff, url.pathquery.size,
|
url.hostport.text.buff, url.hostport.text.size ) != 0 ) {
|
||||||
"HOST: ", url.hostport.text.buff, url.hostport.text.size ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2087,10 +2048,9 @@ http_MakeMessage( INOUT membuffer * buf,
|
|||||||
// content type header
|
// content type header
|
||||||
temp_str = ( const char * )va_arg( argp, const char * ); // type/subtype format
|
temp_str = ( const char * )va_arg( argp, const char * ); // type/subtype format
|
||||||
|
|
||||||
if (http_MakeMessage(
|
if( http_MakeMessage
|
||||||
buf, http_major_version, http_minor_version,
|
( buf, http_major_version, http_minor_version, "ssc",
|
||||||
"ssc",
|
"CONTENT-TYPE: ", temp_str ) != 0 ) {
|
||||||
"CONTENT-TYPE: ", temp_str ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2214,13 +2174,16 @@ MakeGetMessageEx( const char *url_str,
|
|||||||
hostlen );
|
hostlen );
|
||||||
)
|
)
|
||||||
|
|
||||||
errCode = http_MakeMessage(
|
errCode = http_MakeMessage( request,
|
||||||
request, 1, 1,
|
1,
|
||||||
"QsbcGDCUc",
|
1,
|
||||||
HTTPMETHOD_GET,
|
"QsbcGDCUc",
|
||||||
url->pathquery.buff, url->pathquery.size,
|
HTTPMETHOD_GET,
|
||||||
"HOST: ", hoststr, hostlen,
|
url->pathquery.buff,
|
||||||
pRangeSpecifier );
|
url->pathquery.size,
|
||||||
|
"HOST: ",
|
||||||
|
hoststr,
|
||||||
|
hostlen, pRangeSpecifier );
|
||||||
|
|
||||||
if( errCode != 0 ) {
|
if( errCode != 0 ) {
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
|
@@ -37,12 +37,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifndef UPNP_USE_BCBPP
|
|
||||||
#ifndef UPNP_USE_MSVCPP
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "strintmap.h"
|
#include "strintmap.h"
|
||||||
#include "membuffer.h"
|
#include "membuffer.h"
|
||||||
@@ -55,7 +49,7 @@
|
|||||||
#include "ssdplib.h"
|
#include "ssdplib.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
@@ -638,8 +632,8 @@ get_file_info( IN const char *filename,
|
|||||||
rc = get_content_type( filename, &info->content_type );
|
rc = get_content_type( filename, &info->content_type );
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
"file info: %s, length: %lld, last_mod=%s readable=%d\n",
|
"file info: %s, length: %d, last_mod=%s readable=%d\n",
|
||||||
filename, (long long)info->file_length,
|
filename, info->file_length,
|
||||||
asctime( gmtime( &info->last_modified ) ),
|
asctime( gmtime( &info->last_modified ) ),
|
||||||
info->is_readable ); )
|
info->is_readable ); )
|
||||||
|
|
||||||
@@ -877,8 +871,8 @@ StrTok( char **Src,
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
GetNextRange( char **SrcRangeStr,
|
GetNextRange( char **SrcRangeStr,
|
||||||
off_t *FirstByte,
|
int *FirstByte,
|
||||||
off_t *LastByte )
|
int *LastByte )
|
||||||
{
|
{
|
||||||
char *Ptr,
|
char *Ptr,
|
||||||
*Tok;
|
*Tok;
|
||||||
@@ -942,11 +936,11 @@ GetNextRange( char **SrcRangeStr,
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
||||||
off_t FileLength,
|
long FileLength,
|
||||||
OUT struct SendInstruction *Instr )
|
OUT struct SendInstruction *Instr )
|
||||||
{
|
{
|
||||||
|
|
||||||
off_t FirstByte,
|
int FirstByte,
|
||||||
LastByte;
|
LastByte;
|
||||||
char *RangeInput,
|
char *RangeInput,
|
||||||
*Ptr;
|
*Ptr;
|
||||||
@@ -990,36 +984,28 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
|
|
||||||
Instr->RangeOffset = FirstByte;
|
Instr->RangeOffset = FirstByte;
|
||||||
Instr->ReadSendSize = LastByte - FirstByte + 1;
|
Instr->ReadSendSize = LastByte - FirstByte + 1;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader, "CONTENT-RANGE: bytes %d-%d/%ld\r\n", FirstByte, LastByte, 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
|
} else if( FirstByte >= 0 && LastByte == -1
|
||||||
&& FirstByte < FileLength ) {
|
&& FirstByte < FileLength ) {
|
||||||
Instr->RangeOffset = FirstByte;
|
Instr->RangeOffset = FirstByte;
|
||||||
Instr->ReadSendSize = FileLength - FirstByte;
|
Instr->ReadSendSize = FileLength - FirstByte;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
"CONTENT-RANGE: bytes %d-%ld/%ld\r\n", FirstByte,
|
||||||
(int64_t)FirstByte,
|
FileLength - 1, FileLength );
|
||||||
(int64_t)(FileLength - 1),
|
|
||||||
(int64_t)FileLength );
|
|
||||||
} else if( FirstByte == -1 && LastByte > 0 ) {
|
} else if( FirstByte == -1 && LastByte > 0 ) {
|
||||||
if( LastByte >= FileLength ) {
|
if( LastByte >= FileLength ) {
|
||||||
Instr->RangeOffset = 0;
|
Instr->RangeOffset = 0;
|
||||||
Instr->ReadSendSize = FileLength;
|
Instr->ReadSendSize = FileLength;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes 0-%"PRId64"/%"PRId64"\r\n",
|
"CONTENT-RANGE: bytes 0-%ld/%ld\r\n",
|
||||||
(int64_t)(FileLength - 1),
|
FileLength - 1, FileLength );
|
||||||
(int64_t)FileLength );
|
|
||||||
} else {
|
} else {
|
||||||
Instr->RangeOffset = FileLength - LastByte;
|
Instr->RangeOffset = FileLength - LastByte;
|
||||||
Instr->ReadSendSize = LastByte;
|
Instr->ReadSendSize = LastByte;
|
||||||
sprintf( Instr->RangeHeader,
|
sprintf( Instr->RangeHeader,
|
||||||
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
|
"CONTENT-RANGE: bytes %ld-%ld/%ld\r\n",
|
||||||
(int64_t)(FileLength - LastByte + 1),
|
FileLength - LastByte + 1, FileLength,
|
||||||
(int64_t)FileLength,
|
FileLength );
|
||||||
(int64_t)FileLength );
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
free( RangeInput );
|
free( RangeInput );
|
||||||
@@ -1056,7 +1042,7 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
int
|
int
|
||||||
CheckOtherHTTPHeaders( IN http_message_t * Req,
|
CheckOtherHTTPHeaders( IN http_message_t * Req,
|
||||||
OUT struct SendInstruction *RespInstr,
|
OUT struct SendInstruction *RespInstr,
|
||||||
off_t FileSize )
|
int FileSize )
|
||||||
{
|
{
|
||||||
http_header_t *header;
|
http_header_t *header;
|
||||||
ListNode *node;
|
ListNode *node;
|
||||||
@@ -1198,6 +1184,7 @@ process_request( IN http_message_t * req,
|
|||||||
int code;
|
int code;
|
||||||
int err_code;
|
int err_code;
|
||||||
|
|
||||||
|
//membuffer content_type;
|
||||||
char *request_doc;
|
char *request_doc;
|
||||||
struct File_Info finfo;
|
struct File_Info finfo;
|
||||||
xboolean using_alias;
|
xboolean using_alias;
|
||||||
@@ -1207,7 +1194,7 @@ process_request( IN http_message_t * req,
|
|||||||
int resp_major,
|
int resp_major,
|
||||||
resp_minor;
|
resp_minor;
|
||||||
xboolean alias_grabbed;
|
xboolean alias_grabbed;
|
||||||
size_t dummy;
|
int dummy;
|
||||||
struct UpnpVirtualDirCallbacks *pVirtualDirCallback;
|
struct UpnpVirtualDirCallbacks *pVirtualDirCallback;
|
||||||
|
|
||||||
print_http_headers( req );
|
print_http_headers( req );
|
||||||
@@ -1221,6 +1208,7 @@ process_request( IN http_message_t * req,
|
|||||||
// init
|
// init
|
||||||
request_doc = NULL;
|
request_doc = NULL;
|
||||||
finfo.content_type = NULL;
|
finfo.content_type = NULL;
|
||||||
|
//membuffer_init( &content_type );
|
||||||
alias_grabbed = FALSE;
|
alias_grabbed = FALSE;
|
||||||
err_code = HTTP_INTERNAL_SERVER_ERROR; // default error
|
err_code = HTTP_INTERNAL_SERVER_ERROR; // default error
|
||||||
using_virtual_dir = FALSE;
|
using_virtual_dir = FALSE;
|
||||||
@@ -1374,7 +1362,7 @@ process_request( IN http_message_t * req,
|
|||||||
|
|
||||||
RespInstr->ReadSendSize = finfo.file_length;
|
RespInstr->ReadSendSize = finfo.file_length;
|
||||||
|
|
||||||
// Check other header field.
|
//Check other header field.
|
||||||
if( ( err_code =
|
if( ( err_code =
|
||||||
CheckOtherHTTPHeaders( req, RespInstr,
|
CheckOtherHTTPHeaders( req, RespInstr,
|
||||||
finfo.file_length ) ) != HTTP_OK ) {
|
finfo.file_length ) ) != HTTP_OK ) {
|
||||||
@@ -1388,80 +1376,85 @@ process_request( IN http_message_t * req,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( RespInstr->IsRangeActive && RespInstr->IsChunkActive ) {
|
if( RespInstr->IsRangeActive && RespInstr->IsChunkActive ) {
|
||||||
// Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
|
||||||
// Transfer-Encoding: chunked
|
/* - PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net>
|
||||||
if (http_MakeMessage(
|
* added X-User-Agent header
|
||||||
headers, resp_major, resp_minor,
|
*/
|
||||||
"R" "T" "GKD" "s" "tcS" "XcCc",
|
|
||||||
HTTP_PARTIAL_CONTENT, // status code
|
//Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
||||||
finfo.content_type, // content type
|
//Transfer-Encoding: chunked
|
||||||
RespInstr, // range info
|
// K means add chunky header ang G means range header.
|
||||||
"LAST-MODIFIED: ",
|
if( http_MakeMessage( headers, resp_major, resp_minor, "RTGKDstcSXcCc", HTTP_PARTIAL_CONTENT, // status code
|
||||||
&finfo.last_modified,
|
// RespInstr->ReadSendSize,// content length
|
||||||
X_USER_AGENT) != 0 ) {
|
finfo.content_type,
|
||||||
|
// content_type.buf, // content type
|
||||||
|
RespInstr, // Range
|
||||||
|
"LAST-MODIFIED: ",
|
||||||
|
&finfo.last_modified,
|
||||||
|
X_USER_AGENT) != 0 ) {
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
} else if( RespInstr->IsRangeActive && !RespInstr->IsChunkActive ) {
|
} else if( RespInstr->IsRangeActive && !RespInstr->IsChunkActive ) {
|
||||||
|
|
||||||
// Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
//Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
||||||
// Transfer-Encoding: chunked
|
//Transfer-Encoding: chunked
|
||||||
if (http_MakeMessage(
|
// K means add chunky header ang G means range header.
|
||||||
headers, resp_major, resp_minor,
|
if( http_MakeMessage( headers, resp_major, resp_minor, "RNTGDstcSXcCc", HTTP_PARTIAL_CONTENT, // status code
|
||||||
"R" "N" "T" "GD" "s" "tcS" "XcCc",
|
RespInstr->ReadSendSize, // content length
|
||||||
HTTP_PARTIAL_CONTENT, // status code
|
finfo.content_type,
|
||||||
RespInstr->ReadSendSize, // content length
|
//content_type.buf, // content type
|
||||||
finfo.content_type, // content type
|
RespInstr, //Range Info
|
||||||
RespInstr, // range info
|
"LAST-MODIFIED: ",
|
||||||
"LAST-MODIFIED: ",
|
&finfo.last_modified,
|
||||||
&finfo.last_modified,
|
X_USER_AGENT) != 0 ) {
|
||||||
X_USER_AGENT) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if( !RespInstr->IsRangeActive && RespInstr->IsChunkActive ) {
|
} else if( !RespInstr->IsRangeActive && RespInstr->IsChunkActive ) {
|
||||||
// Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
|
||||||
// Transfer-Encoding: chunked
|
//Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
||||||
if (http_MakeMessage(
|
//Transfer-Encoding: chunked
|
||||||
headers, resp_major, resp_minor,
|
// K means add chunky header ang G means range header.
|
||||||
"RK" "TD" "s" "tcS" "XcCc",
|
if( http_MakeMessage( headers, resp_major, resp_minor, "RKTDstcSXcCc", HTTP_OK, // status code
|
||||||
HTTP_OK, // status code
|
//RespInstr->ReadSendSize,// content length
|
||||||
finfo.content_type, // content type
|
finfo.content_type,
|
||||||
"LAST-MODIFIED: ",
|
// content_type.buf, // content type
|
||||||
&finfo.last_modified,
|
"LAST-MODIFIED: ",
|
||||||
X_USER_AGENT) != 0 ) {
|
&finfo.last_modified,
|
||||||
|
X_USER_AGENT) != 0 ) {
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // !RespInstr->IsRangeActive && !RespInstr->IsChunkActive
|
} else {
|
||||||
if (RespInstr->ReadSendSize >= 0) {
|
if( RespInstr->ReadSendSize >= 0 ) {
|
||||||
// Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
//Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
||||||
// Transfer-Encoding: chunked
|
//Transfer-Encoding: chunked
|
||||||
if (http_MakeMessage(
|
// K means add chunky header ang G means range header.
|
||||||
headers, resp_major, resp_minor,
|
if( http_MakeMessage( headers, resp_major, resp_minor, "RNTDstcSXcCc", HTTP_OK, // status code
|
||||||
"R" "N" "TD" "s" "tcS" "XcCc",
|
RespInstr->ReadSendSize, // content length
|
||||||
HTTP_OK, // status code
|
finfo.content_type,
|
||||||
RespInstr->ReadSendSize, // content length
|
//content_type.buf, // content type
|
||||||
finfo.content_type, // content type
|
"LAST-MODIFIED: ",
|
||||||
"LAST-MODIFIED: ",
|
&finfo.last_modified,
|
||||||
&finfo.last_modified,
|
X_USER_AGENT) != 0 ) {
|
||||||
X_USER_AGENT) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
//Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT
|
||||||
// Transfer-Encoding: chunked
|
//Transfer-Encoding: chunked
|
||||||
if (http_MakeMessage(
|
// K means add chunky header ang G means range header.
|
||||||
headers, resp_major, resp_minor,
|
if( http_MakeMessage( headers, resp_major, resp_minor, "RTDstcSXcCc", HTTP_OK, // status code
|
||||||
"R" "TD" "s" "tcS" "XcCc",
|
//RespInstr->ReadSendSize,// content length
|
||||||
HTTP_OK, // status code
|
finfo.content_type,
|
||||||
finfo.content_type, // content type
|
//content_type.buf, // content type
|
||||||
"LAST-MODIFIED: ",
|
"LAST-MODIFIED: ",
|
||||||
&finfo.last_modified,
|
&finfo.last_modified,
|
||||||
X_USER_AGENT) != 0 ) {
|
X_USER_AGENT) != 0 ) {
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* -- PATCH END -- */
|
||||||
|
|
||||||
if( req->method == HTTPMETHOD_HEAD ) {
|
if( req->method == HTTPMETHOD_HEAD ) {
|
||||||
*rtype = RESP_HEADERS;
|
*rtype = RESP_HEADERS;
|
||||||
@@ -1475,8 +1468,8 @@ process_request( IN http_message_t * req,
|
|||||||
*rtype = RESP_FILEDOC;
|
*rtype = RESP_FILEDOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
// simple get http 0.9 as specified in http 1.0
|
//simple get http 0.9 as specified in http 1.0
|
||||||
// don't send headers
|
//don't send headers
|
||||||
if( req->method == HTTPMETHOD_SIMPLEGET ) {
|
if( req->method == HTTPMETHOD_SIMPLEGET ) {
|
||||||
membuffer_destroy( headers );
|
membuffer_destroy( headers );
|
||||||
}
|
}
|
||||||
@@ -1486,6 +1479,7 @@ process_request( IN http_message_t * req,
|
|||||||
error_handler:
|
error_handler:
|
||||||
free( request_doc );
|
free( request_doc );
|
||||||
ixmlFreeDOMString( finfo.content_type );
|
ixmlFreeDOMString( finfo.content_type );
|
||||||
|
// membuffer_destroy( &content_type );
|
||||||
if( err_code != UPNP_E_SUCCESS && alias_grabbed ) {
|
if( err_code != UPNP_E_SUCCESS && alias_grabbed ) {
|
||||||
alias_release( alias );
|
alias_release( alias );
|
||||||
}
|
}
|
||||||
@@ -1744,12 +1738,12 @@ web_server_callback( IN http_parser_t * parser,
|
|||||||
&RespInstr );
|
&RespInstr );
|
||||||
//Send response.
|
//Send response.
|
||||||
|
|
||||||
http_MakeMessage(
|
/* - PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net>
|
||||||
&headers, 1, 1,
|
* added X-User-Agent header
|
||||||
"RTDSXcCc",
|
*/
|
||||||
ret,
|
http_MakeMessage( &headers, 1, 1, "RTDSXcCc", ret,
|
||||||
"text/html",
|
"text/html", X_USER_AGENT );
|
||||||
X_USER_AGENT );
|
/* - PATCH END --- */
|
||||||
|
|
||||||
http_SendMessage( info, &timeout, "b", headers.buf,
|
http_SendMessage( info, &timeout, "b", headers.buf,
|
||||||
headers.length );
|
headers.length );
|
||||||
|
@@ -125,7 +125,7 @@ is_unreserved( char in )
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
is_escaped( const char *in )
|
is_escaped( char *in )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( ( in[0] == '%' ) && ( isxdigit( in[1] ) ) && isxdigit( in[2] ) ) {
|
if( ( in[0] == '%' ) && ( isxdigit( in[1] ) ) && isxdigit( in[2] ) ) {
|
||||||
@@ -157,7 +157,7 @@ is_escaped( const char *in )
|
|||||||
int
|
int
|
||||||
replace_escaped( char *in,
|
replace_escaped( char *in,
|
||||||
int index,
|
int index,
|
||||||
size_t *max )
|
int *max )
|
||||||
{
|
{
|
||||||
int tempInt = 0;
|
int tempInt = 0;
|
||||||
char tempChar = 0;
|
char tempChar = 0;
|
||||||
@@ -204,7 +204,7 @@ replace_escaped( char *in,
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
parse_uric( const char *in,
|
parse_uric( char *in,
|
||||||
int max,
|
int max,
|
||||||
token * out )
|
token * out )
|
||||||
{
|
{
|
||||||
@@ -496,12 +496,12 @@ token_cmp( token * in1,
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
parse_port( int max,
|
parse_port( int max,
|
||||||
const char *port,
|
char *port,
|
||||||
unsigned short *out )
|
unsigned short *out )
|
||||||
{
|
{
|
||||||
|
|
||||||
const char *finger = port;
|
char *finger = port;
|
||||||
const char *max_ptr = finger + max;
|
char *max_ptr = finger + max;
|
||||||
unsigned short temp = 0;
|
unsigned short temp = 0;
|
||||||
|
|
||||||
while( ( finger < max_ptr ) && ( isdigit( *finger ) ) ) {
|
while( ( finger < max_ptr ) && ( isdigit( *finger ) ) ) {
|
||||||
@@ -533,7 +533,7 @@ parse_port( int max,
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
parse_hostport( const char *in,
|
parse_hostport( char *in,
|
||||||
int max,
|
int max,
|
||||||
hostport_type * out )
|
hostport_type * out )
|
||||||
{
|
{
|
||||||
@@ -611,9 +611,7 @@ parse_hostport( const char *in,
|
|||||||
int errCode = 0;
|
int errCode = 0;
|
||||||
|
|
||||||
//call gethostbyname_r (reentrant form of gethostbyname)
|
//call gethostbyname_r (reentrant form of gethostbyname)
|
||||||
// TODO: Use autoconf to discover this rather than the
|
#if defined(WIN32)
|
||||||
// platform-specific stuff below
|
|
||||||
#if defined(WIN32) || defined(__CYGWIN__)
|
|
||||||
h=gethostbyname(temp_host_name);
|
h=gethostbyname(temp_host_name);
|
||||||
#elif defined(SPARC_SOLARIS)
|
#elif defined(SPARC_SOLARIS)
|
||||||
errCode = gethostbyname_r( temp_host_name,
|
errCode = gethostbyname_r( temp_host_name,
|
||||||
@@ -683,7 +681,7 @@ parse_hostport( const char *in,
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
parse_scheme( const char *in,
|
parse_scheme( char *in,
|
||||||
int max,
|
int max,
|
||||||
token * out )
|
token * out )
|
||||||
{
|
{
|
||||||
@@ -733,7 +731,7 @@ parse_scheme( const char *in,
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
remove_escaped_chars( INOUT char *in,
|
remove_escaped_chars( INOUT char *in,
|
||||||
INOUT size_t *size )
|
INOUT int *size )
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -996,7 +994,7 @@ resolve_rel_url( char *base_url,
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
parse_uri( const char *in,
|
parse_uri( char *in,
|
||||||
int max,
|
int max,
|
||||||
uri_type * out )
|
uri_type * out )
|
||||||
{
|
{
|
||||||
@@ -1069,15 +1067,15 @@ parse_uri( const char *in,
|
|||||||
int
|
int
|
||||||
parse_uri_and_unescape( char *in,
|
parse_uri_and_unescape( char *in,
|
||||||
int max,
|
int max,
|
||||||
uri_type *out )
|
uri_type * out )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if( ( ret = parse_uri( in, max, out ) ) != HTTP_SUCCESS )
|
if( ( ret = parse_uri( in, max, out ) ) != HTTP_SUCCESS )
|
||||||
return ret;
|
return ret;
|
||||||
if( out->pathquery.size > 0 )
|
if( out->pathquery.size > 0 )
|
||||||
remove_escaped_chars( (char *)out->pathquery.buff, &out->pathquery.size );
|
remove_escaped_chars( out->pathquery.buff, &out->pathquery.size );
|
||||||
if( out->fragment.size > 0 )
|
if( out->fragment.size > 0 )
|
||||||
remove_escaped_chars( (char *)out->fragment.buff, &out->fragment.size );
|
remove_escaped_chars( out->fragment.buff, &out->fragment.size );
|
||||||
return HTTP_SUCCESS;
|
return HTTP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -398,7 +398,7 @@ FindServiceEventURLPath( service_table * table,
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
service_info *
|
service_info *
|
||||||
FindServiceControlURLPath( service_table * table,
|
FindServiceControlURLPath( service_table * table,
|
||||||
const char *controlURLPath )
|
char *controlURLPath )
|
||||||
{
|
{
|
||||||
service_info *finger = NULL;
|
service_info *finger = NULL;
|
||||||
uri_type parsed_url;
|
uri_type parsed_url;
|
||||||
@@ -664,7 +664,7 @@ DOMString
|
|||||||
getElementValue( IXML_Node * node )
|
getElementValue( IXML_Node * node )
|
||||||
{
|
{
|
||||||
IXML_Node *child = ( IXML_Node * ) ixmlNode_getFirstChild( node );
|
IXML_Node *child = ( IXML_Node * ) ixmlNode_getFirstChild( node );
|
||||||
const DOMString temp = NULL;
|
DOMString temp = NULL;
|
||||||
|
|
||||||
if( ( child != 0 ) && ( ixmlNode_getNodeType( child ) == eTEXT_NODE ) ) {
|
if( ( child != 0 ) && ( ixmlNode_getNodeType( child ) == eTEXT_NODE ) ) {
|
||||||
temp = ixmlNode_getNodeValue( child );
|
temp = ixmlNode_getNodeValue( child );
|
||||||
|
@@ -331,10 +331,9 @@ membuffer_assign( INOUT membuffer * m,
|
|||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
// copy
|
// copy
|
||||||
if( buf_len ) {
|
memcpy( m->buf, buf, buf_len );
|
||||||
memcpy( m->buf, buf, buf_len );
|
m->buf[buf_len] = 0; // null-terminate
|
||||||
m->buf[buf_len] = 0; // null-terminate
|
|
||||||
}
|
|
||||||
m->length = buf_len;
|
m->length = buf_len;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -95,17 +95,6 @@
|
|||||||
#define MAX_THREADS 12
|
#define MAX_THREADS 12
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/** @name MAX_JOBS_TOTAL
|
|
||||||
* The {\tt MAX_JOBS_TOTAL} constant determines the maximum number of jobs
|
|
||||||
* that can be queued. If this limit is reached further jobs will be thrown
|
|
||||||
* to avoid memory exhaustion. The default value 100.
|
|
||||||
* (Added by Axis.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
//@{
|
|
||||||
#define MAX_JOBS_TOTAL 100
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/** @name DEFAULT_SOAP_CONTENT_LENGTH
|
/** @name DEFAULT_SOAP_CONTENT_LENGTH
|
||||||
* SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes.
|
* SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes.
|
||||||
* This prevents devices that have a misbehaving web server to send
|
* This prevents devices that have a misbehaving web server to send
|
||||||
|
@@ -96,7 +96,7 @@ typedef struct SOCKET_BUFFER{
|
|||||||
//holds a pointer into a larger array
|
//holds a pointer into a larger array
|
||||||
typedef struct TOKEN {
|
typedef struct TOKEN {
|
||||||
char * buff;
|
char * buff;
|
||||||
size_t size;
|
int size;
|
||||||
} token;
|
} token;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -475,7 +475,6 @@ int http_SendStatusResponse( IN SOCKINFO *info, IN int http_status_code,
|
|||||||
* memory ptr
|
* memory ptr
|
||||||
* 'c': (no args) appends CRLF "\r\n"
|
* 'c': (no args) appends CRLF "\r\n"
|
||||||
* 'd': arg = int number // appends decimal number
|
* 'd': arg = int number // appends decimal number
|
||||||
* 'h': arg = off_t number // appends off_t number
|
|
||||||
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
||||||
* 'D': (no args) appends HTTP DATE: header
|
* 'D': (no args) appends HTTP DATE: header
|
||||||
* 'S': (no args) appends HTTP SERVER: header
|
* 'S': (no args) appends HTTP SERVER: header
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
typedef int socklen_t;
|
#define socklen_t int
|
||||||
#define EAFNOSUPPORT 97
|
#define EAFNOSUPPORT 97
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -51,7 +51,8 @@ typedef struct // memptr
|
|||||||
// note: Total length/capacity should not exceed MAX_INT
|
// note: Total length/capacity should not exceed MAX_INT
|
||||||
typedef struct // membuffer
|
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 length; // length of buffer (read-only)
|
||||||
size_t capacity; // total allocated memory (read-only)
|
size_t capacity; // total allocated memory (read-only)
|
||||||
size_t size_inc; // used to increase size; MUST be > 0; (read/write)
|
size_t size_inc; // used to increase size; MUST be > 0; (read/write)
|
||||||
@@ -147,7 +148,8 @@ int memptr_cmp_nocase( IN memptr* m, IN const char* s );
|
|||||||
*
|
*
|
||||||
* Note :
|
* 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
|
* Function : membuffer_init
|
||||||
@@ -198,7 +200,8 @@ void membuffer_destroy( INOUT membuffer* m );
|
|||||||
*
|
*
|
||||||
* Note :
|
* 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
|
* Function : membuffer_assign_str
|
||||||
@@ -234,7 +237,8 @@ int membuffer_assign_str( INOUT membuffer* m, IN const char* c_str );
|
|||||||
*
|
*
|
||||||
* Note :
|
* 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
|
* Function : membuffer_append_str
|
||||||
@@ -272,7 +276,8 @@ int membuffer_append_str( INOUT membuffer* m, IN const char* c_str );
|
|||||||
*
|
*
|
||||||
* Note :
|
* 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 );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -293,7 +298,8 @@ int membuffer_insert( INOUT membuffer* m, IN const void* buf, IN size_t buf_len,
|
|||||||
*
|
*
|
||||||
* Note :
|
* 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 );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -330,7 +336,8 @@ char* membuffer_detach( INOUT membuffer* m );
|
|||||||
* Note : 'new_buf' must be allocted using malloc or realloc so
|
* Note : 'new_buf' must be allocted using malloc or realloc so
|
||||||
* that it can be freed using free()
|
* 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
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
@@ -246,7 +246,7 @@ service_info * FindServiceEventURLPath( service_table *table,
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
service_info * FindServiceControlURLPath( service_table *table,
|
service_info * FindServiceControlURLPath( service_table *table,
|
||||||
const char * controlURLPath);
|
char * controlURLPath);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : printService
|
* Function : printService
|
||||||
|
@@ -80,7 +80,7 @@ typedef enum SsdpCmdType{SSDP_ERROR=-1,
|
|||||||
#define SSDP_IP "239.255.255.250"
|
#define SSDP_IP "239.255.255.250"
|
||||||
#define SSDP_PORT 1900
|
#define SSDP_PORT 1900
|
||||||
#define NUM_TRY 3
|
#define NUM_TRY 3
|
||||||
#define NUM_COPY 1
|
#define NUM_COPY 2
|
||||||
#define THREAD_LIMIT 50
|
#define THREAD_LIMIT 50
|
||||||
#define COMMAND_LEN 300
|
#define COMMAND_LEN 300
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
#else
|
#else
|
||||||
#define XINLINE
|
#define XINLINE
|
||||||
|
|
||||||
typedef int socklen_t;
|
#define socklen_t int
|
||||||
#define EAFNOSUPPORT 97
|
#define EAFNOSUPPORT 97
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -86,8 +86,8 @@ enum uriType { absolute, relative };
|
|||||||
/* Buffer used in parsinghttp messages, urls, etc. generally this simply
|
/* Buffer used in parsinghttp messages, urls, etc. generally this simply
|
||||||
* holds a pointer into a larger array */
|
* holds a pointer into a larger array */
|
||||||
typedef struct TOKEN {
|
typedef struct TOKEN {
|
||||||
const char *buff;
|
char * buff;
|
||||||
size_t size;
|
int size;
|
||||||
} token;
|
} token;
|
||||||
|
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ typedef struct URL_LIST {
|
|||||||
* Parameters :
|
* Parameters :
|
||||||
* char * in ; string of characters
|
* char * in ; string of characters
|
||||||
* int index ; index at which to start checking the characters
|
* int index ; index at which to start checking the characters
|
||||||
* size_t *max ;
|
* int *max ;
|
||||||
*
|
*
|
||||||
* Description : Replaces an escaped sequence with its unescaped version
|
* Description : Replaces an escaped sequence with its unescaped version
|
||||||
* as in http://www.ietf.org/rfc/rfc2396.txt (RFC explaining URIs)
|
* 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
|
* string are shifted over, and NULL characters are placed at the
|
||||||
* end of the string.
|
* end of the string.
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int replace_escaped(char * in, int index, size_t *max);
|
int replace_escaped(char * in, int index, int *max);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : copy_URL_list
|
* Function : copy_URL_list
|
||||||
@@ -276,7 +276,7 @@ int token_cmp( token *in1, token *in2);
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int parse_port(int max, const char *port, unsigned short int *out);
|
int parse_port(int max, char * port, unsigned short int * out);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : parse_hostport
|
* Function : parse_hostport
|
||||||
@@ -296,14 +296,14 @@ int parse_port(int max, const char *port, unsigned short int *out);
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int parse_hostport(const char *in, int max, hostport_type *out );
|
int parse_hostport( char* in, int max, hostport_type *out );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : remove_escaped_chars
|
* Function : remove_escaped_chars
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* INOUT char *in ; string of characters to be modified
|
* INOUT char *in ; string of characters to be modified
|
||||||
* INOUT size_t *size ; size limit for the number of characters
|
* INOUT int *size ; size limit for the number of characters
|
||||||
*
|
*
|
||||||
* Description : removes http escaped characters such as: "%20" and
|
* Description : removes http escaped characters such as: "%20" and
|
||||||
* replaces them with their character representation. i.e.
|
* replaces them with their character representation. i.e.
|
||||||
@@ -315,7 +315,7 @@ int parse_hostport(const char *in, int max, hostport_type *out );
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int remove_escaped_chars(char *in, size_t *size);
|
int remove_escaped_chars(char *in,int *size);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : remove_dots
|
* Function : remove_dots
|
||||||
@@ -391,7 +391,7 @@ char * resolve_rel_url( char * base_url, char * rel_url);
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int parse_uri(const char * in, int max, uri_type * out);
|
int parse_uri( char * in, int max, uri_type * out);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : parse_uri_and_unescape
|
* Function : parse_uri_and_unescape
|
||||||
|
@@ -163,7 +163,7 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
|
|||||||
#define strcasecmp stricmp
|
#define strcasecmp stricmp
|
||||||
#define strncasecmp strnicmp
|
#define strncasecmp strnicmp
|
||||||
|
|
||||||
#define sleep(a) Sleep((a)*1000)
|
#define sleep Sleep
|
||||||
#define usleep(a) Sleep((a)/1000)
|
#define usleep(a) Sleep((a)/1000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -48,8 +48,8 @@ struct SendInstruction
|
|||||||
int IsRangeActive;
|
int IsRangeActive;
|
||||||
int IsTrailers;
|
int IsTrailers;
|
||||||
char RangeHeader[200];
|
char RangeHeader[200];
|
||||||
off_t RangeOffset;
|
long RangeOffset;
|
||||||
off_t ReadSendSize; // Read from local source and send on the network.
|
long ReadSendSize; // Read from local source and send on the network.
|
||||||
long RecvWriteSize; // Recv from the network and write into local file.
|
long RecvWriteSize; // Recv from the network and write into local file.
|
||||||
|
|
||||||
//Later few more member could be added depending on the requirement.
|
//Later few more member could be added depending on the requirement.
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
typedef int socklen_t;
|
#define socklen_t int
|
||||||
#define EAFNOSUPPORT 97
|
#define EAFNOSUPPORT 97
|
||||||
/*
|
/*
|
||||||
* WARNING: Don't even consider trying to compile this on a system where
|
* WARNING: Don't even consider trying to compile this on a system where
|
||||||
|
@@ -212,11 +212,11 @@ dom_find_deep_node( IN char *names[],
|
|||||||
*
|
*
|
||||||
* Note :The given node must have a text node as its first child
|
* Note :The given node must have a text node as its first child
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static const DOMString
|
static DOMString
|
||||||
get_node_value( IN IXML_Node * node )
|
get_node_value( IN IXML_Node * node )
|
||||||
{
|
{
|
||||||
IXML_Node *text_node = NULL;
|
IXML_Node *text_node = NULL;
|
||||||
const DOMString text_value = NULL;
|
DOMString text_value = NULL;
|
||||||
|
|
||||||
text_node = ixmlNode_getFirstChild( node );
|
text_node = ixmlNode_getFirstChild( node );
|
||||||
if( text_node == NULL ) {
|
if( text_node == NULL ) {
|
||||||
@@ -246,19 +246,18 @@ get_node_value( IN IXML_Node * node )
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static XINLINE int
|
static XINLINE int
|
||||||
get_host_and_path( IN char *ctrl_url,
|
get_host_and_path( IN char *ctrl_url,
|
||||||
OUT const memptr *host,
|
OUT memptr * host,
|
||||||
OUT const memptr *path,
|
OUT memptr * path,
|
||||||
OUT uri_type * url )
|
OUT uri_type * url )
|
||||||
{
|
{
|
||||||
if( parse_uri( ctrl_url, strlen( ctrl_url ), url ) != HTTP_SUCCESS ) {
|
if( parse_uri( ctrl_url, strlen( ctrl_url ), url ) != HTTP_SUCCESS ) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// This is done to ensure that the buffer is kept const
|
host->buf = url->hostport.text.buff;
|
||||||
((memptr *)host)->buf = (char *)url->hostport.text.buff;
|
host->length = url->hostport.text.size;
|
||||||
((memptr *)host)->length = url->hostport.text.size;
|
|
||||||
|
|
||||||
((memptr *)path)->buf = (char *)url->pathquery.buff;
|
path->buf = url->pathquery.buff;
|
||||||
((memptr *)path)->length = url->pathquery.size;
|
path->length = url->pathquery.size;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -415,12 +414,12 @@ get_response_value( IN http_message_t * hmsg,
|
|||||||
IXML_Node *error_node = NULL;
|
IXML_Node *error_node = NULL;
|
||||||
IXML_Document *doc = NULL;
|
IXML_Document *doc = NULL;
|
||||||
char *node_str = NULL;
|
char *node_str = NULL;
|
||||||
const char *temp_str = NULL;
|
char *temp_str = NULL;
|
||||||
DOMString error_node_str = NULL;
|
DOMString error_node_str = NULL;
|
||||||
int err_code;
|
int err_code;
|
||||||
xboolean done = FALSE;
|
xboolean done = FALSE;
|
||||||
char *names[5];
|
char *names[5];
|
||||||
const DOMString nodeValue;
|
DOMString nodeValue;
|
||||||
|
|
||||||
err_code = UPNP_E_BAD_RESPONSE; // default error
|
err_code = UPNP_E_BAD_RESPONSE; // default error
|
||||||
|
|
||||||
@@ -602,15 +601,12 @@ SoapSendAction( IN char *action_url,
|
|||||||
char *upnp_error_str;
|
char *upnp_error_str;
|
||||||
xboolean got_response = FALSE;
|
xboolean got_response = FALSE;
|
||||||
|
|
||||||
off_t content_length;
|
|
||||||
char *xml_start =
|
char *xml_start =
|
||||||
"<s:Envelope "
|
// "<?xml version=\"1.0\"?>\n" required??
|
||||||
"xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
||||||
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
|
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
|
||||||
"<s:Body>";
|
"<s:Body>";
|
||||||
char *xml_end =
|
char *xml_end = "</s:Body>\n" "</s:Envelope>\n";
|
||||||
"</s:Body>\r\n"
|
|
||||||
"</s:Envelope>\r\n\r\n";
|
|
||||||
int xml_start_len;
|
int xml_start_len;
|
||||||
int xml_end_len;
|
int xml_end_len;
|
||||||
int action_str_len;
|
int action_str_len;
|
||||||
@@ -648,23 +644,18 @@ SoapSendAction( IN char *action_url,
|
|||||||
url.hostport.text.size,
|
url.hostport.text.size,
|
||||||
url.hostport.text.buff ); )
|
url.hostport.text.buff ); )
|
||||||
|
|
||||||
xml_start_len = strlen( xml_start );
|
xml_start_len = strlen( xml_start );
|
||||||
xml_end_len = strlen( xml_end );
|
xml_end_len = strlen( xml_end );
|
||||||
action_str_len = strlen( action_str );
|
action_str_len = strlen( action_str );
|
||||||
|
|
||||||
// make request msg
|
// make request msg
|
||||||
request.size_inc = 50;
|
request.size_inc = 50;
|
||||||
content_length = xml_start_len + action_str_len + xml_end_len;
|
if( http_MakeMessage( &request, 1, 1, "q" "N" "s" "sssbs" "U" "c" "bbb", SOAPMETHOD_POST, &url, xml_start_len + action_str_len + xml_end_len, // content-length
|
||||||
if (http_MakeMessage(
|
ContentTypeHeader,
|
||||||
&request, 1, 1,
|
"SOAPACTION: \"", service_type, "#", name.buf,
|
||||||
"q" "N" "s" "sssbsc" "Uc" "b" "b" "b",
|
name.length, "\"\r\n", xml_start, xml_start_len,
|
||||||
SOAPMETHOD_POST, &url,
|
action_str, action_str_len, xml_end,
|
||||||
content_length,
|
xml_end_len ) != 0 ) {
|
||||||
ContentTypeHeader,
|
|
||||||
"SOAPACTION: \"", service_type, "#", name.buf, name.length, "\"",
|
|
||||||
xml_start, xml_start_len,
|
|
||||||
action_str, action_str_len,
|
|
||||||
xml_end, xml_end_len ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,26 +736,20 @@ SoapSendActionEx( IN char *action_url,
|
|||||||
xboolean got_response = FALSE;
|
xboolean got_response = FALSE;
|
||||||
|
|
||||||
char *xml_start =
|
char *xml_start =
|
||||||
"<s:Envelope "
|
// "<?xml version=\"1.0\"?>\n" required??
|
||||||
"xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
||||||
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n";
|
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n";
|
||||||
char *xml_header_start =
|
char *xml_body_start = "<s:Body>";
|
||||||
"<s:Header>\r\n";
|
char *xml_end = "</s:Body>\n" "</s:Envelope>\n";
|
||||||
char *xml_header_end =
|
|
||||||
"</s:Header>\r\n";
|
|
||||||
char *xml_body_start =
|
|
||||||
"<s:Body>";
|
|
||||||
char *xml_end =
|
|
||||||
"</s:Body>\r\n"
|
|
||||||
"</s:Envelope>\r\n";
|
|
||||||
int xml_start_len;
|
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;
|
int xml_end_len;
|
||||||
off_t content_length;
|
char *xml_header_start = "<s:Header>\n";
|
||||||
|
char *xml_header_end = "</s:Header>\n";
|
||||||
|
int xml_header_start_len;
|
||||||
|
int xml_header_end_len;
|
||||||
|
int xml_header_str_len;
|
||||||
|
int action_str_len;
|
||||||
|
int xml_body_start_len;
|
||||||
|
|
||||||
*response_node = NULL; // init
|
*response_node = NULL; // init
|
||||||
|
|
||||||
@@ -804,7 +789,7 @@ SoapSendActionEx( IN char *action_url,
|
|||||||
url.hostport.text.size,
|
url.hostport.text.size,
|
||||||
url.hostport.text.buff ); )
|
url.hostport.text.buff ); )
|
||||||
|
|
||||||
xml_start_len = strlen( xml_start );
|
xml_start_len = strlen( xml_start );
|
||||||
xml_body_start_len = strlen( xml_body_start );
|
xml_body_start_len = strlen( xml_body_start );
|
||||||
xml_end_len = strlen( xml_end );
|
xml_end_len = strlen( xml_end );
|
||||||
action_str_len = strlen( action_str );
|
action_str_len = strlen( action_str );
|
||||||
@@ -815,24 +800,17 @@ SoapSendActionEx( IN char *action_url,
|
|||||||
|
|
||||||
// make request msg
|
// make request msg
|
||||||
request.size_inc = 50;
|
request.size_inc = 50;
|
||||||
content_length =
|
if( http_MakeMessage( &request, 1, 1, "q" "N" "s" "sssbs" "U" "c" "bbbbbbb", SOAPMETHOD_POST, &url, xml_start_len + xml_header_start_len + xml_header_str_len + xml_header_end_len + xml_body_start_len + action_str_len + xml_end_len, // content-length
|
||||||
xml_start_len +
|
ContentTypeHeader,
|
||||||
xml_header_start_len + xml_header_str_len + xml_header_end_len +
|
"SOAPACTION: \"", service_type, "#", name.buf,
|
||||||
xml_body_start_len + action_str_len + xml_end_len;
|
name.length, "\"\r\n",
|
||||||
if (http_MakeMessage(
|
xml_start, xml_start_len,
|
||||||
&request, 1, 1,
|
xml_header_start, xml_header_start_len,
|
||||||
"q" "N" "s" "sssbsc" "Uc" "bbbbbbb",
|
xml_header_str, xml_header_str_len,
|
||||||
SOAPMETHOD_POST, &url,
|
xml_header_end, xml_header_end_len,
|
||||||
content_length,
|
xml_body_start, xml_body_start_len,
|
||||||
ContentTypeHeader,
|
action_str, action_str_len,
|
||||||
"SOAPACTION: \"", service_type, "#", name.buf, name.length, "\"",
|
xml_end, xml_end_len ) != 0 ) {
|
||||||
xml_start, xml_start_len,
|
|
||||||
xml_header_start, xml_header_start_len,
|
|
||||||
xml_header_str, xml_header_str_len,
|
|
||||||
xml_header_end, xml_header_end_len,
|
|
||||||
xml_body_start, xml_body_start_len,
|
|
||||||
action_str, action_str_len,
|
|
||||||
xml_end, xml_end_len ) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,28 +873,24 @@ SoapGetServiceVarStatus( IN char *action_url,
|
|||||||
IN char *var_name,
|
IN char *var_name,
|
||||||
OUT char **var_value )
|
OUT char **var_value )
|
||||||
{
|
{
|
||||||
const memptr host; // value for HOST header
|
memptr host; // value for HOST header
|
||||||
const memptr path; // ctrl path in first line in msg
|
memptr path; // ctrl path in first line in msg
|
||||||
uri_type url;
|
uri_type url;
|
||||||
membuffer request;
|
membuffer request;
|
||||||
int ret_code;
|
int ret_code;
|
||||||
http_parser_t response;
|
http_parser_t response;
|
||||||
int upnp_error_code;
|
int upnp_error_code;
|
||||||
|
|
||||||
off_t content_length;
|
|
||||||
char *xml_start =
|
char *xml_start =
|
||||||
"<s:Envelope "
|
// "<?xml version=\"1.0\"?>\n" required??
|
||||||
"xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
||||||
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
|
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
|
||||||
"<s:Body>\r\n"
|
"<s:Body>\n"
|
||||||
"<u:QueryStateVariable xmlns:u=\"urn:schemas-upnp-org:control-1-0\">\r\n"
|
"<u:QueryStateVariable xmlns:u=\"urn:schemas-upnp-org:control-1-0\">\n"
|
||||||
"<u:varName>";
|
"<u:varName>";
|
||||||
|
|
||||||
char *xml_end =
|
char *xml_end = "</u:varName>\n"
|
||||||
"</u:varName>\r\n"
|
"</u:QueryStateVariable>\n" "</s:Body>\n" "</s:Envelope>\n";
|
||||||
"</u:QueryStateVariable>\r\n"
|
|
||||||
"</s:Body>\r\n"
|
|
||||||
"</s:Envelope>\r\n";
|
|
||||||
|
|
||||||
*var_value = NULL; // return NULL in case of an error
|
*var_value = NULL; // return NULL in case of an error
|
||||||
|
|
||||||
@@ -928,16 +902,11 @@ SoapGetServiceVarStatus( IN char *action_url,
|
|||||||
}
|
}
|
||||||
// make headers
|
// make headers
|
||||||
request.size_inc = 50;
|
request.size_inc = 50;
|
||||||
content_length = strlen( xml_start ) + strlen( var_name ) + strlen( xml_end );
|
if( http_MakeMessage( &request, 1, 1, "Q" "sbc" "N" "s" "s" "U" "c" "sss", SOAPMETHOD_POST, path.buf, path.length, "HOST: ", host.buf, host.length, strlen( xml_start ) + strlen( var_name ) + strlen( xml_end ), // content-length
|
||||||
if (http_MakeMessage(
|
ContentTypeHeader,
|
||||||
&request, 1, 1,
|
"SOAPACTION: \"urn:schemas"
|
||||||
"Q" "sbc" "N" "s" "s" "Ucc" "sss",
|
"-upnp-org:control-1-0#QueryStateVariable\"\r\n",
|
||||||
SOAPMETHOD_POST, path.buf, path.length,
|
xml_start, var_name, xml_end ) != 0 ) {
|
||||||
"HOST: ", host.buf, host.length,
|
|
||||||
content_length,
|
|
||||||
ContentTypeHeader,
|
|
||||||
"SOAPACTION: \"urn:schemas-upnp-org:control-1-0#QueryStateVariable\"",
|
|
||||||
xml_start, var_name, xml_end ) != 0 ) {
|
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
}
|
}
|
||||||
// send msg and get reply
|
// send msg and get reply
|
||||||
|
@@ -189,7 +189,7 @@ send_error_response( IN SOCKINFO * info,
|
|||||||
IN const char *err_msg,
|
IN const char *err_msg,
|
||||||
IN http_message_t * hmsg )
|
IN http_message_t * hmsg )
|
||||||
{
|
{
|
||||||
off_t content_length;
|
int content_length;
|
||||||
int timeout_secs = SOAP_TIMEOUT;
|
int timeout_secs = SOAP_TIMEOUT;
|
||||||
int major,
|
int major,
|
||||||
minor;
|
minor;
|
||||||
@@ -228,19 +228,20 @@ send_error_response( IN SOCKINFO * info,
|
|||||||
|
|
||||||
// make headers
|
// make headers
|
||||||
membuffer_init( &headers );
|
membuffer_init( &headers );
|
||||||
if (http_MakeMessage(
|
/* -- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net> */
|
||||||
&headers, major, minor,
|
if( http_MakeMessage( &headers, major, minor,
|
||||||
"RNsDsSXcc" "sssss",
|
"RNsDsSXc" "sssss",
|
||||||
500,
|
500,
|
||||||
content_length,
|
content_length,
|
||||||
ContentTypeHeader,
|
ContentTypeHeader,
|
||||||
"EXT:\r\n",
|
"EXT:\r\n",
|
||||||
X_USER_AGENT,
|
X_USER_AGENT,
|
||||||
start_body, err_code_str, mid_body, err_msg,
|
start_body, err_code_str, mid_body, err_msg,
|
||||||
end_body ) != 0 ) {
|
end_body ) != 0 ) {
|
||||||
membuffer_destroy( &headers );
|
membuffer_destroy( &headers );
|
||||||
return; // out of mem
|
return; // out of mem
|
||||||
}
|
}
|
||||||
|
/*-- PATCH END - */
|
||||||
// send err msg
|
// send err msg
|
||||||
http_SendMessage( info, &timeout_secs, "b",
|
http_SendMessage( info, &timeout_secs, "b",
|
||||||
headers.buf, headers.length );
|
headers.buf, headers.length );
|
||||||
@@ -267,11 +268,12 @@ send_var_query_response( IN SOCKINFO * info,
|
|||||||
IN const char *var_value,
|
IN const char *var_value,
|
||||||
IN http_message_t * hmsg )
|
IN http_message_t * hmsg )
|
||||||
{
|
{
|
||||||
off_t content_length;
|
int content_length;
|
||||||
int timeout_secs = SOAP_TIMEOUT;
|
int timeout_secs = SOAP_TIMEOUT;
|
||||||
int major;
|
int major,
|
||||||
int minor;
|
minor;
|
||||||
const char *start_body =
|
const char *start_body =
|
||||||
|
// "<?xml version=\"1.0\"?>\n" required??
|
||||||
"<s:Envelope "
|
"<s:Envelope "
|
||||||
"xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
"xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
||||||
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
|
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
|
||||||
@@ -295,18 +297,19 @@ send_var_query_response( IN SOCKINFO * info,
|
|||||||
// make headers
|
// make headers
|
||||||
membuffer_init( &response );
|
membuffer_init( &response );
|
||||||
|
|
||||||
if (http_MakeMessage(
|
/* -- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net> */
|
||||||
&response, major, minor,
|
if( http_MakeMessage( &response, major, minor,
|
||||||
"RNsDsSXcc" "sss",
|
"RNsDsSXcc" "sss",
|
||||||
HTTP_OK,
|
HTTP_OK,
|
||||||
content_length,
|
content_length,
|
||||||
ContentTypeHeader,
|
ContentTypeHeader,
|
||||||
"EXT:\r\n",
|
"EXT:\r\n",
|
||||||
X_USER_AGENT,
|
X_USER_AGENT,
|
||||||
start_body, var_value, end_body ) != 0 ) {
|
start_body, var_value, end_body ) != 0 ) {
|
||||||
membuffer_destroy( &response );
|
membuffer_destroy( &response );
|
||||||
return; // out of mem
|
return; // out of mem
|
||||||
}
|
}
|
||||||
|
/* -- PATCH END - */
|
||||||
|
|
||||||
// send msg
|
// send msg
|
||||||
http_SendMessage( info, &timeout_secs, "b",
|
http_SendMessage( info, &timeout_secs, "b",
|
||||||
@@ -600,13 +603,13 @@ get_device_info( IN http_message_t * request,
|
|||||||
service_info *serv_info;
|
service_info *serv_info;
|
||||||
char save_char;
|
char save_char;
|
||||||
int ret_code = -1; // error by default
|
int ret_code = -1; // error by default
|
||||||
const char *control_url;
|
char *control_url;
|
||||||
char *actionName = NULL;
|
char *actionName = NULL;
|
||||||
|
|
||||||
// null-terminate pathquery of url
|
// null-terminate pathquery of url
|
||||||
control_url = request->uri.pathquery.buff;
|
control_url = request->uri.pathquery.buff;
|
||||||
save_char = control_url[request->uri.pathquery.size];
|
save_char = control_url[request->uri.pathquery.size];
|
||||||
((char *)control_url)[request->uri.pathquery.size] = '\0';
|
control_url[request->uri.pathquery.size] = '\0';
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock( );
|
||||||
|
|
||||||
@@ -663,7 +666,7 @@ get_device_info( IN http_message_t * request,
|
|||||||
ret_code = 0;
|
ret_code = 0;
|
||||||
|
|
||||||
error_handler:
|
error_handler:
|
||||||
((char *)control_url)[request->uri.pathquery.size] = save_char; // restore
|
control_url[request->uri.pathquery.size] = save_char; // restore
|
||||||
HandleUnlock( );
|
HandleUnlock( );
|
||||||
return ret_code;
|
return ret_code;
|
||||||
}
|
}
|
||||||
@@ -692,7 +695,7 @@ send_action_response( IN SOCKINFO * info,
|
|||||||
int major,
|
int major,
|
||||||
minor;
|
minor;
|
||||||
int err_code;
|
int err_code;
|
||||||
off_t content_length;
|
int content_length;
|
||||||
int ret_code;
|
int ret_code;
|
||||||
int timeout_secs = SOAP_TIMEOUT;
|
int timeout_secs = SOAP_TIMEOUT;
|
||||||
static char *start_body =
|
static char *start_body =
|
||||||
@@ -714,22 +717,17 @@ send_action_response( IN SOCKINFO * info,
|
|||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
content_length =
|
content_length = strlen( start_body ) + strlen( xml_response ) +
|
||||||
strlen( start_body ) +
|
|
||||||
strlen( xml_response ) +
|
|
||||||
strlen( end_body );
|
strlen( end_body );
|
||||||
|
|
||||||
// make headers
|
// make headers
|
||||||
if (http_MakeMessage(
|
/* -- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net> */
|
||||||
&headers, major, minor,
|
if( http_MakeMessage( &headers, major, minor, "RNsDsSXcc", HTTP_OK, // status code
|
||||||
"RNsDsSXcc",
|
content_length, ContentTypeHeader, "EXT:\r\n", X_USER_AGENT // EXT header
|
||||||
HTTP_OK, // status code
|
) != 0 ) {
|
||||||
content_length,
|
|
||||||
ContentTypeHeader,
|
|
||||||
"EXT:\r\n",
|
|
||||||
X_USER_AGENT) != 0 ) {
|
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
/* -- PATCH END - */
|
||||||
|
|
||||||
// send whole msg
|
// send whole msg
|
||||||
ret_code = http_SendMessage( info, &timeout_secs, "bbbb",
|
ret_code = http_SendMessage( info, &timeout_secs, "bbbb",
|
||||||
@@ -780,7 +778,7 @@ get_var_name( IN IXML_Document * TempDoc,
|
|||||||
IXML_Node *VarNameNode = NULL;
|
IXML_Node *VarNameNode = NULL;
|
||||||
IXML_Node *VarNode = NULL;
|
IXML_Node *VarNode = NULL;
|
||||||
const DOMString StNodeName = NULL;
|
const DOMString StNodeName = NULL;
|
||||||
const DOMString Temp = NULL;
|
DOMString Temp = NULL;
|
||||||
int ret_val = -1;
|
int ret_val = -1;
|
||||||
|
|
||||||
// Got the Envelop node here
|
// Got the Envelop node here
|
||||||
|
@@ -234,17 +234,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
|
|||||||
|
|
||||||
for( Index = 0; Index < NumPacket; Index++ ) {
|
for( Index = 0; Index < NumPacket; Index++ ) {
|
||||||
int rc;
|
int rc;
|
||||||
// The reason to keep this loop is purely historical/documentation,
|
|
||||||
// according to section 9.2 of HTTPU spec:
|
|
||||||
//
|
|
||||||
// "If a multicast resource would send a response(s) to any copy of the
|
|
||||||
// request, it SHOULD send its response(s) to each copy of the request
|
|
||||||
// it receives. It MUST NOT repeat its response(s) per copy of the
|
|
||||||
// reuqest."
|
|
||||||
//
|
|
||||||
// http://www.upnp.org/download/draft-goland-http-udp-04.txt
|
|
||||||
//
|
|
||||||
// So, NUM_COPY has been changed from 2 to 1.
|
|
||||||
NumCopy = 0;
|
NumCopy = 0;
|
||||||
while( NumCopy < NUM_COPY ) {
|
while( NumCopy < NUM_COPY ) {
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
DBGONLY( UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
||||||
@@ -305,16 +295,16 @@ CreateServicePacket( IN int msg_type,
|
|||||||
*packet = NULL;
|
*packet = NULL;
|
||||||
|
|
||||||
if( msg_type == MSGTYPE_REPLY ) {
|
if( msg_type == MSGTYPE_REPLY ) {
|
||||||
ret_code = http_MakeMessage(
|
/* -- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net> */
|
||||||
&buf, 1, 1,
|
ret_code = http_MakeMessage( &buf, 1, 1,
|
||||||
"R" "sdc" "D" "sc" "ssc" "S" "Xc" "ssc" "sscc",
|
"R" "sdc" "D" "s" "ssc" "S" "Xc" "ssc"
|
||||||
HTTP_OK,
|
"ssc" "c", HTTP_OK,
|
||||||
"CACHE-CONTROL: max-age=", duration,
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
"EXT:",
|
"EXT:\r\n", "LOCATION: ", location,
|
||||||
"LOCATION: ", location,
|
X_USER_AGENT,
|
||||||
X_USER_AGENT,
|
"ST: ", nt, "USN: ", usn );
|
||||||
"ST: ", nt,
|
/* -- PATCH END - */
|
||||||
"USN: ", usn);
|
|
||||||
if( ret_code != 0 ) {
|
if( ret_code != 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -330,17 +320,15 @@ CreateServicePacket( IN int msg_type,
|
|||||||
// NOTE: The CACHE-CONTROL and LOCATION headers are not present in
|
// NOTE: The CACHE-CONTROL and LOCATION headers are not present in
|
||||||
// a shutdown msg, but are present here for MS WinMe interop.
|
// a shutdown msg, but are present here for MS WinMe interop.
|
||||||
|
|
||||||
ret_code = http_MakeMessage(
|
/* -- PATCH START - Sergey 'Jin' Bostandzhyan <jin_eld at users.sourceforge.net> */
|
||||||
&buf, 1, 1,
|
ret_code = http_MakeMessage( &buf, 1, 1,
|
||||||
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc" "S" "Xc" "sscc",
|
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc"
|
||||||
HTTPMETHOD_NOTIFY, "*",
|
"S" "Xc" "ssc" "c", HTTPMETHOD_NOTIFY, "*",
|
||||||
1, "HOST: ", SSDP_IP, ":", SSDP_PORT,
|
1, "HOST: ", SSDP_IP, ":", SSDP_PORT,
|
||||||
"CACHE-CONTROL: max-age=", duration,
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
"LOCATION: ", location,
|
"LOCATION: ", location, "NT: ", nt,
|
||||||
"NT: ", nt,
|
"NTS: ", nts, X_USER_AGENT, "USN: ", usn );
|
||||||
"NTS: ", nts,
|
/* -- PATCH END - */
|
||||||
X_USER_AGENT,
|
|
||||||
"USN: ", usn );
|
|
||||||
if( ret_code != 0 ) {
|
if( ret_code != 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ CLIENTONLY( SOCKET gSsdpReqSocket = 0;
|
|||||||
IXML_Node *tmpNode = NULL;
|
IXML_Node *tmpNode = NULL;
|
||||||
IXML_Node *tmpNode2 = NULL;
|
IXML_Node *tmpNode2 = NULL;
|
||||||
IXML_Node *textNode = NULL;
|
IXML_Node *textNode = NULL;
|
||||||
const DOMString tmpStr;
|
DOMString tmpStr;
|
||||||
char SERVER[200];
|
char SERVER[200];
|
||||||
|
|
||||||
DBGONLY( const DOMString dbgStr;
|
DBGONLY( const DOMString dbgStr;
|
||||||
@@ -922,7 +922,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
struct ip_mreq ssdpMcastAddr;
|
struct ip_mreq ssdpMcastAddr;
|
||||||
struct sockaddr_in ssdpAddr;
|
struct sockaddr_in ssdpAddr;
|
||||||
int option = 1;
|
int option = 1;
|
||||||
struct in_addr addr;
|
|
||||||
|
|
||||||
CLIENTONLY( if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
|
CLIENTONLY( if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
|
||||||
== UPNP_INVALID_SOCKET ) {
|
== UPNP_INVALID_SOCKET ) {
|
||||||
@@ -998,7 +997,7 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset( ( void * )&ssdpMcastAddr, 0, sizeof( struct ip_mreq ) );
|
memset( ( void * )&ssdpMcastAddr, 0, sizeof( struct ip_mreq ) );
|
||||||
ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST );
|
ssdpMcastAddr.imr_interface.s_addr = htonl( INADDR_ANY );
|
||||||
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
|
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
|
||||||
if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||||
( char * )&ssdpMcastAddr,
|
( char * )&ssdpMcastAddr,
|
||||||
@@ -1013,17 +1012,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) );
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) );
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set multicast interface. */
|
|
||||||
memset( ( void * )&addr, 0, sizeof( struct in_addr ));
|
|
||||||
addr.s_addr = inet_addr(LOCAL_HOST);
|
|
||||||
if (setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
|
|
||||||
(char *)&addr, sizeof addr) != 0) {
|
|
||||||
DBGONLY(UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
|
||||||
"Couldn't set multicast interface.\n" ));
|
|
||||||
/* This is probably not a critical error, so let's continue. */
|
|
||||||
}
|
|
||||||
|
|
||||||
// result is not checked becuase it will fail in WinMe and Win9x.
|
// result is not checked becuase it will fail in WinMe and Win9x.
|
||||||
setsockopt( ssdpSock, IPPROTO_IP,
|
setsockopt( ssdpSock, IPPROTO_IP,
|
||||||
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
||||||
|
@@ -213,7 +213,7 @@ config_description_doc( INOUT IXML_Document * doc,
|
|||||||
IXML_Node *rootNode = NULL;
|
IXML_Node *rootNode = NULL;
|
||||||
IXML_Node *urlbase_node = NULL;
|
IXML_Node *urlbase_node = NULL;
|
||||||
char *urlBaseStr = "URLBase";
|
char *urlBaseStr = "URLBase";
|
||||||
const DOMString domStr = NULL;
|
DOMString domStr = NULL;
|
||||||
uri_type uri;
|
uri_type uri;
|
||||||
int err_code;
|
int err_code;
|
||||||
int len;
|
int len;
|
||||||
|
Reference in New Issue
Block a user