tsp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tsp-devel] Ajout de XMLRPC pour transporter les commandes


From: Eric NOULARD
Subject: Re: [Tsp-devel] Ajout de XMLRPC pour transporter les commandes
Date: Sun, 01 May 2005 20:09:09 +0200

Ré-expédition because j'ai utilisé une mauvaise adresse
pour la réponse :((

Maintenant tout le monde l'aura.
Eric
Le vendredi 29 avril 2005 à 23:55 +0200, Eric NOULARD a écrit :
> Je suis assez d'accord avec Yves à partir du moment
> ou ton patch n'est pas "actif" par défaut autant 
> commiter tes modifs.
> 
> Je pense qu'il faut ajouter un README concernant l'install
> de la lib xmlrpc-c dans tsp/src/core/xmlrpc
> 
> Pour l'URL je pense que le numéro n'a de sens
> que pour le protocole
> TSP URL format is defined by <PROTOCOL://HOST/SERVER:PORT>
>         PROTOCOL   if omitted, is defaulted to 'rpc'
>         HOST       if omitted, is defaulted to 'localhost'
>         SERVER     if omitted, find any TSP server name
>         PORT       if omitted, find first TSP server number
> 
> Un "port" XMLRPC et un port "RPC" voire un port "corba"
> n'ont peut-être rien à voir entre eux donc c'est pas bien
> grave.
> 
> Concernant CORBA on a la notion (au moins dans JacORB)
> de corbaloc pour trouver un service:
> 
> corbaloc::<host>:<port>/<servicename>
> par exemple
> corbaloc::192.168.0.1:33333/NameService
> 
> du coup le port est réellement un port tcp.
> D'un autre côté nous on pourrait étendre/transformer nos URLs en
> <PROTOCOL://HOST:PORT/SERVER:INSTANCE>
> 
> voire se pencher carrément sur les RFCs:
> ftp://ftp.rfc-editor.org/in-notes/rfc3508.txt (URL)
> ftp://ftp.rfc-editor.org/in-notes/std/std66.txt (URI, URL et URN)
> 
> Eric
> 
> 
> Le lundi 25 avril 2005 à 18:53 +0200, dvp.duf a écrit :
> > Salut Fred.
> > Bravo au grand TSPeiste, qui nous a XMLRPCiser notre canal de distribution.
> > Par contre un doute m'habite : Tu mets comme @ xmlrpc://localhost:8000
> > Pour mémoire, le numéro de port servait à identifier l'instance du 
> > provideur, et non pas un port réel. Je comprends ensuite qu'un server 
> > XML t'oblige à déclarer un port d'écoute comme un serveur web. Je pense 
> > qu'il n'y aura pas de pb pour lancer 2 providers differents en 
> > configurant 2 ports, mais je trouve cela pertubant par rapport au RPC ou 
> > les numéro n'ont pas de lien avec le port réel. Et que dire du CORBA 
> > pour masker les IORs ???
> > 
> > A suivre, et en tout cas merci.
> > PS : Pour le patch, je vais essayer une fois de retour à Astrium avec 
> > mes belles machines Solaris. Mais vu la "finesse" de tes modifs, tu 
> > pourrais les commiter...
> > Y++
> > 
> > Frederik Deweerdt wrote:
> > 
> > >Salut Téspeurs,
> > >
> > >L'utilisation de XMLRPC comme transport du canal des commandes 
> > >marche d'après les tests que j'ai fait: client_stdout, gdisp côté
> > >client et bb_simu + bb_tsp_provider sur Linux 2.6. 
> > >
> > >On peut répartir les modifs en deux parties:
> > >- Modifs dans le cadre TSP (configure.ac, Makefiles, etc...)
> > >- Ajout de src/core/xmlrpc
> > >
> > >J'ai déjà ajouté src/core/xmlrpc dans le repository, et avant
> > >de modifier de cadre TSP, je joins un diff qui montre les modifs
> > >nécessaires, je les commiterai dès que j'aurai votre feu vert.
> > >
> > >
> > >
> > >************* Quickstart *************  
> > >
> > >1) Pour pouvoir faire le test, il faut télécharger la librairie C
> > >suivante:
> > >http://xmlrpc-c.sourceforge.net/
> > >C'est la version 1.2 que j'ai utilisée, je préviens les aventureux
> > >que j'ai eu des problèmes de compil (une suppression de cpp et de
> > >tools dans le GNUmakefile a résolu mon problème finalement).
> > >
> > >2) Après avoir appliqué le cadre.tsp.diff, lancer autoconf
> > >
> > >3) RPC est toujours utilisé par défaut comme transport, il faut
> > >donc lancer le configure de la manière suivante:
> > >$ ./configure --enable-xmlrpc
> > >
> > >4) Le reste marche comme d'habitude, il faut juste préciser 
> > >xmlrpc comme protocole dans l'url:
> > >xmlrpc://localhost:8000
> > >
> > >
> > >
> > >************* Problèmes connus *************  
> > >
> > >- La taille des requêtes XML est limitée à 500Ko pour l'instant,
> > >si il y a trop de symboles, l'appel XMLRPC ne pourra pas se faire.
> > >- Le port serveur est à 8000 en dur, de manière générale la configuration
> > >du serveur nécessite une "mise en chantier"
> > >
> > >Amicalement,
> > >Fred
> > >
> > >  
> > >
> > >------------------------------------------------------------------------
> > >
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/configure.ac tsp/configure.ac
> > >--- tsp.cvs_tree/configure.ac      2005-04-23 19:24:45.000000000 +0200
> > >+++ tsp/configure.ac       2005-04-22 22:44:45.000000000 +0200
> > >@@ -173,6 +173,27 @@ fi
> > > ### End OpenGL part for TSP consumers
> > > #######################################
> > > 
> > >+######################################
> > >+# Build XMLRPC for command transport
> > >+######################################
> > >+AC_ARG_ENABLE(xmlrpc,   [  --enable-xmlrpc              enable xmlrpc for 
> > >TSP commands  (this feature is ALPHA and _disables_ RPC usage)],
> > >+        BUILD_XMLRPC=$enableval,
> > >+        BUILD_XMLRPC="no")
> > >+if test "$BUILD_XMLRPC"  = "yes"; then
> > >+  AC_CHECK_PROG([XMLRPC_CONFIG],[xmlrpc-c-config],[`which 
> > >xmlrpc-c-config`],[notfound],[$PATH],[rej])
> > >+  if test "$XMLRPC_CONFIG" = "notfound"; then
> > >+    AC_MSG_RESULT([NOK: xmlrpc-c-config script (xmlrpc-c-devel package) 
> > >not found we'll use RPC instead])
> > >+    BUILD_XMLRPC="no"
> > >+  else
> > >+    AC_MSG_RESULT([Ok])
> > >+    AC_MSG_CHECKING([enabling XMLRPC usage (disabling RPC)])
> > >+    BUILD_XMLRPC="yes"
> > >+    fi    
> > >+fi
> > >+#######################################
> > >+### End XMLRPC for command transport
> > >+#######################################
> > >+
> > > ################################
> > > # BlackBoard part of TSP
> > > ################################
> > >@@ -418,6 +439,7 @@ AC_SUBST(XML2_CONFIG_USER)
> > > AC_SUBST(GTK_BASED_CONSUMER)
> > > AC_SUBST(LEX_YACC_PARSER)
> > > AC_SUBST(TSPPROVIDER)
> > >+AC_SUBST(BUILD_XMLRPC)
> > > 
> > > 
> > > # Config for outputed files
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/make/Makeparams 
> > >tsp/make/Makeparams
> > >--- tsp.cvs_tree/make/Makeparams   2005-04-23 19:18:43.000000000 +0200
> > >+++ tsp/make/Makeparams    2005-04-23 11:58:02.000000000 +0200
> > >@@ -62,6 +62,16 @@ BUILD_XML2_CONFIG_USER   = yes
> > > BUILD_LEXYACC_PARSER      = yes
> > > BUILD_BB          = yes
> > > BUILD_SCRIPT_BINDING      = no
> > >+USABLE_OPENGL           = 
> > >+USABLE_OPENGLUT         = 
> > >+BUILD_XMLRPC              = yes
> > >+
> > >+# Setup xmlrpc-c environnement if needed
> > >+ifeq ($(BUILD_XMLRPC), yes)
> > >+        LDLIBS +=  `xmlrpc-c-config abyss-server --libs` `xmlrpc-c-config 
> > >client --libs`
> > >+        CFLAGS += -DBUILD_XMLRPC -I$(TSP_BASE)/src/core/xmlrpc
> > >+        CPPFLAGS += -DBUILD_XMLRPC -I$(TSP_BASE)/src/core/xmlrpc 
> > >+endif
> > > 
> > > # ----------------
> > > # customize
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/make/Makeparams.in 
> > >tsp/make/Makeparams.in
> > >--- tsp.cvs_tree/make/Makeparams.in        2005-04-23 19:24:48.000000000 
> > >+0200
> > >+++ tsp/make/Makeparams.in 2005-04-22 23:30:17.000000000 +0200
> > >@@ -64,6 +64,14 @@ BUILD_BB                = @BB@
> > > BUILD_SCRIPT_BINDING      = @SCRIPT_BINDING@
> > > USABLE_OPENGL           = @GL_OK@
> > > USABLE_OPENGLUT         = @GLUT_OK@
> > >+BUILD_XMLRPC              = @BUILD_XMLRPC@
> > >+
> > >+# Setup xmlrpc-c environnement if needed
> > >+ifeq ($(BUILD_XMLRPC), yes)
> > >+        LDLIBS +=  `xmlrpc-c-config abyss-server --libs` `xmlrpc-c-config 
> > >client --libs`
> > >+        CFLAGS += -DBUILD_XMLRPC -I$(TSP_BASE)/src/core/xmlrpc
> > >+        CPPFLAGS += -DBUILD_XMLRPC -I$(TSP_BASE)/src/core/xmlrpc 
> > >+endif
> > > 
> > > # ----------------
> > > # customize
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/src/core/ctrl/Makefile 
> > >tsp/src/core/ctrl/Makefile
> > >--- tsp.cvs_tree/src/core/ctrl/Makefile    2005-04-23 19:18:45.000000000 
> > >+0200
> > >+++ tsp/src/core/ctrl/Makefile     2005-04-20 18:22:46.000000000 +0200
> > >@@ -19,8 +19,6 @@ OBJECTS=$(SOURCES:%.c=$(DIROBJ)/%.o) 
> > > 
> > > TARGET=$(DIRLIB)/libtsp_provider.a
> > > 
> > >-CPPFLAGS += -I../rpc -I ../misc_utils
> > >-
> > > # -----------------------------------------------------------
> > > # No label all:: because it's in Makeparams and calls build::     
> > > # same thing for clean:: that calls destroy::
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/src/core/ctrl/tsp_provider.c 
> > >tsp/src/core/ctrl/tsp_provider.c
> > >--- tsp.cvs_tree/src/core/ctrl/tsp_provider.c      2005-04-23 
> > >19:18:45.000000000 +0200
> > >+++ tsp/src/core/ctrl/tsp_provider.c       2005-04-22 23:55:06.000000000 
> > >+0200
> > >@@ -340,11 +340,13 @@ void TSP_provider_request_close(const TS
> > > } /* End of TSP_provider_request_close */
> > > 
> > > void  TSP_provider_request_information(TSP_request_information_t* 
> > > req_info, 
> > >-                        TSP_answer_sample_t* ans_sample)
> > >+                                                                     
> > >TSP_answer_sample_t* ans_sample)
> > > {
> > >   int ret;
> > >   TSP_LOCK_MUTEX(&X_tsp_request_mutex,);
> > >   
> > >+  STRACE_IO(("-->IN"));
> > >+
> > >   ans_sample->version_id = TSP_VERSION;
> > >   ans_sample->channel_id = req_info->channel_id;
> > >   ans_sample->status = TSP_STATUS_ERROR_UNKNOWN;
> > >@@ -388,7 +390,7 @@ void TSP_provider_request_sample_free_ca
> > > }
> > > 
> > > void  TSP_provider_request_sample(TSP_request_sample_t* req_info, 
> > >-                   TSP_answer_sample_t* ans_sample)
> > >+                                                            
> > >TSP_answer_sample_t* ans_sample)
> > > {
> > >   TSP_LOCK_MUTEX(&X_tsp_request_mutex,);  
> > >   STRACE_IO(("-->IN"));
> > >@@ -441,7 +443,7 @@ void  TSP_provider_request_sample(TSP_re
> > > } /* End of TSP_provider_request_sample */
> > > 
> > > void  TSP_provider_request_sample_init(TSP_request_sample_init_t* 
> > > req_info, 
> > >-                                 TSP_answer_sample_init_t* ans_sample)
> > >+                                                                     
> > >TSP_answer_sample_init_t* ans_sample)
> > > {  
> > >   int start_local_thread;
> > >   TSP_LOCK_MUTEX(&X_tsp_request_mutex,);    
> > >@@ -451,6 +453,7 @@ void  TSP_provider_request_sample_init(T
> > >   ans_sample->channel_id = req_info->channel_id;
> > >   ans_sample->status = TSP_STATUS_ERROR_UNKNOWN;
> > >  
> > >+
> > >   if(req_info->version_id <= TSP_VERSION)
> > >     {
> > >       ans_sample->version_id = req_info->version_id;
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/src/core/ctrl/tsp_request.c 
> > >tsp/src/core/ctrl/tsp_request.c
> > >--- tsp.cvs_tree/src/core/ctrl/tsp_request.c       2005-04-24 
> > >10:44:43.000000000 +0200
> > >+++ tsp/src/core/ctrl/tsp_request.c        2005-04-20 18:16:53.000000000 
> > >+0200
> > >@@ -209,7 +209,8 @@ TSP_provider_rqh_manager_refresh(void) {
> > >             if(rqh_p->status == TSP_RQH_STATUS_RUNNING)
> > >               {
> > >                 rqh_manager_if.nb_running_rhq++;
> > >-                STRACE_INFO(("Request handler # %d started with URL %s", 
> > >rank, TSP_rpc_request_url(rqh_p)));
> > >+                /*FIXME: should not reference rpc explicitely */
> > >+                /*STRACE_INFO(("Request handler # %d started with URL 
> > >%s", rank, TSP_rpc_request_url(rqh_p)));*/
> > >               }
> > >             else
> > >               {
> > >diff --exclude-from=exc -uprN 
> > >tsp.cvs_tree/src/core/ctrl_init/tsp_provider_init.c 
> > >tsp/src/core/ctrl_init/tsp_provider_init.c
> > >--- tsp.cvs_tree/src/core/ctrl_init/tsp_provider_init.c    2005-04-23 
> > >19:18:45.000000000 +0200
> > >+++ tsp/src/core/ctrl_init/tsp_provider_init.c     2005-04-22 
> > >23:14:36.000000000 +0200
> > >@@ -40,9 +40,14 @@ Purpose   : Function calls to launch a T
> > > 
> > > #include "tsp_provider.h"
> > > #include "tsp_request.h"
> > >-#include "tsp_server.h"
> > > #include "tsp_provider_init.h"
> > > 
> > >+#ifdef BUILD_XMLRPC
> > >+#include "tsp_xmlrpc_server.h"
> > >+#else
> > >+#include "tsp_server.h"
> > >+#endif
> > >+
> > > int TSP_provider_init(int* argc, char** argv[])
> > > {
> > > 
> > >@@ -72,7 +77,11 @@ int TSP_provider_run(int spawn_mode)
> > >   if(TSP_provider_is_initialized())
> > >     {            
> > >       /* build and install default request handler (RPC) */
> > >+#ifdef BUILD_XMLRPC
> > >+      TSP_provider_rqh_manager_install(0,TSP_xmlrpc_request);
> > >+#else
> > >       TSP_provider_rqh_manager_install(0,TSP_rpc_request);
> > >+#endif
> > > 
> > >       if (spawn_mode & TSP_ASYNC_REQUEST_DYNAMIC) {
> > >   /*
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/src/core/driver/tsp_consumer.c 
> > >tsp/src/core/driver/tsp_consumer.c
> > >--- tsp.cvs_tree/src/core/driver/tsp_consumer.c    2005-04-23 
> > >19:18:45.000000000 +0200
> > >+++ tsp/src/core/driver/tsp_consumer.c     2005-04-23 19:12:44.000000000 
> > >+0200
> > >@@ -427,12 +427,12 @@ TSP_provider_t* TSP_consumer_connect_url
> > >       else p = url_tok; /* may start of string be the hostname ?! */
> > > 
> > >       /* no protocol specified, use default */
> > >-      protocol = strdup(TSP_RPC_PROTOCOL);
> > >+      protocol = strdup(TSP_PROTOCOL);
> > >    }
> > >   else
> > >     {
> > >       /* protocol should be OK (start of URL), set p to hostname field */
> > >-      if(p == url_tok) protocol = strdup(TSP_RPC_PROTOCOL);
> > >+      if(p == url_tok) protocol = strdup(TSP_PROTOCOL);
> > >       *p = '\0';
> > >       p += 3;
> > >     }
> > >@@ -567,7 +567,7 @@ void TSP_consumer_connect_all(const char
> > >     STRACE_DEBUG(("Trying to open server No %d", i));
> > > 
> > >     /* Is server number 'i' alive ?*/ 
> > >-    if(TSP_remote_open_server(  TSP_RPC_PROTOCOL,
> > >+    if(TSP_remote_open_server(  TSP_PROTOCOL,
> > >                                 host_name,
> > >                                 "",
> > >                                 i, 
> > >diff --exclude-from=exc -uprN 
> > >tsp.cvs_tree/src/core/include/tsp_const_def.h 
> > >tsp/src/core/include/tsp_const_def.h
> > >--- tsp.cvs_tree/src/core/include/tsp_const_def.h  2005-04-23 
> > >19:18:45.000000000 +0200
> > >+++ tsp/src/core/include/tsp_const_def.h   2005-04-23 18:56:44.000000000 
> > >+0200
> > >@@ -225,7 +225,11 @@ typedef struct  TSP_otsp_server_info_t T
> > > 
> > > /*-------- RPC --------*/
> > > 
> > >-#define TSP_RPC_PROTOCOL "rpc"
> > >+#ifdef BUILD_XMLRPC
> > >+#define TSP_PROTOCOL "xmlrpc"
> > >+#else
> > >+#define TSP_PROTOCOL "rpc"
> > >+#endif
> > > /**
> > >  * base RPC PROG_ID that will be used 
> > >  * to calculate the PROG ID for each server
> > >@@ -244,6 +248,14 @@ typedef struct  TSP_otsp_server_info_t T
> > >  */
> > > #define TSP_MAXHOSTNAMELEN 255
> > > 
> > >+/* ------- URL LENGTH ----*/
> > >+
> > >+/**
> > >+ * Max url length, 4096 looks like a sane value
> > >+ * see http://www.faqts.com/knowledge_base/view.phtml/aid/329
> > >+ */
> > >+#define TSP_MAX_URL_LENGTH 4096
> > >+
> > > /*-------- MACROS --------*/
> > > 
> > > #define TSP_CHECK_ALLOC(p, ret) \
> > >diff --exclude-from=exc -uprN tsp.cvs_tree/src/core/Makefile 
> > >tsp/src/core/Makefile
> > >--- tsp.cvs_tree/src/core/Makefile 2005-04-23 19:18:45.000000000 +0200
> > >+++ tsp/src/core/Makefile  2005-04-18 16:02:04.000000000 +0200
> > >@@ -2,8 +2,14 @@ include $(DEVBASE)/make/Makeparams
> > > #----------------------------------------------------------
> > > # core is only compiled for native host target and not java
> > > #----------------------------------------------------------
> > >+  
> > >+SUBDIRS = include misc_utils
> > > 
> > >-SUBDIRS = include misc_utils rpc
> > >+ifeq (${BUILD_XMLRPC}, yes)
> > >+  SUBDIRS += xmlrpc
> > >+else
> > >+  SUBDIRS += rpc
> > >+endif
> > > 
> > > ifeq (${BUILD_PROVIDER},yes)
> > >   SUBDIRS += ctrl ctrl_init
> > >  
> > >
> > >------------------------------------------------------------------------
> > >
> > >_______________________________________________
> > >Tsp-devel mailing list
> > >address@hidden
> > >http://lists.nongnu.org/mailman/listinfo/tsp-devel
> > >  
> > >
> > 
> > 
> > 
> > _______________________________________________
> > Tsp-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/tsp-devel
> > 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]