Re: Fault Strings
Scott Hutton <[email protected]> Mon, 29 Apr 2002 14:23:35 -0700 (PDT)
| Newsgroups | gmane.comp.gnome.ximian.soup |
|---|---|
| Message-ID | <[email protected]> |
I left out a one line change in my last message about suggested fixes for soup-parser.c. I've attached a fault-handling patch against the 0.7.2.1 tree (well, against Ximian's SRPM, actually). I wouldn't plan to use this patch unless you know what you're doing. It blatantly hacks the understanding of the response codes. So, in the event of an actual server error (one where there's no SOAP data in the message body), it'll just spew complaints about parsing HTML as XML. As I said, someone with the Soup Big Picture needs to address that one, perhaps by adding a new error class. However, our code is now happily reporting errors... -Scott
soup-0.7.2.1-fault.patch
(text/plain, 4.7 KB)
diff -cr soup-0.7.2.1/configure.in soup-0.7.2.1.faultpatched/configure.in
*** soup-0.7.2.1/configure.in Thu Apr 11 14:38:08 2002
--- soup-0.7.2.1.faultpatched/configure.in Mon Apr 29 13:31:08 2002
***************
*** 557,563 ****
src/soup-httpd/Makefile
src/soup-ssl-proxy/Makefile
src/soup-wsdl/Makefile
- tests/Makefile
])
echo "
--- 557,562 ----
diff -cr soup-0.7.2.1/soup.spec.in soup-0.7.2.1.faultpatched/soup.spec.in
*** soup-0.7.2.1/soup.spec.in Wed Mar 21 16:32:38 2001
--- soup-0.7.2.1.faultpatched/soup.spec.in Mon Apr 29 13:31:08 2002
***************
*** 1,6 ****
# Note that this is NOT a relocatable package
%define ver @VERSION@
! %define rel 1
%define prefix /usr
Summary: Soup, a SOAP implementation
--- 1,6 ----
# Note that this is NOT a relocatable package
%define ver @VERSION@
! %define rel 2.gibraltar.2
%define prefix /usr
Summary: Soup, a SOAP implementation
***************
*** 91,96 ****
--- 91,97 ----
%files devel
%defattr(-, root, root)
%{prefix}/bin/soup-config
+ %{prefix}/bin/soup-ssl-proxy
%{prefix}/include/soup
%{prefix}/lib/*a
%{prefix}/lib/soupConf.sh
diff -cr soup-0.7.2.1/src/libsoup/soup-error.c soup-0.7.2.1.faultpatched/src/libsoup/soup-error.c
*** soup-0.7.2.1/src/libsoup/soup-error.c Sun Oct 21 15:54:05 2001
--- soup-0.7.2.1.faultpatched/src/libsoup/soup-error.c Mon Apr 29 13:31:08 2002
***************
*** 115,121 ****
{
if (errcode < 100) return SOUP_ERROR_CLASS_TRANSPORT;
if (errcode < 200) return SOUP_ERROR_CLASS_INFORMATIONAL;
! if (errcode < 300) return SOUP_ERROR_CLASS_SUCCESS;
if (errcode < 400) return SOUP_ERROR_CLASS_REDIRECT;
if (errcode < 500) return SOUP_ERROR_CLASS_CLIENT_ERROR;
if (errcode < 600) return SOUP_ERROR_CLASS_SERVER_ERROR;
--- 115,121 ----
{
if (errcode < 100) return SOUP_ERROR_CLASS_TRANSPORT;
if (errcode < 200) return SOUP_ERROR_CLASS_INFORMATIONAL;
! if (errcode < 600) return SOUP_ERROR_CLASS_SUCCESS;
if (errcode < 400) return SOUP_ERROR_CLASS_REDIRECT;
if (errcode < 500) return SOUP_ERROR_CLASS_CLIENT_ERROR;
if (errcode < 600) return SOUP_ERROR_CLASS_SERVER_ERROR;
diff -cr soup-0.7.2.1/src/libsoup/soup-error.h soup-0.7.2.1.faultpatched/src/libsoup/soup-error.h
*** soup-0.7.2.1/src/libsoup/soup-error.h Tue Jan 8 17:55:27 2002
--- soup-0.7.2.1.faultpatched/src/libsoup/soup-error.h Mon Apr 29 13:31:08 2002
***************
*** 24,30 ****
#define SOUP_ERROR_IS_TRANSPORT(x) ((x) > 0 && (x) < 100)
#define SOUP_ERROR_IS_INFORMATIONAL(x) ((x) >= 100 && (x) < 200)
! #define SOUP_ERROR_IS_SUCCESSFUL(x) ((x) >= 200 && (x) < 300)
#define SOUP_ERROR_IS_REDIRECTION(x) ((x) >= 300 && (x) < 400)
#define SOUP_ERROR_IS_CLIENT_ERROR(x) ((x) >= 400 && (x) < 500)
#define SOUP_ERROR_IS_SERVER_ERROR(x) ((x) >= 500 && (x) < 600)
--- 24,30 ----
#define SOUP_ERROR_IS_TRANSPORT(x) ((x) > 0 && (x) < 100)
#define SOUP_ERROR_IS_INFORMATIONAL(x) ((x) >= 100 && (x) < 200)
! #define SOUP_ERROR_IS_SUCCESSFUL(x) ((x) >= 200 && (x) < 600)
#define SOUP_ERROR_IS_REDIRECTION(x) ((x) >= 300 && (x) < 400)
#define SOUP_ERROR_IS_CLIENT_ERROR(x) ((x) >= 400 && (x) < 500)
#define SOUP_ERROR_IS_SERVER_ERROR(x) ((x) >= 500 && (x) < 600)
diff -cr soup-0.7.2.1/src/libsoup/soup-parser.c soup-0.7.2.1.faultpatched/src/libsoup/soup-parser.c
*** soup-0.7.2.1/src/libsoup/soup-parser.c Fri Jun 15 07:17:45 2001
--- soup-0.7.2.1.faultpatched/src/libsoup/soup-parser.c Mon Apr 29 13:31:08 2002
***************
*** 234,240 ****
for (tmp = xml_node->xmlChildrenNode; tmp; tmp = tmp->next) {
SoupParam *param;
! if (!strcmp(tmp->name, "Fault")) {
xmlNodePtr subnode;
gchar *code = NULL;
gchar *string = NULL;
--- 234,240 ----
for (tmp = xml_node->xmlChildrenNode; tmp; tmp = tmp->next) {
SoupParam *param;
! if (!strcmp(xml_node->name, "Fault")) {
xmlNodePtr subnode;
gchar *code = NULL;
gchar *string = NULL;
***************
*** 242,254 ****
gchar *detail = NULL;
/* retrieve all info about the fault */
! for (subnode = tmp->xmlChildrenNode;
subnode;
subnode = subnode->next) {
xmlChar *str;
str = xmlNodeListGetString(parser->xml_doc,
! tmp->xmlChildrenNode,
1);
if (!strcmp(subnode->name, "faultcode"))
--- 242,254 ----
gchar *detail = NULL;
/* retrieve all info about the fault */
! for (subnode = xml_node->xmlChildrenNode;
subnode;
subnode = subnode->next) {
xmlChar *str;
str = xmlNodeListGetString(parser->xml_doc,
! subnode->xmlChildrenNode,
1);
if (!strcmp(subnode->name, "faultcode"))