mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
Patches: - HTMLparser.c: htmlCheckParagraph to check
Patches: - HTMLparser.c: htmlCheckParagraph to check htmlOmittedDefaultValue, reported by Jonas Borgstrm - nanohttp.c: Applied Bjorn Reese' IPV6 first patch Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Wed Jan 3 18:56:00 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* HTMLparser.c: htmlCheckParagraph to check htmlOmittedDefaultValue,
|
||||||
|
reported by Jonas Borgstr<74>m
|
||||||
|
* nanohttp.c: Applied Bjorn Reese' IPV6 first patch
|
||||||
|
|
||||||
Wed Jan 3 16:19:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
Wed Jan 3 16:19:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
* testXPath.c xpath.c: fixing the XPath union expressions problem
|
* testXPath.c xpath.c: fixing the XPath union expressions problem
|
||||||
|
@ -925,6 +925,8 @@ htmlCheckParagraph(htmlParserCtxtPtr ctxt) {
|
|||||||
ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL);
|
ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
if (!htmlOmittedDefaultValue)
|
||||||
|
return;
|
||||||
for (i = 0; htmlNoContentElements[i] != NULL; i++) {
|
for (i = 0; htmlNoContentElements[i] != NULL; i++) {
|
||||||
if (xmlStrEqual(tag, BAD_CAST htmlNoContentElements[i])) {
|
if (xmlStrEqual(tag, BAD_CAST htmlNoContentElements[i])) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
47
nanohttp.c
47
nanohttp.c
@ -60,6 +60,9 @@
|
|||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SUPPORT_IP6
|
||||||
|
#include <resolv.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <stropts>
|
#include <stropts>
|
||||||
@ -643,10 +646,9 @@ xmlNanoHTTPScanAnswer(xmlNanoHTTPCtxtPtr ctxt, const char *line) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
|
xmlNanoHTTPConnectAttempt(struct sockaddr *addr, int port)
|
||||||
{
|
{
|
||||||
SOCKET s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
SOCKET s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
struct sockaddr_in sin;
|
|
||||||
fd_set wfd;
|
fd_set wfd;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int status;
|
int status;
|
||||||
@ -692,11 +694,7 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
|
|||||||
#endif /* !_WINSOCKAPI_ */
|
#endif /* !_WINSOCKAPI_ */
|
||||||
|
|
||||||
|
|
||||||
sin.sin_family = AF_INET;
|
if ((connect(s, addr, sizeof(*addr))==-1)) {
|
||||||
sin.sin_addr = ia;
|
|
||||||
sin.sin_port = htons(port);
|
|
||||||
|
|
||||||
if ((connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1)) {
|
|
||||||
switch (socket_errno()) {
|
switch (socket_errno()) {
|
||||||
case EINPROGRESS:
|
case EINPROGRESS:
|
||||||
case EWOULDBLOCK:
|
case EWOULDBLOCK:
|
||||||
@ -764,9 +762,21 @@ static int
|
|||||||
xmlNanoHTTPConnectHost(const char *host, int port)
|
xmlNanoHTTPConnectHost(const char *host, int port)
|
||||||
{
|
{
|
||||||
struct hostent *h;
|
struct hostent *h;
|
||||||
|
struct sockaddr *addr;
|
||||||
|
struct in_addr ia;
|
||||||
|
struct sockaddr_in sin;
|
||||||
|
#ifdef SUPPORT_IP6
|
||||||
|
struct in6_addr ia6;
|
||||||
|
struct sockaddr_in6 sin6;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
|
#if defined(SUPPORT_IP6) && defined(RES_USE_INET6)
|
||||||
|
if (!(_res.options & RES_INIT))
|
||||||
|
res_init();
|
||||||
|
_res.options |= RES_USE_INET6;
|
||||||
|
#endif
|
||||||
h=gethostbyname(host);
|
h=gethostbyname(host);
|
||||||
if (h==NULL)
|
if (h==NULL)
|
||||||
{
|
{
|
||||||
@ -778,9 +788,26 @@ xmlNanoHTTPConnectHost(const char *host, int port)
|
|||||||
|
|
||||||
for(i=0; h->h_addr_list[i]; i++)
|
for(i=0; h->h_addr_list[i]; i++)
|
||||||
{
|
{
|
||||||
struct in_addr ia;
|
if (h->h_addrtype == AF_INET) {
|
||||||
memcpy(&ia, h->h_addr_list[i],4);
|
/* A records (IPv4) */
|
||||||
s = xmlNanoHTTPConnectAttempt(ia, port);
|
memcpy(&ia, h->h_addr_list[i], h->h_length);
|
||||||
|
sin.sin_family = h->h_addrtype;
|
||||||
|
sin.sin_addr = ia;
|
||||||
|
sin.sin_port = htons(port);
|
||||||
|
addr = (struct sockaddr *)&sin;
|
||||||
|
#ifdef SUPPORT_IP6
|
||||||
|
} else if (h->h_addrtype == AF_INET6) {
|
||||||
|
/* AAAA records (IPv6) */
|
||||||
|
memcpy(&ia6, h->h_addr_list[i], h->h_length);
|
||||||
|
sin6.sin_family = h->h_addrtype;
|
||||||
|
sin6.sin_addr = ia6;
|
||||||
|
sin6.sin_port = htons(port);
|
||||||
|
addr = (struct sockaddr *)&sin6;
|
||||||
|
#endif
|
||||||
|
} else
|
||||||
|
break; /* for */
|
||||||
|
|
||||||
|
s = xmlNanoHTTPConnectAttempt(addr, port);
|
||||||
if (s != -1)
|
if (s != -1)
|
||||||
return(s);
|
return(s);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user