
On Thu, Jul 17, 2008 at 07:08:54PM +0200, Stefan Manegold wrote:
On Thu, Jul 17, 2008 at 04:42:42PM +0000, Ying Zhang wrote:
Update of /cvsroot/monetdb/pathfinder/runtime In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1165
Modified Files: Makefile.ag serialize_dflt.mx xrpc_client.mx xrpc_common.mx xrpc_server.mx Added Files: xrpc_const.mx Log Message: Since xrpc_server and xrpc_client are not independent of each other (the server needs the client to handle nested xrpc queries), better put them into one lib. This way, we also get rid of the problem that xrpc_common.mx is included in two libs.
The "xrpc_server" & "xrpc_client" used to be not only "libs" but also *modules*. Replacing two modules xrpc_server & xrpc_client by one module "xrpc" requires some more work:
======== $ Mserver --dbinit='module(pathfinder);' !WARNING: GDKlockHome: created directory /ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/var/MonetDB4/dbfarm/demo/ !WARNING: GDKlockHome: ignoring empty or invalid .gdk_lock. !WARNING: BBPdir: initializing BBP. # MonetDB Server v4.25.0 # based on GDK v1.25.0 # Copyright (c) 1993-2008, CWI. All rights reserved. # Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. !ERROR: TBL_openmod: DL_open: library not found. !ERROR: TBL_loadmod: module load _xrpc_server cancelled. !ERROR: moduleClient: module(_xrpc_server) load error. !ERROR: TBL_openmod: DL_open: library not found. !ERROR: TBL_loadmod: module load _xrpc_client cancelled. !ERROR: moduleClient: module(_xrpc_client) load error. # PF/Tijah module v0.5.0 loaded. http://dbappl.cs.utwente.nl/pftijah !ERROR: interpret_params: append(param 1): invalid BAT. MonetDB> ========
Stefan
ps: If it (seems to) work for you, you probabaly did not clean your prefix which still contains the old "xrpc_server" & "xrpc_client" module files ... When removing (or renaming files, a `make uninstall` before modifying Makfile.ag's is always a good advice ...
Also separate xrpc constant strings into a new header file, so that serialize_dflt kan include it.
U xrpc_common.mx Index: xrpc_common.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_common.mx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- xrpc_common.mx 17 Jul 2008 14:56:19 -0000 1.6 +++ xrpc_common.mx 17 Jul 2008 16:42:38 -0000 1.7 @@ -24,134 +24,12 @@ @' $Id$ @f xrpc_common @a Ying Zhang -@t Includes header files, definitions shared by the XRPC server, XRPC client and serializer +@t Includes struct and functions shared by the XRPC server and XRPC client
@h #ifndef XRPC_COMMON_H #define XRPC_COMMON_H
-/* HTTP defines */ -#define XRPC_DOC_CALLBACK "/xrpc/doc" -#define XRPC_ADM_CALLBACK "/xrpc/admin" -#define XRPC_WSAT_CALLBACK "/xrpc/wsat" -#define XRPC_REQ_CALLBACK "/xrpc" - -#define ERR403 "403 Forbidden" -#define ERR404 "404 Bad Request" -#define ERR408 "408 Request Timeout" -#define ERR500 "500 Internal Server Error" -#define ERR504 "504 Gateway Timeout" - -#define OUT_OF_MEM "Internal Receiver Error: out-of memory" -#define NOT_WELL_FORMED "Request XML message not well-formed" -#define MAX_NR_PARAMS 1024 - -#define HTTP_200_OK\ - "HTTP/1.1 200 OK\r\n"\ - "Content-type: text/xml; charset=\"utf-8\"\r\n\r\n" - -/* Namespaces */ -#define MXQ_ADMIN "http://monetdb.cwi.nl/XQuery/admin/" -#define SOAP_NS "http://www.w3.org/2003/05/soap-envelope" -#define XDT_NS "http://www.w3.org/2005/xpath-datatypes" -#define XS_NS "http://www.w3.org/2001/XMLSchema" -#define XSI_NS "http://www.w3.org/2001/XMLSchema-instance" -#define XRPC_NS "http://monetdb.cwi.nl/XQuery" -#define XRPC_LOC "http://monetdb.cwi.nl/XQuery/XRPC.xsd" -#define WSCOOR_NS "http://docs.oasis-open.org/ws-tx/wscoor/2006/06" -#define WSAT_NS "http://docs.oasis-open.org/ws-tx/wsat/2006/06" - -#define XRPC_REQ_QN XRPC_NS"|request" -#define XRPC_RES_QN XRPC_NS"|response" - -/* XRPC SOAP snippets */ -#define SOAP_ENVELOPE\ - "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"\ - "<env:Envelope\n"\ - " xmlns:env=\"" SOAP_NS "\"\n"\ - " xmlns:xrpc=\"" XRPC_NS "\"\n"\ - " xmlns:xdt=\"" XDT_NS "\" \n"\ - " xmlns:xs=\"" XS_NS "\"\n"\ - " xmlns:xsi=\"" XSI_NS "\"\n"\ - " xsi:schemaLocation=\"" XRPC_NS " " XRPC_LOC "\">\n" - -#define XRPC_WS_QID\ - " <xrpc:header xrpc:mode=\"%s\">\n"\ - " <wscoor:CoordinationContext\n"\ - " xmlns:wscoor=\""WSCOOR_NS"\"\n"\ - " env:mustUnderstand=\"true\">\n"\ - " <wscoor:Identifier>%s</wscoor:Identifier>\n"\ - " <wscoor:Expires>"LLFMT"</wscoor:Expires>\n"\ - " <wscoor:CoordinationType>" WSAT_NS "</wscoor:CoordinationType>\n"\ - " </wscoor:CoordinationContext>\n"\ - " </xrpc:header>\n" - -#define XRPC_REQ_BODY_OPEN\ - "<env:Body>\n"\ - " <xrpc:request\n"\ - " xrpc:module=\"%s\"\n"\ - " xrpc:location=\"%s\"\n"\ - " xrpc:method=\"%s\"\n"\ - " xrpc:arity=\""LLFMT"\"\n"\ - " xrpc:iter-count=\""LLFMT"\"\n"\ - " xrpc:updCall=\"%s\"\n"\ - " xrpc:caller=\"" -#define XRPC_REQ_BODY\ - XRPC_REQ_BODY_OPEN "%s:"LLFMT"\">\n" -#define XRPC_REQ_BODY_FIRST_CALLER\ - XRPC_REQ_BODY_OPEN "query\">\n" - -#define XRPC_WSAT_REQ SOAP_ENVELOPE\ - "<env:Header>"\ - XRPC_WS_QID \ - "</env:Header>\n"\ - "<env:Body><wsat:%s/></env:Body>\n"\ - "</env:Envelope>" - -#define XRPC_WSAT_RES SOAP_ENVELOPE\ - "<env:Header>\n"\ - XRPC_WS_QID \ - " <xrpc:partipant>%s,%s:%s:%s,"LLFMT",%d</xrpc:participant>\n"\ - "</env:Header>\n"\ - "<env:Body><wsat:%s/></env:Body>\n"\ - "</env:Envelope>" - -#define XRPC_RES_BODY\ - "<env:Body>\n"\ - " <xrpc:response\n"\ - " xrpc:module=\"%s\"\n"\ - " xrpc:method=\"%s\">\n" - -#define XRPC_HTTP_CALL\ - " <xrpc:call>"\ - " <xrpc:sequence>"\ - " <xrpc:atomic-value xsi:type=\"xs:string\">%s</xrpc:atomic-value>"\ - " </xrpc:sequence>"\ - " </xrpc:call>" - -#define XRPC_PUT_CALL\ - " <xrpc:call>"\ - " <xrpc:sequence>"\ - " <xrpc:atomic-value xsi:type=\"xs:string\">%s</xrpc:atomic-value>"\ - " </xrpc:sequence>"\ - " <xrpc:sequence>"\ - " <xrpc:element>%s</xrpc:element>"\ - " </xrpc:sequence>"\ - " </xrpc:call>" - -#define XRPC_REQ_FOOTER\ - " </xrpc:request>\n"\ - "</env:Body>\n"\ - "</env:Envelope>" - -#ifndef HOST_NAME_MAX -#ifdef _POSIX_HOST_NAME_MAX -#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX -#else -#define HOST_NAME_MAX 255 -#endif -#endif - typedef struct { char *qid; char *caller; @@ -188,6 +66,7 @@ #include "pf_config.h" #include "pathfinder.h" #include "xrpc_common.h" +#include "xrpc_const.h"
XRPCreq_t * XRPCreq_new(
U xrpc_client.mx Index: xrpc_client.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_client.mx,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- xrpc_client.mx 17 Jul 2008 14:56:19 -0000 1.49 +++ xrpc_client.mx 17 Jul 2008 16:42:38 -0000 1.50 @@ -398,6 +398,7 @@ #include "shredder.h" #include "serialize.h" #include "xrpc_common.h" +#include "xrpc_const.h" #include "xrpc_client.h"
int
U serialize_dflt.mx Index: serialize_dflt.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/serialize_dflt.mx,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- serialize_dflt.mx 17 Jul 2008 14:56:19 -0000 1.49 +++ serialize_dflt.mx 17 Jul 2008 16:42:38 -0000 1.50 @@ -41,7 +41,7 @@ #include "serialize_null.h" #include "pathfinder.h" #include "pf_support.h" -#include "xrpc_common.h" /* *_NS defs */ +#include "xrpc_const.h"
/* a lot of characters, static strings, and their sizes (the idea is to reuse constant character pointers during
U Makefile.ag Index: Makefile.ag =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/Makefile.ag,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- Makefile.ag 15 Jul 2008 14:14:15 -0000 1.89 +++ Makefile.ag 17 Jul 2008 16:42:38 -0000 1.90 @@ -49,11 +49,6 @@ ll_sibling.mx }
-lib_xrpc_common = { - NOINST - SOURCES = xrpc_common.mx -} - lib__pf_support = { DIR = libdir/MonetDB4 SOURCES = \ @@ -103,25 +98,16 @@ $(MONETDB4_MODS) -l_logger -l_streams -l_builtin -l_ascii_io -l_algebra -l_sys -l_constant -l_mapi }
-lib__xrpc_client = { - DIR = libdir/MonetDB4 - SOURCES = xrpc_client.mx - LIBS = \ - libserialize libxrpc_common \ - ./lib_pf_support ./lib_pathfinder \ - $(PF_LIBS) $(SOCKET_LIBS) \ - $(MONETDB_LIBS) -lbat -lstream $(MONETDB4_LIBS) -lmonet \ - $(MONETDB4_MODS) -l_streams -l_builtin -l_ascii_io -} - -lib__xrpc_server = { +lib__xrpc = { DIR = libdir/MonetDB4 SOURCES = \ + xrpc_const.mx \ + xrpc_common.mx \ shttpd.c shttpd.h \ - xrpc_server.mx + xrpc_server.mx \ + xrpc_client.mx LIBS = \ - libxrpc_common \ - ./lib_pf_support ./lib_pathfinder \ + libserialize ./lib_pf_support ./lib_pathfinder \ $(PF_LIBS) $(SOCKET_LIBS) \ $(MONETDB_LIBS) -lbat -lstream $(MONETDB4_LIBS) -lmonet $(PTHREAD_LIBS) \ $(MONETDB4_MODS) -l_mapi -l_streams -l_builtin -l_ascii_io
U xrpc_server.mx Index: xrpc_server.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- xrpc_server.mx 17 Jul 2008 15:54:23 -0000 1.80 +++ xrpc_server.mx 17 Jul 2008 16:42:39 -0000 1.81 @@ -177,6 +177,7 @@ #include "serialize.h" #include "shttpd.h" #include "xrpc_common.h" +#include "xrpc_const.h"
static int rpcd_running = 0; static int timing = 0;
--- NEW FILE: xrpc_const.mx --- @' Copyright Notice: @' ----------------- @' @' The contents of this file are subject to the Pathfinder Public License @' Version 1.1 (the "License"); you may not use this file except in @' compliance with the License. You may obtain a copy of the License at @' http://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html @' @' Software distributed under the License is distributed on an "AS IS" @' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See @' the License for the specific language governing rights and limitations @' under the License. @' @' The Original Code is the Pathfinder system. @' @' The Original Code has initially been developed by the Database & @' Information Systems Group at the University of Konstanz, Germany and @' is now maintained by the Database Systems Group at the Technische @' Universitaet Muenchen, Germany. Portions created by the University of @' Konstanz and the Technische Universitaet Muenchen are Copyright (C) @' 2000-2005 University of Konstanz and (C) 2005-2008 Technische @' Universitaet Muenchen, respectively. All Rights Reserved. @' @' $Id: xrpc_const.mx,v 1.1 2008/07/17 16:42:39 yingying Exp $ @f xrpc_const @a Ying Zhang @t Defines XRPC string constants
@h #ifndef XRPC_CONST_H #define XRPC_CONST_H
/* HTTP defines */ #define XRPC_DOC_CALLBACK "/xrpc/doc" #define XRPC_ADM_CALLBACK "/xrpc/admin" #define XRPC_WSAT_CALLBACK "/xrpc/wsat" #define XRPC_REQ_CALLBACK "/xrpc"
#define ERR403 "403 Forbidden" #define ERR404 "404 Bad Request" #define ERR408 "408 Request Timeout" #define ERR500 "500 Internal Server Error" #define ERR504 "504 Gateway Timeout"
#define OUT_OF_MEM "Internal Receiver Error: out-of memory" #define NOT_WELL_FORMED "Request XML message not well-formed" #define MAX_NR_PARAMS 1024
#define HTTP_200_OK\ "HTTP/1.1 200 OK\r\n"\ "Content-type: text/xml; charset=\"utf-8\"\r\n\r\n"
/* Namespaces */ #define MXQ_ADMIN "http://monetdb.cwi.nl/XQuery/admin/" #define SOAP_NS "http://www.w3.org/2003/05/soap-envelope" #define XDT_NS "http://www.w3.org/2005/xpath-datatypes" #define XS_NS "http://www.w3.org/2001/XMLSchema" #define XSI_NS "http://www.w3.org/2001/XMLSchema-instance" #define XRPC_NS "http://monetdb.cwi.nl/XQuery" #define XRPC_LOC "http://monetdb.cwi.nl/XQuery/XRPC.xsd" #define WSCOOR_NS "http://docs.oasis-open.org/ws-tx/wscoor/2006/06" #define WSAT_NS "http://docs.oasis-open.org/ws-tx/wsat/2006/06"
#define XRPC_REQ_QN XRPC_NS"|request" #define XRPC_RES_QN XRPC_NS"|response"
/* XRPC SOAP snippets */ #define SOAP_ENVELOPE\ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"\ "<env:Envelope\n"\ " xmlns:env=\"" SOAP_NS "\"\n"\ " xmlns:xrpc=\"" XRPC_NS "\"\n"\ " xmlns:xdt=\"" XDT_NS "\" \n"\ " xmlns:xs=\"" XS_NS "\"\n"\ " xmlns:xsi=\"" XSI_NS "\"\n"\ " xsi:schemaLocation=\"" XRPC_NS " " XRPC_LOC "\">\n"
#define XRPC_WS_QID\ " <xrpc:header xrpc:mode=\"%s\">\n"\ " <wscoor:CoordinationContext\n"\ " xmlns:wscoor=\""WSCOOR_NS"\"\n"\ " env:mustUnderstand=\"true\">\n"\ " <wscoor:Identifier>%s</wscoor:Identifier>\n"\ " <wscoor:Expires>"LLFMT"</wscoor:Expires>\n"\ " <wscoor:CoordinationType>" WSAT_NS "</wscoor:CoordinationType>\n"\ " </wscoor:CoordinationContext>\n"\ " </xrpc:header>\n"
#define XRPC_REQ_BODY_OPEN\ "<env:Body>\n"\ " <xrpc:request\n"\ " xrpc:module=\"%s\"\n"\ " xrpc:location=\"%s\"\n"\ " xrpc:method=\"%s\"\n"\ " xrpc:arity=\""LLFMT"\"\n"\ " xrpc:iter-count=\""LLFMT"\"\n"\ " xrpc:updCall=\"%s\"\n"\ " xrpc:caller=\"" #define XRPC_REQ_BODY\ XRPC_REQ_BODY_OPEN "%s:"LLFMT"\">\n" #define XRPC_REQ_BODY_FIRST_CALLER\ XRPC_REQ_BODY_OPEN "query\">\n"
#define XRPC_WSAT_REQ SOAP_ENVELOPE\ "<env:Header>"\ XRPC_WS_QID \ "</env:Header>\n"\ "<env:Body><wsat:%s/></env:Body>\n"\ "</env:Envelope>"
#define XRPC_WSAT_RES SOAP_ENVELOPE\ "<env:Header>\n"\ XRPC_WS_QID \ " <xrpc:partipant>%s,%s:%s:%s,"LLFMT",%d</xrpc:participant>\n"\ "</env:Header>\n"\ "<env:Body><wsat:%s/></env:Body>\n"\ "</env:Envelope>"
#define XRPC_RES_BODY\ "<env:Body>\n"\ " <xrpc:response\n"\ " xrpc:module=\"%s\"\n"\ " xrpc:method=\"%s\">\n"
#define XRPC_HTTP_CALL\ " <xrpc:call>"\ " <xrpc:sequence>"\ " <xrpc:atomic-value xsi:type=\"xs:string\">%s</xrpc:atomic-value>"\ " </xrpc:sequence>"\ " </xrpc:call>"
#define XRPC_PUT_CALL\ " <xrpc:call>"\ " <xrpc:sequence>"\ " <xrpc:atomic-value xsi:type=\"xs:string\">%s</xrpc:atomic-value>"\ " </xrpc:sequence>"\ " <xrpc:sequence>"\ " <xrpc:element>%s</xrpc:element>"\ " </xrpc:sequence>"\ " </xrpc:call>"
#define XRPC_REQ_FOOTER\ " </xrpc:request>\n"\ "</env:Body>\n"\ "</env:Envelope>"
#ifndef HOST_NAME_MAX #ifdef _POSIX_HOST_NAME_MAX #define HOST_NAME_MAX _POSIX_HOST_NAME_MAX #else #define HOST_NAME_MAX 255 #endif #endif
#endif /* XRPC_CONST_H */
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-pf-checkins mailing list Monetdb-pf-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |