Used hostname as destination, fixed connection handshake.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 13 Oct 2005 12:51:56 +0000 (12:51 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 13 Oct 2005 12:51:56 +0000 (12:51 +0000)
org.glite.jp.index/src/bones_server.c
org.glite.jp.index/src/conf.c
org.glite.jp.index/src/conf.h
org.glite.jp.index/src/context.c
org.glite.jp.index/src/context.h
org.glite.jp.index/src/soap_ps_calls.c

index 0afcf95..c51f50b 100644 (file)
@@ -138,6 +138,7 @@ int main(int argc, char *argv[])
 
        setsockopt(stab.conn,SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
 
+       if (conf->port) port = conf->port;
        a.sin_family = AF_INET;
        a.sin_addr.s_addr = INADDR_ANY;
        a.sin_port = htons(atoi(port));
index 1742f1a..9d8eaaa 100644 (file)
@@ -42,8 +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.ics.muni.cz:8901");
-       conf->feeds[0]->PS_URL = strdup("http://localhost: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));
@@ -58,6 +58,7 @@ int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf
        conf->feeds[1] = NULL;
 
        conf->cs = getenv("GLITE_JPIS_DB");
+       conf->port = getenv("GLITE_JPIS_PORT");
 
        *configuration = conf;
 
index 17543d5..154a49c 100644 (file)
@@ -11,7 +11,7 @@ typedef struct _glite_jp_is_feed {
        char                    *PS_URL;        //URLs of Primary Storage servers
        glite_jp_query_rec_t    **query;        // query to Primary Server (aka filter)
        int                     history,        // type of query
-                               continuous;     
+                               continuous;
 } glite_jp_is_feed;
 
 
@@ -25,7 +25,7 @@ typedef struct _glite_jp_is_conf {
 
        glite_jp_is_feed        **feeds;        // null terminated list of feeds
 
-       char    *cs;
+       char    *cs, *port;
 } glite_jp_is_conf;
 
 
index 959a185..9eb43a3 100644 (file)
@@ -1,19 +1,27 @@
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
+
+#include <globus_common.h>
 
 #include "conf.h"
 #include "context.h"
 
 
 int glite_jpis_init_context(glite_jpis_context_t *isctx, glite_jp_context_t jpctx, glite_jp_is_conf *conf) {
+       char hname[512];
+
        if ((*isctx = calloc(sizeof(**isctx), 1)) != NULL) {
                (*isctx)->jpctx = jpctx;
                (*isctx)->conf = conf;
+               globus_libc_gethostname(hname, sizeof hname);
+               (*isctx)->hname = strdup(hname);
                return 0;
        } else return ENOMEM;
 }
 
 
 void glite_jpis_free_context(glite_jpis_context_t ctx) {
+       free(ctx->hname);
        free(ctx);
 }
index 0ebfa79..890413a 100644 (file)
@@ -15,6 +15,8 @@ typedef struct _glite_jpis_context {
        char param_feedid[33], param_ps[256], param_indexed[256];
        unsigned long param_ps_len, param_feedid_len, param_indexed_len;
        void *param_expires;
+
+       char *hname;
 } *glite_jpis_context_t;
 
 typedef struct _slave_data_t{
index 920c2aa..930a322 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "glite/jp/types.h"
 #include "glite/jp/context.h"
+#include "glite/security/glite_gsplugin.h"
 
 #include "jpps_H.h"
 #include "jpps_.nsmap"
@@ -129,12 +130,14 @@ int MyFeedIndex(glite_jpis_context_t ctx, glite_jp_is_conf *conf, long int uniqu
        int                                     i, dest_index;
        struct soap                             *soap = soap_new();
        glite_jp_error_t err;
-       char *src;
+       char *src, hname[512];
 
 printf("MyFeedIndex for %s called\n", dest);
 
        soap_init(soap);
         soap_set_namespaces(soap,jpps__namespaces);
+// TODO
+       soap_register_plugin(soap,glite_gsplugin);
 
        memset(&in, 0, sizeof(in));
        memset(&err, 0, sizeof(err));
@@ -162,6 +165,7 @@ printf("MyFeedIndex for %s called\n", dest);
 
        in.history = conf->feeds[dest_index]->history;
        in.continuous = conf->feeds[dest_index]->continuous;
+       in.destination = ctx->hname;
 
        if (check_fault(soap,soap_call___jpsrv__FeedIndex(soap,dest,"", &in, &out)) != 0) {
                printf("\n");