1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00
Commit Graph

145 Commits

Author SHA1 Message Date
Nick Wellnhofer
1b1e8b3c12 io: Stop invoking generic error handler for IO errors 2024-06-12 16:14:15 +02:00
Nick Wellnhofer
a7854e2646 http: Don't pass NULL pointer as memcpy source 2024-05-06 17:35:26 +02:00
Nick Wellnhofer
67e475b78e http: Improve error message for HTTPS redirects 2024-02-19 11:09:39 +01:00
Nick Wellnhofer
ecb4c9fb28 misc: Improve error handling
Remove calls to generic error handler or use stderr for

- legacy deprecation warnings
- nanohttp, nanoftp in standalone mode
- memory debug messages

Use xmlRaiseMemoryError.

Remove TODO macro.

Don't raise errors in xmlmodule.c.
2023-12-21 15:02:24 +01:00
Nick Wellnhofer
699299cae3 globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
Nick Wellnhofer
4e1c13ebfd debug: Remove debugging code
This is barely useful these days and only clutters the code base.
2023-09-19 17:35:09 +02:00
Nick Wellnhofer
886bf4e63b Stop calling xmlMemoryDump
This was used to check for memory leaks but could potentially create a
.memdump file. These days, there are better ways to check for memory
leaks.
2023-04-30 15:48:41 +02:00
Chun-wei Fan
cfbe68e468 sources: Silence C4013 warnings on Visual Studio
The read(), close(), open(), lseek() functions are found in io.h on Visual
Studio, which does not ship unistd.h, so include io.h on Windows if unistd.h
is not found.

C4013 (aka implicit declaration of ...) warnings can often ring alarm bells.
2022-11-22 15:20:53 +08:00
Markus Jörg
1fa4d14fbe Bypass proxy in nanoHTTP for hosts in "no_proxy" 2022-11-04 12:34:39 +00:00
Nick Wellnhofer
30c8d9bb23 http: Simplify IPv6 checks
This should also enable IPv6 support on Windows. Untested and mostly
useless anyway, since we don't support HTTPS.
2022-09-05 02:26:13 +02:00
Nick Wellnhofer
fe02289fa5 Remove arg cast configure checks
We can simply cast to non-const char * unconditionally.
2022-09-04 03:19:01 +02:00
Nick Wellnhofer
13a6637815 Remove BeOS support
Haiku shouldn't be affected.
2022-09-04 01:05:51 +02:00
Nick Wellnhofer
75bd98a5ef Remove unused code in nanohttp.c
This was hidden behind an undocumented flag RES_USE_INET6.
2022-09-02 18:33:36 +02:00
Nick Wellnhofer
5bffa33a12 Stop including sys/types.h 2022-09-02 18:33:36 +02:00
Nick Wellnhofer
2cac626976 Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
Nick Wellnhofer
0f568c0b73 Consolidate private header files
Private functions were previously declared

- in header files in the root directory
- in public headers guarded with IN_LIBXML
- in libxml.h
- redundantly in source files that used them.

Consolidate all private header files in include/private.
2022-08-26 02:11:56 +02:00
Nick Wellnhofer
776d15d383 Don't check for standard C89 headers
Don't check for

- ctype.h
- errno.h
- float.h
- limits.h
- math.h
- signal.h
- stdarg.h
- stdlib.h
- string.h
- time.h

Stop including non-standard headers

- malloc.h
- strings.h
2022-03-02 00:43:54 +01:00
Nick Wellnhofer
2489c1d024 Remove useless __CYGWIN__ checks
From what I can tell, some really early Cygwin versions from around
1998-2000 used to erroneously define _WIN32. This was eventually fixed,
but these days, the `defined(_WIN32) && !defined(__CYGWIN__)` idiom is
unnecessary.

Now, we only check for __CYGWIN__ in xmlexports.h when deciding whether
to use __declspec.
2022-02-28 22:58:35 +01:00
Nick Wellnhofer
346c3a930c Remove elfgcchack.h
The same optimization can be enabled with -fno-semantic-interposition
since GCC 5. clang has always used this option by default.
2022-02-20 21:49:04 +01:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
cb5541c9f3 Fix libz and liblzma detection
If libz or liblzma are detected with pkg-config, AC_CHECK_HEADERS must
not be run because the correct CPPFLAGS aren't set. It is actually not
required have separate checks for LIBXML_ZLIB_ENABLED and HAVE_ZLIB_H.
Only check for LIBXML_ZLIB_ENABLED and remove HAVE_ZLIB_H macro.

Fixes bug 764657, bug 787041.
2017-11-27 14:33:37 +01:00
J. Peter Mugaas
a4864c2f98 Fix pointer comparison warnings on 64-bit Windows 2017-10-21 14:01:10 +02:00
Nick Wellnhofer
ecbdfa9eb3 Fix unused variable warnings in nanohttp.c
Some variables are only used if certain macros are set. Move the
declarations around.
2017-10-09 14:35:55 +02:00
Nick Wellnhofer
e3890546d7 Fix the Windows header mess
Don't include windows.h and wsockcompat.h from config.h but only when
needed.

Don't define _WINSOCKAPI_ manually. This was apparently done to stop
windows.h from including winsock.h which is a problem if winsock2.h
wasn't included first. But on MinGW, this causes compiler warnings.
Define WIN32_LEAN_AND_MEAN instead which has the same effect.

Always use the compiler-defined _WIN32 macro instead of WIN32.
2017-10-09 14:35:40 +02:00
Nick Wellnhofer
45b0ebdc8d socklen_t is always int on Windows
Define XML_SOCKLEN_T as `int` unconditionally in wsockcompat.h. Fixes
compiler warnings and removes some duplicated code.
2017-10-09 13:57:42 +02:00
Nick Wellnhofer
5b2324b6e0 Don't redefine socket error codes on Windows
Translate WSA error codes instead of blindly redefining POSIX error
codes on Windows. The redefinitions caused warnings in modern Windows
environments, but simply ifdef'ing out the redefinitions seems like
the wrong approach.
2017-10-09 13:49:36 +02:00
Nick Wellnhofer
2cdaaab11c Change preprocessor OS tests to __linux__
"linux" without leading underscores is deprecated and less reliable.
2017-09-14 21:30:51 +02:00
Nick Wellnhofer
629e47e7a2 Fix empty-body warning in nanohttp.c 2017-06-17 14:56:53 +02:00
Daniel Veillard
5dca9eea1b Increase buffer space for port in HTTP redirect support
For https://bugzilla.gnome.org/show_bug.cgi?id=780690

nanohttp.c: the code wrongly assumed a short int port value.
2017-04-07 17:13:28 +02:00
Gaurav Gupta
1811add768 Fix various Missing Null checks
For https://bugzilla.gnome.org/show_bug.cgi?id=732823
2014-07-14 17:50:27 +08:00
Patrick Monnerat
437f4f5977 Use specific macros for portability to OS/400
Some of the entry points for POSIX networking calls in OS/400
differs slightly due to not using const arguments
2013-12-12 15:23:09 +08:00
Denis Pauk
283c83e0d3 run close socket on Solaris, same as we do on other platforms
https://bugzilla.gnome.org/show_bug.cgi?id=705188
2013-09-30 10:51:42 +08:00
Steve Wolf
19d785b5c7 xmlCtxtReadFile doesn't work with literal IPv6 URLs
https://bugzilla.gnome.org/show_bug.cgi?id=694185

RedHat Bug 624626 discusses the new behavior of libxml regarding brackets
around IPv6 addresses.  In earlier versions such as 2.6.27, uri.c stripped the
brackets (e.g. uri->server == "fdf2:1e39:73d1:934e::119"); in the current
version it returns IPv6 addresses with brackets intact (e.g. uri->server
== "[fdf2:1e39:73d1:934e::119]").

Thus in 2.9.0, xmlCtxtReadFile() has a problem when it is passed a URL
containing a literal IPv6 address.  xmlCtxReadFile() and its subroutines pass
uri->server unchanged to getaddrinfo(), which doesn't recognize a bracketed
IPv6 address, so the read fails.

This strips the [ and ] from IPv6 addresses allowing getaddrinfo()
to work properly with such URIs.
2013-02-28 18:22:46 +08:00
Daniel Veillard
f8e3db0445 Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
2012-09-11 13:26:36 +08:00
Daniel Veillard
399aaba14b Remove redundant and ungarded include of resolv.h
For https://bugzilla.gnome.org/show_bug.cgi?id=617053
This broke the build on Interix-6.0
2012-05-11 10:09:32 +08:00
Daniel Veillard
d95b689fd9 Fix portability failure if netdb.h lacks NO_ADDRESS 2012-04-02 17:48:53 +08:00
Daniel Veillard
ac17e5939c Remove two references to u_short 2012-04-02 15:45:13 +08:00
Stefan Kost
dff8d0f726 various: handle return values of write calls 2011-05-21 21:56:50 +03:00
Ozkan Sezer
f99d222316 614087 Fix Socket API usage to allow Windows64 compilation
In Windows 64 a socket is no more represented by an int,
this breaks the nanoftp API and nanoftp/nanohttp, the patch
changes this and fix the API for Win64
Regenerated the XML and documentation as a result too.
2010-11-04 12:08:08 +01:00
spadix
d29a5c8a5c 598785 Fix nanohttp on Windows
* nanohttp.c: the check for socket comparing to FD_SETSIZE introduced in
  bug fix for 559501 breaks on WinSockAPI
2009-10-19 14:03:25 +02:00
Daniel Veillard
594e5dfb48 Chasing dead assignments reported by clang-scan
* SAX2.c dict.c error.c hash.c nanohttp.c parser.c python/libxml.c
  relaxng.c runtest.c tree.c valid.c xinclude.c xmlregexp.c xmlsave.c
  xmlschemas.c xpath.c xpointer.c: mostly removing unneded affectations,
  but this led to a few real bugs and some part not yet understood
  (relaxng/interleave)
2009-09-07 14:58:47 +02:00
Daniel Veillard
13cee4e37b Fix a bunch of scan 'dead increments' and cleanup
* HTMLparser.c c14n.c debugXML.c entities.c nanohttp.c parser.c
  testC14N.c uri.c xmlcatalog.c xmllint.c xmlregexp.c xpath.c:
  fix unused variables, or unneeded increments as well as a couple
  of space issues
* runtest.c: check for NULL before calling unlink()
2009-09-05 14:52:55 +02:00
Raphael Prevost
48b60c3c4d 559501 avoid select and use poll for nanohttp
* config.h.in configure.in: detect availability of poll() and poll.h
* nanohttp.c: switch to use poll instead of select() when possible to
  avoid out of fd set memory errors on very large fds
2009-08-23 13:11:01 +02:00
Daniel Veillard
cba68396ac a couple more fixes patch from Andreas Färber to compile on Haiku
* parser.c: a couple more fixes
* nanohttp.c nanoftp.c: patch from Andreas Färber  to compile on Haiku
* doc/examples/*: regenerated
daniel

svn path=/trunk/; revision=3784
2008-08-29 12:43:40 +00:00
William M. Brack
ead3583b47 added space for port number (when not 80) in xmlNanoHTTPMethodRedir, plus
* nanohttp.c: added space for port number (when not 80) in
  xmlNanoHTTPMethodRedir, plus a few more comments. Should
  fix #514521.

svn path=/trunk/; revision=3685
2008-02-06 04:12:46 +00:00
William M. Brack
ec72008ba7 Enhanced to include port number (if not == 80) on the "Header:" URL (bug
* nanohttp.c: Enhanced to include port number (if not == 80) on the
  "Header:" URL (bug #469681).
* xmlregexp.c: Fixed a typo causing a warning message.

svn path=/trunk/; revision=3657
2007-08-24 02:57:38 +00:00
Daniel Veillard
cd2ebab7d9 fix an open() call with creation without 3rd argument hopefully that
* nanohttp.c: fix an open() call with creation without 3rd argument
  hopefully that interface is never used.
Daniel

svn path=/trunk/; revision=3656
2007-08-23 20:47:33 +00:00
William M. Brack
e882765aa4 small enhancement to last fix, pointed out by Alex Cornejo
* nanohttp.c: small enhancement to last fix, pointed out
  by Alex Cornejo

svn path=/trunk/; revision=3617
2007-05-16 05:19:13 +00:00
William M. Brack
d2f682a495 fixed problem on gzip streams (bug #438045) fixed minor spot of redundant
* nanohttp.c: fixed problem on gzip streams (bug #438045)
* xpath.c: fixed minor spot of redundant code - no logic change.

svn path=/trunk/; revision=3616
2007-05-15 19:42:08 +00:00