More elaborated connection error messages, localhost as default JP.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 12 Oct 2005 10:13:17 +0000 (10:13 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 12 Oct 2005 10:13:17 +0000 (10:13 +0000)
org.glite.jp.index/src/bones_server.c
org.glite.jp.index/src/conf.c
org.glite.jp.index/src/soap_ps_calls.c

index 0803b12..6443da1 100644 (file)
@@ -284,7 +284,11 @@ static int newconn(int conn,struct timeval *to,void *data)
        /* TODO: DNS paranoia etc. */
 
        if (edg_wll_gss_accept(mycred,conn,to,plugin_ctx->connection,&gss_code)) {
-               printf("[%d] GSS connection accept failed, closing.\n", getpid());
+               char    *et;
+
+               edg_wll_gss_get_error(&gss_code,"",&et);
+
+               printf("[%d] GSS connection accept failed: %s\nClosing connection.\n", getpid(), et);
                ret = 1;
                goto cleanup;
        }
index 4bab10e..1742f1a 100644 (file)
@@ -42,7 +42,8 @@ int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf
        conf->feeds = calloc(2, sizeof(*(conf->feeds)));
        
        conf->feeds[0] = calloc(1, sizeof(**(conf->feeds)));
-       conf->feeds[0]->PS_URL = strdup("http://umbar-test.ics.muni.cz:8901");
+//     conf->feeds[0]->PS_URL = strdup("http://umbar.ics.muni.cz:8901");
+       conf->feeds[0]->PS_URL = strdup("http://localhost:8901");
 
        // all job since Epoche
        conf->feeds[0]->query = calloc(2,sizeof(*conf->feeds[0]->query));
index 536d59f..920c2aa 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <fcntl.h>
+#include <assert.h>
 
 #include "glite/jp/types.h"
 #include "glite/jp/context.h"
@@ -59,6 +60,48 @@ static void err2fault(const glite_jp_context_t ctx,struct soap *soap)
 }
 
 
+static int check_fault(struct soap *soap,int err) {
+       struct SOAP_ENV__Detail *detail;
+       struct jptype__genericFault     *f;
+       char    *reason,indent[200] = "  ";
+
+       switch(err) {
+               case SOAP_OK: puts("OK");
+                             break;
+               case SOAP_FAULT:
+               case SOAP_SVR_FAULT:
+                       if (soap->version == 2) {
+                               detail = soap->fault->SOAP_ENV__Detail;
+                               reason = soap->fault->SOAP_ENV__Reason;
+                       }
+                       else {
+                               detail = soap->fault->detail;
+                               reason = soap->fault->faultstring;
+                       }
+                       fputs(reason,stderr);
+                       putc('\n',stderr);
+                       assert(detail->__type == SOAP_TYPE__genericFault);
+#if GSOAP_VERSION >=20700
+                       f = ((struct _genericFault *) detail->fault)
+#else
+                       f = ((struct _genericFault *) detail->value)
+#endif
+                               -> jpelem__genericFault;
+
+                       while (f) {
+                               fprintf(stderr,"%s%s: %s (%s)\n",indent,
+                                               f->source,f->text,f->description);
+                               f = f->reason;
+                               strcat(indent,"  ");
+                       }
+                       return -1;
+
+               default: soap_print_fault(soap,stderr);
+                        return -1;
+       }
+       return 0;
+}
+
 
 /*----------------------*/
 /* PS WSDL client calls */
@@ -120,8 +163,7 @@ printf("MyFeedIndex for %s called\n", dest);
        in.history = conf->feeds[dest_index]->history;
        in.continuous = conf->feeds[dest_index]->continuous;
 
-       //if (!check_fault(soap,soap_call_jpsrv___FeedIndex(soap,dest,"",
-       if (soap_call___jpsrv__FeedIndex(soap,dest,"", &in, &out)) {
+       if (check_fault(soap,soap_call___jpsrv__FeedIndex(soap,dest,"", &in, &out)) != 0) {
                printf("\n");
                glite_jpis_unlockFeed(ctx, uniqueid);
                err.code = EIO;