Update of /cvsroot/monetdb/pathfinder/compiler
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13876/compiler
Modified Files:
compile.c
Log Message:
propagated changes of Sunday Feb 11 2007 - Tuesday Feb 20 2007
from the XQuery_0-16 branch to the development trunk
Index: compile.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/compile.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- compile.c 1 Feb 2007 12:55:50 -0000 1.101
+++ compile.c 20 Feb 2007 12:06:51 -0000 1.102
@@ -185,6 +185,7 @@
} urlcache_t;
urlcache_t *urlcache = NULL;
+int xrpc_port = 80;
/**
* read input file into the url cache
@@ -195,7 +196,33 @@
urlcache_t *cache = urlcache;
xmlParserInputBufferPtr buf;
char *ret, url[1024];
- strncpy(url, uri, 1024);
+
+ /* support for the xrpc://x.y.z/URI naming scheme (maps to
http://x.y.z:<xrpc_port>[/xrpc]/URI) */
+ if (strncmp(uri, "xrpc://", 7) == 0) {
+ char *xrpc = "";
+ char *p = strchr(uri+7, '/');
+ char *q = strchr(uri+7, ':');
+ int port = xrpc_port;
+ if (p) {
+ char *suffix = p + strlen(p) - 4;
+ if (suffix > p && !(strcmp(suffix,".xml") &&
strcmp(suffix,".XML"))) {
+ /* GET requests on XML get magically mapped on fn:doc(). Add
xrpc/ to URI. */
+ xrpc = "/xrpc";
+ } /* else: request is simply redirected to xrpc HTTP server
(file serving) */
+ *p = 0;
+ }
+ if (q) {
+ /* if a specific port is omitted, we use the current xrpcd port
number */
+ port = atoi(q+1);
+ *q = 0;
+ }
+ snprintf(url, 1024, "http://%s:%d%s/%s", uri+7, port, xrpc,
p?(p+1):"");
+ if (p) *p = '/';
+ if (q) *q = ':';
+ } else {
+ strncpy(url, uri, 1024);
+ }
+
if (keep) {
int len = strlen(url);
/*
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins