[repo.or.cz] iwhd.git branch master updated: v0.0-145-g688f1ee
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0 (commit)
from d64add4185ab48f67c70dff941e0143aa72fe0ae (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0
commit 688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 17:07:25 2010 +0200
tests: exercise the parser
* t/Makefile.am: Add rules/code to generate parser.c and to
run the new test.
* t/parser-test: New file. I/O pairs from Jeff Darcy.
diff --git a/t/Makefile.am b/t/Makefile.am
index f68e661..8099177 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -15,13 +15,28 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TESTS = - basic
+ basic + parser-test
EXTRA_DIST = $(TESTS) init.cfg init.sh
+check_PROGRAMS = parser
+
+BUILT_SOURCES =
+BUILT_SOURCES += parser.c
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+parser_CPPFLAGS = -I $(top_srcdir)
+
+parser.c: Makefile.am
+ rm -f $@-t $@
+ printf '#define UNIT_TEST 1n' > $@-t
+ printf '#include "query.c"n' >> $@-t
+ chmod a=r $@-t
+ mv $@-t $@
+
TESTS_ENVIRONMENT = tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; TMPDIR=$$tmp__; export TMPDIR; diff --git a/t/parser-test b/t/parser-test
new file mode 100755
index 0000000..9d0a6c8
--- /dev/null
+++ b/t/parser-test
@@ -0,0 +1,36 @@
+#!/bin/sh
+# exercise the parser
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+
+cat <<EOF > f.exp || framework_failure_
+AND
+ COMPARISON
+ SERVER FIELD a (never)
+ STRING fubar
+ NOT
+ COMPARISON
+ LINK
+ LINK
+ OBJECT FIELD b (7)
+ DEST FIELD c
+ DEST FIELD d
+ NUMBER 3
+d= 0
+EOF
+
+parser '#a=="fubar"&&!($b.c.d<3)' > features 2> err || fail=1
+compare features f.exp
+compare /dev/null err
+
+parser '#a == "fubar" && ! ( $b.c.d < 3)' > white-space 2> err || fail=1
+compare white-space f.exp
+compare /dev/null err
+
+parser '$ a' > e1.out 2>&1; test $? = 1 || fail=1
+printf "could not parse '$ a'n" > e1.exp
+compare e1.exp e1.out
+
+parser '1 = = 1' > e2.out 2>&1; test $? = 1 || fail=1
+printf "could not parse '1 = = 1'n" > e2.exp
+compare e2.exp e2.out
-----------------------------------------------------------------------
Summary of changes:
t/Makefile.am | 17 ++++++++++++++++-
t/parser-test | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 1 deletions(-)
create mode 100755 t/parser-test
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-144-gd64add4
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via d64add4185ab48f67c70dff941e0143aa72fe0ae (commit)
from e914cb511e8785deef50a3c711d674ac056a697e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/d64add4185ab48f67c70dff941e0143aa72fe0ae
commit d64add4185ab48f67c70dff941e0143aa72fe0ae
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Tue Oct 5 14:23:58 2010 -0400
tests: exercise attributes
diff --git a/t/basic b/t/basic
index a7d3b1e..1adfff1 100644
--- a/t/basic
+++ b/t/basic
@@ -243,4 +243,29 @@ for i in xml json; do
done
+
+# Add a single attribute to an object using the PUT method.
+bucket=http://localhost:$port/b1
+printf nothing | curl -T - $bucket/f3 || fail=1
+printf blue | curl -T - $bucket/f3/color || fail=1
+test "$(curl $bucket/f3/color)" = blue || fail=1
+
+# Add multiple attributes to an object using the POST method.
+# NB use a file which doesn't yet exist (yes, this should work too)
+curl -d key=f4 -d shape=round -d size=big $bucket || fail=1
+test "$(curl $bucket/f4/shape)" = round || fail=1
+test "$(curl $bucket/f4/size)" = big || fail=1
+
+# Ensure that an attempt to add each reserved attribute fails.
+# FIXME: keep this list in sync with the one in rest.c:
+# grep '^static.*reserved_attr' rest.c
+for attr in bucket key date etag loc; do
+ printf whatever | curl -f -T - $bucket/f5/$attr 2> bad_attr.err
+ grep ' 400$' bad_attr.err || fail=1
+done
+
+# TBD: add attribute-delete tests when that functionality is implemented
+
+# TBD: add white-box tests for attributes in mongo
+
Exit $fail
-----------------------------------------------------------------------
Summary of changes:
t/basic | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-143-ge914cb5
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via e914cb511e8785deef50a3c711d674ac056a697e (commit)
from 2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/e914cb511e8785deef50a3c711d674ac056a697e
commit e914cb511e8785deef50a3c711d674ac056a697e
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 19:21:46 2010 +0200
fix bug just introduced in repl_worker
* proxy.c (repl_worker): Don't omit "item" parameter in
call to pthread_create. Introduced by me in commit aeb23797.
Spotted by Jeff Darcy.
diff --git a/proxy.c b/proxy.c
index fa25e54..cdcea5f 100644
--- a/proxy.c
+++ b/proxy.c
@@ -745,9 +745,9 @@ repl_worker_bcreate (repl_item *item)
}
/* Use this to diagnose failed thread creation. */
-#define xpthread_create(thread, start_routine, msg) +#define xpthread_create(thread, start_routine, item, msg) do { - int err = pthread_create (thread, NULL, start_routine, NULL); + int err = pthread_create (thread, NULL, start_routine, item); if (err) { error (0, err, msg); return NULL; @@ -777,9 +777,10 @@ repl_worker (void *notused ATTRIBUTE_UNUSED)
xpthread_create(&prod, (proxy_host
? proxy_repl_prod
: proxy_repl_prod_fs),
- "failed to start producer thread");
- xpthread_create(&cons,proxy_repl_cons,
- "failed to start consumer thread");
+ item,
+ "failed to start producer thread");
+ xpthread_create(&cons,proxy_repl_cons,item,
+ "failed to start consumer thread");
pthread_join(prod,NULL);
pthread_join(cons,NULL);
}
-----------------------------------------------------------------------
Summary of changes:
proxy.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-142-g2f781a5
by Jeff Darcy
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4 (commit)
via 5e4e136deec466074117525ba672618d2445dbe1 (commit)
from 4866f4e6b9f3c966170f349eb6db74d2ff2d1692 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4
commit 2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Mon Oct 4 13:30:01 2010 -0400
More basic tests.
Added some through-the-API result checking to cover metadata.
Added a duplicate-bucket test.
diff --git a/t/basic b/t/basic
index 7e77f94..a7d3b1e 100644
--- a/t/basic
+++ b/t/basic
@@ -134,14 +134,23 @@ wait_for .1 30 "curl -s http://localhost:$port" curl -X PUT http://localhost:$port/b1 || fail=1
test -d FS/b1 || fail=1
+# Try to create a duplicate bucket.
+curl -f -X PUT http://localhost:$port/b1 2> dup_bucket.err
+grep ' 500$' dup_bucket.err || fail=1
+
# PUT to root; should fail
curl -f -X PUT http://localhost:$port 2> root_put.err
-grep ' 404' root_put.err || fail=1
+grep ' 404$' root_put.err || fail=1
# Create a file in that bucket.
echo foo | curl -T - http://localhost:$port/b1/f1 || fail=1
+# Test presence in the FS.
test -f FS/b1/f1 || fail=1
test "$(cat FS/b1/f1)" = foo || fail=1
+# Test through the API as well.
+curl http://localhost:$port/b1/f1 > f1copy
+test "$(cat f1copy)" = foo || fail=1
+
# Get root; default, then Accept: XML & JSON:
curl http://localhost:$port > root || fail=1
@@ -153,12 +162,18 @@ compare root root.xml || fail=1
curl -H 'Accept: */json' http://localhost:$port > root || fail=1
compare root root.json || fail=1
-# Delete an object and ensure that it's gone from the file system.
+# Delete an object.
curl -X DELETE http://localhost:$port/b1/f1 || fail=1
+# Ensure that it's gone from the file system.
test -f FS/b1/f1 && fail=1
+# Ensure that it's gone in the API as well.
+curl -f http://localhost:$port/b1/f1 > /dev/null 2> del_object.err
+grep ' 404$' del_object.err || fail=1
# Try to delete a nonexistent object.
-curl -X DELETE http://localhost:$port/b1/no-such-obj || fail=1
+curl -f -X DELETE http://localhost:$port/b1/no-such-obj 2> del_nosuch.err
+grep ' 404$' del_nosuch.err || fail=1
+
# ################## Providers
http://repo.or.cz/w/iwhd.git/commit/5e4e136deec466074117525ba672618d2445dbe1
commit 5e4e136deec466074117525ba672618d2445dbe1
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Mon Oct 4 11:47:47 2010 -0400
Enhance tests.
Added failure check for "PUT to root" test.
Added "-s -S" to curl commands to kill silly progress bars.
Added rdbuf call in meta.cpp to silence C++ code.
diff --git a/meta.cpp b/meta.cpp
index d6ce8f7..bcbf2f7 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -120,6 +120,11 @@ RepoMeta::RepoMeta ()
{
char addr[128];
+ if (!verbose) {
+ cout.rdbuf(0);
+ cout << "bite me" << endl;
+ }
+
sprintf(addr,"%s:%u",db_host,db_port);
client.connect(addr);
}
diff --git a/t/basic b/t/basic
index c1aa5e4..7e77f94 100644
--- a/t/basic
+++ b/t/basic
@@ -129,12 +129,14 @@ cleanup_() { kill $mongo_pid $iwhd_pid; }
wait_for .1 30 "curl -s http://localhost:$port" || { echo iwhd failed to listen; Exit 1; }
+
# Create an empty bucket.
curl -X PUT http://localhost:$port/b1 || fail=1
test -d FS/b1 || fail=1
-# Post to root; should fail (but FIXME: how to detect failure?)
-curl -X PUT http://localhost:$port || fail=1
+# PUT to root; should fail
+curl -f -X PUT http://localhost:$port 2> root_put.err
+grep ' 404' root_put.err || fail=1
# Create a file in that bucket.
echo foo | curl -T - http://localhost:$port/b1/f1 || fail=1
diff --git a/t/init.cfg b/t/init.cfg
index f0301d4..863481a 100644
--- a/t/init.cfg
+++ b/t/init.cfg
@@ -6,7 +6,8 @@ stderr_fileno_=9
# Always use curl's -q option, so that a user's .rc settings
# cannot perturb these tests.
-curl() { env curl -q "$@"; }
+# Also add -s and -S to get rid of silly progress bars etc.
+curl() { env curl -q -s -S "$@"; }
wait_for()
{
-----------------------------------------------------------------------
Summary of changes:
meta.cpp | 5 +++++
t/basic | 25 +++++++++++++++++++++----
t/init.cfg | 3 ++-
3 files changed, 28 insertions(+), 5 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-140-g4866f4e
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 4866f4e6b9f3c966170f349eb6db74d2ff2d1692 (commit)
via aeb23797cf2e1e8ce6d57ec341235d48abb05e2f (commit)
from 64c29da2559a084d3ba74dcdaa03cbd0f4189dee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/4866f4e6b9f3c966170f349eb6db74d2ff2d1692
commit 4866f4e6b9f3c966170f349eb6db74d2ff2d1692
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 14:05:56 2010 +0200
build: GNUmakefile: new file, for better output from "make check"
This file is used only via GNU make.
For now, its main purpose is to ensure that VERBOSE=yes
is always set in the environment. That ensures more useful
output from "make check" and that automake-generated code
in Makefile prints more details upon failure.
A tiny bonus: you also get a diagnostic when
running "make" without a configure file.
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..1cb7735
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,21 @@
+# This makefile is used only if you run GNU Make.
+# It is necessary if you modify files in the m4/ directory or
+# want to build targets usually of interest only to the maintainer.
+
+have-Makefile := $(shell test -f Makefile && echo yes)
+
+# If the user runs GNU make but has not yet run ./configure,
+# give them a diagnostic.
+ifeq ($(have-Makefile),yes)
+
+export VERBOSE = yes
+include Makefile
+
+else
+
+all:
+ @echo There seems to be no Makefile in this directory.
+ @echo "You must run ./configure before running `make'."
+ @exit 1
+
+endif
http://repo.or.cz/w/iwhd.git/commit/aeb23797cf2e1e8ce6d57ec341235d48abb05e2f
commit aeb23797cf2e1e8ce6d57ec341235d48abb05e2f
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 08:02:00 2010 +0200
don't ignore failed thread creation
* proxy.c (xpthread_create): New macro.
(repl_worker): Use it to diagnose thread creation failure and to
propagate any failure to caller.
diff --git a/proxy.c b/proxy.c
index bf4c165..fa25e54 100644
--- a/proxy.c
+++ b/proxy.c
@@ -744,6 +744,16 @@ repl_worker_bcreate (repl_item *item)
DPRINTF("%s returningn",__func__);
}
+/* Use this to diagnose failed thread creation. */
+#define xpthread_create(thread, start_routine, msg) + do { + int err = pthread_create (thread, NULL, start_routine, NULL); + if (err) { + error (0, err, msg); + return NULL; + } + } while (0)
+
static void *
repl_worker (void *notused ATTRIBUTE_UNUSED)
{
@@ -764,15 +774,12 @@ repl_worker (void *notused ATTRIBUTE_UNUSED)
switch (item->type) {
case REPL_PUT:
if (pipe(item->pipes) >= 0) {
- if (proxy_host) {
- pthread_create(&prod,NULL,
- proxy_repl_prod,item);
- }
- else {
- pthread_create(&prod,NULL,
- proxy_repl_prod_fs,item);
- }
- pthread_create(&cons,NULL,proxy_repl_cons,item);
+ xpthread_create(&prod, (proxy_host
+ ? proxy_repl_prod
+ : proxy_repl_prod_fs),
+ "failed to start producer thread");
+ xpthread_create(&cons,proxy_repl_cons,
+ "failed to start consumer thread");
pthread_join(prod,NULL);
pthread_join(cons,NULL);
}
-----------------------------------------------------------------------
Summary of changes:
GNUmakefile | 21 +++++++++++++++++++++
proxy.c | 25 ++++++++++++++++---------
2 files changed, 37 insertions(+), 9 deletions(-)
create mode 100644 GNUmakefile
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-138-g64c29da
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 64c29da2559a084d3ba74dcdaa03cbd0f4189dee (commit)
via 6c2fe0153226238cdf342e13333cec65a2b769d0 (commit)
from 9b68844bac11d8d0737c74986ca6add744acd223 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/64c29da2559a084d3ba74dcdaa03cbd0f4189dee
commit 64c29da2559a084d3ba74dcdaa03cbd0f4189dee
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 07:44:29 2010 +0200
proxy.c: declare functions and file-scoped variables static
diff --git a/proxy.c b/proxy.c
index bfdde25..bf4c165 100644
--- a/proxy.c
+++ b/proxy.c
@@ -97,13 +97,13 @@ typedef struct {
json_t *cur_server;
} query_ctx_t;
-repl_item *queue_head = NULL;
-repl_item *queue_tail = NULL;
-pthread_mutex_t queue_lock;
-sem_t queue_sema;
-json_t *config = NULL;
+static repl_item *queue_head = NULL;
+static repl_item *queue_tail = NULL;
+static pthread_mutex_t queue_lock;
+static sem_t queue_sema;
+static json_t *config = NULL;
-int
+static int
validate_server (unsigned int i)
{
json_t *server;
@@ -265,8 +265,8 @@ err:
return 0;
}
-size_t
-junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t
+junk_writer (/* const */ void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t n;
@@ -280,7 +280,7 @@ junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
return n;
}
-void *
+static void *
proxy_repl_prod_fs (void *ctx)
{
repl_item *item = ctx;
@@ -336,7 +336,7 @@ proxy_repl_prod_fs (void *ctx)
return NULL;
}
-void *
+static void *
proxy_repl_prod (void *ctx)
{
repl_item *item = ctx;
@@ -400,7 +400,7 @@ done:
return NULL;
}
-size_t
+static size_t
junk_reader (void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t n;
@@ -410,14 +410,14 @@ junk_reader (void *ptr, size_t size, size_t nmemb, void *stream)
return n;
}
-size_t
+static size_t
cf_writer (void *ptr ATTRIBUTE_UNUSED, size_t size, size_t nmemb,
void *stream ATTRIBUTE_UNUSED)
{
return size * nmemb;
}
-size_t
+static size_t
cf_header (void *ptr, size_t size, size_t nmemb, void *stream)
{
char *next;
@@ -447,7 +447,7 @@ cf_header (void *ptr, size_t size, size_t nmemb, void *stream)
return size * nmemb;
}
-const char *
+static const char *
get_cloudfiles_token (json_t *server, const char *host, unsigned int port,
const char * user, const char * key)
{
@@ -498,7 +498,7 @@ get_cloudfiles_token (json_t *server, const char *host, unsigned int port,
return token_obj ? json_string_value(token_obj) : NULL;
}
-void *
+static void *
proxy_repl_cons (void *ctx)
{
repl_item *item = ctx;
@@ -626,7 +626,7 @@ proxy_repl_cons (void *ctx)
return NULL;
}
-void
+static void
repl_worker_del (const repl_item *item)
{
json_t *server;
@@ -686,7 +686,7 @@ repl_worker_del (const repl_item *item)
DPRINTF("%s returningn",__func__);
}
-void
+static void
repl_worker_bcreate (repl_item *item)
{
json_t *server;
@@ -744,7 +744,7 @@ repl_worker_bcreate (repl_item *item)
DPRINTF("%s returningn",__func__);
}
-void *
+static void *
repl_worker (void *notused ATTRIBUTE_UNUSED)
{
repl_item *item;
@@ -805,7 +805,7 @@ repl_init (void)
pthread_create(&tid,NULL,repl_worker,NULL);
}
-char *
+static char *
repl_oget (void *ctx, const char *id)
{
query_ctx_t *qctx = ctx;
@@ -816,7 +816,7 @@ repl_oget (void *ctx, const char *id)
return cur_value;
}
-char *
+static char *
repl_sget (void *ctx, const char *id)
{
query_ctx_t *qctx = ctx;
@@ -912,7 +912,7 @@ replicate (const char *url, size_t size, const char *policy)
free(url2);
}
-void
+static void
replicate_namespace_action (const char *name, repl_t action)
{
unsigned int i;
http://repo.or.cz/w/iwhd.git/commit/6c2fe0153226238cdf342e13333cec65a2b769d0
commit 6c2fe0153226238cdf342e13333cec65a2b769d0
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Oct 1 16:01:20 2010 +0200
don't ignore write failures
* proxy.c (junk_writer): Don't ignore fwrite failure.
Warn upon fwrite or fflush failure.
* rest.c (main): Don't ignore fflush failure.
Exit upon fflush or preceding printf failure.
diff --git a/proxy.c b/proxy.c
index e89b3df..bfdde25 100644
--- a/proxy.c
+++ b/proxy.c
@@ -271,7 +271,10 @@ junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
size_t n;
n = fwrite(ptr,size,nmemb,stream);
- fflush(stream);
+ if (n != nmemb)
+ error(0, 0, "warning: write failed");
+ if (fflush(stream))
+ error(0, 0, "warning: write failed");
DPRINTF("in %s(%zu,%zu) => %zun",__func__,size,nmemb,n);
return n;
diff --git a/rest.c b/rest.c
index c808d1a..f501674 100644
--- a/rest.c
+++ b/rest.c
@@ -1793,7 +1793,8 @@ args_done:
printf("db is at %s:%un",db_host,db_port);
printf("will listen on port %un",my_port);
printf("my location is "%s"n",me);
- fflush(stdout);
+ if (fflush(stdout) || ferror(stdout))
+ error(EXIT_FAILURE, 0, "write failed");
}
backend_init();
-----------------------------------------------------------------------
Summary of changes:
proxy.c | 47 +++++++++++++++++++++++++----------------------
rest.c | 3 ++-
2 files changed, 27 insertions(+), 23 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-136-g9b68844
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 9b68844bac11d8d0737c74986ca6add744acd223 (commit)
from dded28ea3564271e258d14014dd6089f2bfa7cda (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/9b68844bac11d8d0737c74986ca6add744acd223
commit 9b68844bac11d8d0737c74986ca6add744acd223
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Oct 1 19:57:52 2010 +0200
declare file-scoped globals "static"; use const, too
diff --git a/rest.c b/rest.c
index 8df596a..c808d1a 100644
--- a/rest.c
+++ b/rest.c
@@ -69,16 +69,16 @@ typedef struct {
MHD_AccessHandlerCallback handler;
} rule;
-int fs_mode = 0;
-unsigned short my_port = MY_PORT;
+static int fs_mode = 0;
+static unsigned short my_port = MY_PORT;
const char *program_name;
-char *(reserved_name[]) = { "_default", "_query", "_new", NULL };
-char *(reserved_attr[]) = { "bucket", "key", "date", "etag", "loc", NULL };
+static char *(reserved_name[]) = { "_default", "_query", "_new", NULL };
+static char *(reserved_attr[]) = { "bucket", "key", "date", "etag", "loc", NULL };
-backend_func_tbl *main_func_tbl = &bad_func_tbl;
+static backend_func_tbl *main_func_tbl = &bad_func_tbl;
-void
+static void
free_ms (my_state *ms)
{
if (ms->cleanup & CLEANUP_CURL) {
@@ -112,7 +112,7 @@ free_ms (my_state *ms)
free(ms);
}
-int
+static int
validate_put (struct MHD_Connection *conn)
{
const char *mhdr;
@@ -127,7 +127,7 @@ validate_put (struct MHD_Connection *conn)
return (mhdr && !strcmp(mhdr,"master"));
}
-int
+static int
is_reserved (char *cand, char **resv_list)
{
int i;
@@ -141,7 +141,7 @@ is_reserved (char *cand, char **resv_list)
return FALSE;
}
-int
+static int
validate_url (const char *url)
{
char *slash = rindex(url,'/');
@@ -185,7 +185,7 @@ validate_url (const char *url)
* introduces some of its own complexity so see below for that.
**********/
-void
+static void
simple_closer (void *ctx)
{
my_state *ms = ctx;
@@ -194,7 +194,7 @@ simple_closer (void *ctx)
free_ms(ms);
}
-void
+static void
child_closer (void * ctx)
{
pipe_private *pp = ctx;
@@ -205,7 +205,7 @@ child_closer (void * ctx)
}
/* Invoked from MHD. */
-int
+static int
proxy_get_cons (void *ctx, uint64_t pos, char *buf, int max)
{
pipe_private *pp = ctx;
@@ -254,7 +254,7 @@ proxy_get_cons (void *ctx, uint64_t pos, char *buf, int max)
return done;
}
-int
+static int
proxy_get_data (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -357,7 +357,7 @@ proxy_get_data (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-void
+static void
recheck_replication (my_state * ms, char *policy)
{
int rc;
@@ -404,7 +404,7 @@ recheck_replication (my_state * ms, char *policy)
}
}
-int
+static int
proxy_put_data (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -536,7 +536,7 @@ proxy_put_data (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
proxy_get_attr (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -572,7 +572,7 @@ proxy_get_attr (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
proxy_put_attr (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -680,7 +680,7 @@ proxy_put_attr (void *cctx, struct MHD_Connection *conn, const char *url,
* module to fetch one object name at a time.
**********/
-int
+static int
query_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data,
@@ -701,7 +701,7 @@ query_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
}
/* MHD reader function during queries. Return -1 for EOF. */
-int
+static int
proxy_query_func (void *ctx, uint64_t pos, char *buf, int max)
{
my_state *ms = ctx;
@@ -768,7 +768,7 @@ proxy_query_func (void *ctx, uint64_t pos, char *buf, int max)
return len;
}
-int
+static int
proxy_query (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -832,7 +832,7 @@ proxy_query (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
proxy_list_objs (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -863,7 +863,7 @@ proxy_list_objs (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
proxy_delete (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -912,16 +912,16 @@ typedef struct {
char *link;
} fake_bucket_t;
-fake_bucket_t fake_bucket_list[] = {
+static const fake_bucket_t fake_bucket_list[] = {
{ "bucket_factory", "_new" },
{ "provider_list", "_providers" },
};
-int
+static int
root_blob_generator (void *ctx, uint64_t pos, char *buf, int max)
{
my_state *ms = ctx;
- fake_bucket_t * fb;
+ const fake_bucket_t *fb;
int len;
const char *accept_hdr;
const char *host;
@@ -995,7 +995,7 @@ root_blob_generator (void *ctx, uint64_t pos, char *buf, int max)
return len;
}
-int
+static int
proxy_api_root (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1030,7 +1030,7 @@ proxy_api_root (void *cctx, struct MHD_Connection *conn, const char *url,
}
-int
+static int
post_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data,
@@ -1075,7 +1075,7 @@ post_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
}
/* Returns TRUE if we found an *invalid* key. */
-gboolean
+static gboolean
post_find (gpointer key, gpointer value, gpointer ctx)
{
(void)value;
@@ -1089,7 +1089,7 @@ post_find (gpointer key, gpointer value, gpointer ctx)
return TRUE;
}
-void
+static void
post_foreach (gpointer key, gpointer value, gpointer ctx)
{
my_state *ms = ctx;
@@ -1099,7 +1099,7 @@ post_foreach (gpointer key, gpointer value, gpointer ctx)
meta_set_value(ms->bucket,ms->key,key,value);
}
-int
+static int
create_bucket (char *name)
{
int rc;
@@ -1131,7 +1131,7 @@ create_bucket (char *name)
return rc;
}
-int
+static int
proxy_bucket_post (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1196,7 +1196,7 @@ proxy_bucket_post (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
check_location (my_state *ms)
{
char *loc = g_hash_table_lookup(ms->dict,"depot");
@@ -1216,7 +1216,7 @@ check_location (my_state *ms)
return MHD_HTTP_OK;
}
-int
+static int
register_image (my_state *ms)
{
char *site;
@@ -1246,7 +1246,7 @@ register_image (my_state *ms)
return MHD_HTTP_BAD_REQUEST;
}
-int
+static int
proxy_object_post (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1316,7 +1316,7 @@ proxy_object_post (void *cctx, struct MHD_Connection *conn, const char *url,
}
-int
+static int
prov_list_generator (void *ctx, uint64_t pos, char *buf, int max)
{
my_state *ms = ctx;
@@ -1377,7 +1377,7 @@ prov_list_generator (void *ctx, uint64_t pos, char *buf, int max)
return len;
}
-int
+static int
proxy_list_provs (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1405,7 +1405,7 @@ proxy_list_provs (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
prov_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data,
@@ -1423,7 +1423,7 @@ prov_iterator (void *ctx, enum MHD_ValueKind kind, const char *key,
}
-int
+static int
proxy_update_prov (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1478,7 +1478,7 @@ proxy_update_prov (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-int
+static int
proxy_create_bucket (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1509,7 +1509,7 @@ proxy_create_bucket (void *cctx, struct MHD_Connection *conn, const char *url,
return MHD_YES;
}
-rule my_rules[] = {
+static const rule my_rules[] = {
{ /* get bucket list */
"GET", URL_ROOT, proxy_api_root },
{ /* get object list */
@@ -1541,7 +1541,7 @@ rule my_rules[] = {
{ NULL, 0, NULL }
};
-url_type
+static url_type
parse_url (const char *url, my_state *ms)
{
unsigned short esize;
@@ -1594,7 +1594,7 @@ parse_url (const char *url, my_state *ms)
return eindex;
}
-int
+static int
access_handler (void *cctx, struct MHD_Connection *conn, const char *url,
const char *method, const char *version, const char *data,
size_t *data_size, void **rctx)
@@ -1663,7 +1663,7 @@ enum
GETOPT_VERSION_CHAR = (CHAR_MIN - 3)
};
-struct option my_options[] = {
+static const struct option my_options[] = {
{ "config", required_argument, NULL, 'c' },
{ "db", required_argument, NULL, 'd' },
{ "master", required_argument, NULL, 'm' },
@@ -1674,7 +1674,7 @@ struct option my_options[] = {
{ NULL, 0, NULL, '0' }
};
-void
+static void
usage (int status)
{
if (status != EXIT_SUCCESS)
diff --git a/state_defs.h b/state_defs.h
index 5d690e0..b805bb8 100644
--- a/state_defs.h
+++ b/state_defs.h
@@ -67,7 +67,4 @@ typedef struct {
#define CLEANUP_TMPL 0x20
#define CLEANUP_URL 0x40
-
-void free_ms (my_state *ms);
-
#endif
diff --git a/template.c b/template.c
index 6deba4b..37d8ac9 100644
--- a/template.c
+++ b/template.c
@@ -20,25 +20,25 @@
#include <string.h>
#include "template.h"
-char xml_root_header[] = "+static const char xml_root_header[] = " <api service="%s" version="%s"> ";
-char xml_root_entry[] = "+static const char xml_root_entry[] = " n <link rel="%s" href="http://%s/%s"/> ";
-char xml_root_footer[] = "+static const char xml_root_footer[] = " n </api>n ";
-char xml_prov_header[] = "+static const char xml_prov_header[] = " <providers> ";
-char xml_prov_entry[] = "+static const char xml_prov_entry[] = " n <provider name="%s">n <type>%s</type>n@@ -49,16 +49,16 @@ char xml_prov_entry[] = " </provider> ";
-char xml_prov_footer[] = "+static const char xml_prov_footer[] = " n </providers>n ";
-char xml_obj_header[] = "+static const char xml_obj_header[] = " <objects> ";
-char xml_obj_entry[] = "+static const char xml_obj_entry[] = " n <object>n <bucket>%s</bucket>n@@ -66,7 +66,7 @@ char xml_obj_entry[] = " </object> ";
-char xml_obj_footer[] = "+static const char xml_obj_footer[] = " n </objects>n ";
@@ -85,14 +85,14 @@ tmpl_format_t xml_format = {
.z_offset = 0
};
-char json_root_header[] = "+static const char json_root_header[] = " {n "service": "%s",n "version": "%s",n [ ";
-char json_root_entry[] = "+static const char json_root_entry[] = " ,n {n "rel": "%s",n@@ -100,17 +100,17 @@ char json_root_entry[] = " } ";
-char json_root_footer[] = "+static const char json_root_footer[] = " n ]n }n ";
-char json_prov_header[] = "+static const char json_prov_header[] = " [ ";
-char json_prov_entry[] = "+static const char json_prov_entry[] = " ,n {n "name": "%s",n@@ -122,16 +122,16 @@ char json_prov_entry[] = " } ";
-char json_prov_footer[] = "+static const char json_prov_footer[] = " n ]n ";
-char json_obj_header[] = "+static const char json_obj_header[] = " [ ";
-char json_obj_entry[] = "+static const char json_obj_entry[] = " ,n {n "bucket": "%s",n@@ -139,7 +139,7 @@ char json_obj_entry[] = " } ";
-char json_obj_footer[] = "+static const char json_obj_footer[] = " n ]n ";
diff --git a/template.h b/template.h
index a4971a2..1bfdfb7 100644
--- a/template.h
+++ b/template.h
@@ -19,16 +19,16 @@
#define TMPL_BUF_SIZE 1024
typedef struct {
- char *root_header;
- char *root_entry;
- char *root_footer;
- char *prov_header;
- char *prov_entry;
- char *prov_footer;
- char *obj_header;
- char *obj_entry;
- char *obj_footer;
- int z_offset; /* offset to use when index is zero */
+ const char *root_header;
+ const char *root_entry;
+ const char *root_footer;
+ const char *prov_header;
+ const char *prov_entry;
+ const char *prov_footer;
+ const char *obj_header;
+ const char *obj_entry;
+ const char *obj_footer;
+ int z_offset; /* offset to use when index is zero */
} tmpl_format_t;
typedef struct {
@@ -36,7 +36,7 @@ typedef struct {
const char *base;
unsigned int index;
char raw_buf[TMPL_BUF_SIZE];
- char *buf;
+ const char *buf;
} tmpl_ctx_t;
#define TMPL_CTX_DONE ((tmpl_ctx_t *)(-1))
-----------------------------------------------------------------------
Summary of changes:
rest.c | 88 +++++++++++++++++++++++++++++-----------------------------
state_defs.h | 3 --
template.c | 36 ++++++++++++------------
template.h | 22 +++++++-------
4 files changed, 73 insertions(+), 76 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-135-gdded28e
by Jeff Darcy
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via dded28ea3564271e258d14014dd6089f2bfa7cda (commit)
via b49e121de992338353ccb8427b3e557ef73603cc (commit)
via 89c0b8cace3fe481792e1380e620ac68b060963a (commit)
from 69e5866ad141e535969075fccabcd73f2598a721 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/dded28ea3564271e258d14014dd6089f2bfa7cda
commit dded28ea3564271e258d14014dd6089f2bfa7cda
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Fri Oct 1 13:04:44 2010 -0400
Fix various issues in policy syntax.
Made AND/OR properly associative/recursive.
Gave NOT lower precedence than comparisons.
Simplified field/link_field parsing.
Generally improved whitespace handling.
Updated diff to match other changes.
diff --git a/query.c.diff b/query.c.diff
index 8a882bc..22b8f7e 100644
--- a/query.c.diff
+++ b/query.c.diff
@@ -1,6 +1,6 @@
---- query-orig.c 2010-09-23 16:19:31.543661275 +0200
-+++ query.c 2010-09-23 16:19:31.547897591 +0200
-@@ -537,7 +537,7 @@ YY_LOCAL(int) yyrefill(void)
+--- query-orig.c 2010-10-01 12:56:20.000000000 -0400
++++ query.c 2010-10-01 12:56:20.000000000 -0400
+@@ -538,7 +538,7 @@ YY_LOCAL(int) yyrefill(void)
while (yybuflen - yypos < 512)
{
yybuflen *= 2;
@@ -9,7 +9,7 @@
}
YY_INPUT((yybuf + yypos), yyn, (yybuflen - yypos));
if (!yyn) return 0;
-@@ -602,7 +602,7 @@ YY_LOCAL(void) yyDo(yyaction action, int
+@@ -603,7 +603,7 @@ YY_LOCAL(void) yyDo(yyaction action, int
while (yythunkpos >= yythunkslen)
{
yythunkslen *= 2;
@@ -18,7 +18,7 @@
}
yythunks[yythunkpos].begin= begin;
yythunks[yythunkpos].end= end;
-@@ -620,7 +620,7 @@ YY_LOCAL(int) yyText(int begin, int end)
+@@ -621,7 +621,7 @@ YY_LOCAL(int) yyText(int begin, int end)
while (yytextlen < (yyleng - 1))
{
yytextlen *= 2;
@@ -27,7 +27,7 @@
}
memcpy(yytext, yybuf + begin, yyleng);
}
-@@ -1154,13 +1154,13 @@ YY_PARSE(int) YYPARSEFROM(yyrule yystart
+@@ -1159,13 +1159,13 @@ YY_PARSE(int) YYPARSEFROM(yyrule yystart
if (!yybuflen)
{
yybuflen= 1024;
diff --git a/query.leg b/query.leg
index 4a47943..d04429f 100644
--- a/query.leg
+++ b/query.leg
@@ -361,7 +361,8 @@ _print_value (const value_t *v, int level)
case T_LINK:
printf("%*sLINKn",level,"");
_print_value(v->as_tree.left,level+2);
- printf("%*sDEST FIELD%sn",level+2,"",(char *)v->as_tree.right);
+ printf("%*sDEST FIELD %sn",level+2,"",
+ (char *)v->as_tree.right);
break;
default:
printf("%*sUNKNOWN %dn",level,"",v->type);
@@ -463,32 +464,31 @@ eval (const value_t *v, getter_t *oget, getter_t *sget)
Stmt = - BoolExpr - EOL { *cur_expr = $$; }
| ( !EOL . )* EOL
-BoolExpr = l:CompExpr (
- ( - AND - r:CompExpr )
+BoolExpr = l:NotExpr
+ ( ( - AND - r:NotExpr )
{ $$ = l = make_tree(T_AND,l,r); }
- ( - OR - r:CompExpr )
- { $$ = l = make_tree(T_OR,l,r); }
-)* -
+ | ( - OR - r:NotExpr )
+ { $$ = l = make_tree(T_OR,l,r); } )*
-CompExpr = l:Unary
- ( ( - LESS - r:Unary { $$ = make_comp(C_LESSTHAN,l,r); } )
- | ( - LESS EQUAL - r:Unary { $$ = make_comp(C_LESSOREQ,l,r); } )
- | ( - EQUAL EQUAL - r:Unary { $$ = make_comp(C_EQUAL,l,r); } )
- | ( - NOT EQUAL - r:Unary { $$ = make_comp(C_DIFFERENT,l,r); } )
- | ( - GREATER EQUAL - r:Unary { $$ = make_comp(C_GREATEROREQ,l,r); } )
- | ( - GREATER - r:Unary { $$ = make_comp(C_GREATERTHAN,l,r); } ) )? -
+NotExpr = CompExpr -
+ | NOT - e:CompExpr - { $$ = make_tree(T_NOT,e,NULL); }
-Unary = Atom -
- | NOT - e:Unary - { $$ = make_tree(T_NOT,e,NULL); }
+CompExpr = l:Atom
+ ( ( - LESS - r:Atom { $$ = make_comp(C_LESSTHAN,l,r); } )
+ | ( - LESS EQUAL - r:Atom { $$ = make_comp(C_LESSOREQ,l,r); } )
+ | ( - EQUAL EQUAL - r:Atom { $$ = make_comp(C_EQUAL,l,r); } )
+ | ( - NOT EQUAL - r:Atom { $$ = make_comp(C_DIFFERENT,l,r); } )
+ | ( - GREATER EQUAL - r:Atom { $$ = make_comp(C_GREATEROREQ,l,r); } )
+ | ( - GREATER - r:Atom { $$ = make_comp(C_GREATERTHAN,l,r); } ) )?
-Atom = ( Literal | LinkField | ParenExpr ) -
+Atom = ( Literal | LinkField | ParenExpr )
Literal = NUMBER | STRING | TIME
-LinkField = f:Field ( DOT i:ID { $$ = f = make_link(f,i); } )* -
+LinkField = f:Field ( DOT i:ID { $$ = f = make_link(f,i); } )*
-Field = DOLLAR i:ID - { $$ = make_string((char *)i,T_OFIELD); }
- | WAFFLE i:ID - { $$ = make_string((char *)i,T_SFIELD); }
+Field = DOLLAR i:ID { $$ = make_string((char *)i,T_OFIELD); }
+ | WAFFLE i:ID { $$ = make_string((char *)i,T_SFIELD); }
ParenExpr = OPEN - v:BoolExpr - CLOSE - { $$ = v; }
http://repo.or.cz/w/iwhd.git/commit/b49e121de992338353ccb8427b3e557ef73603cc
commit b49e121de992338353ccb8427b3e557ef73603cc
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Fri Oct 1 12:11:23 2010 -0400
Fix memory leak, uninit var, syntax
Another ms leak in proxy_get_attr
Uninitialized variable in repl_oget
Whitespace issues in policy syntax
diff --git a/proxy.c b/proxy.c
index 270928d..e89b3df 100644
--- a/proxy.c
+++ b/proxy.c
@@ -806,7 +806,7 @@ char *
repl_oget (void *ctx, const char *id)
{
query_ctx_t *qctx = ctx;
- char *cur_value;
+ char *cur_value = NULL;
(void)meta_get_value(qctx->cur_bucket,qctx->cur_key,id,&cur_value);
diff --git a/query.leg b/query.leg
index d950aa2..4a47943 100644
--- a/query.leg
+++ b/query.leg
@@ -471,12 +471,12 @@ BoolExpr = l:CompExpr (
)* -
CompExpr = l:Unary
- ( ( LESS - r:Unary { $$ = make_comp(C_LESSTHAN,l,r); } )
- | ( LESS EQUAL - r:Unary { $$ = make_comp(C_LESSOREQ,l,r); } )
- | ( EQUAL EQUAL - r:Unary { $$ = make_comp(C_EQUAL,l,r); } )
- | ( NOT EQUAL - r:Unary { $$ = make_comp(C_DIFFERENT,l,r); } )
- | ( GREATER EQUAL - r:Unary { $$ = make_comp(C_GREATEROREQ,l,r); } )
- | ( GREATER - r:Unary { $$ = make_comp(C_GREATERTHAN,l,r); } ) )? -
+ ( ( - LESS - r:Unary { $$ = make_comp(C_LESSTHAN,l,r); } )
+ | ( - LESS EQUAL - r:Unary { $$ = make_comp(C_LESSOREQ,l,r); } )
+ | ( - EQUAL EQUAL - r:Unary { $$ = make_comp(C_EQUAL,l,r); } )
+ | ( - NOT EQUAL - r:Unary { $$ = make_comp(C_DIFFERENT,l,r); } )
+ | ( - GREATER EQUAL - r:Unary { $$ = make_comp(C_GREATEROREQ,l,r); } )
+ | ( - GREATER - r:Unary { $$ = make_comp(C_GREATERTHAN,l,r); } ) )? -
Unary = Atom -
| NOT - e:Unary - { $$ = make_tree(T_NOT,e,NULL); }
@@ -490,7 +490,7 @@ LinkField = f:Field ( DOT i:ID { $$ = f = make_link(f,i); } )* -
Field = DOLLAR i:ID - { $$ = make_string((char *)i,T_OFIELD); }
| WAFFLE i:ID - { $$ = make_string((char *)i,T_SFIELD); }
-ParenExpr = OPEN v:BoolExpr CLOSE - { $$ = v; }
+ParenExpr = OPEN - v:BoolExpr - CLOSE - { $$ = v; }
NUMBER = < [0-9]+ > { $$ = make_number(yytext); }
STRING = '"' < [^"]* > '"' { $$ = make_string(yytext,T_STRING); }
diff --git a/rest.c b/rest.c
index 6db9a04..8df596a 100644
--- a/rest.c
+++ b/rest.c
@@ -568,6 +568,7 @@ proxy_get_attr (void *cctx, struct MHD_Connection *conn, const char *url,
MHD_queue_response(conn,rc,resp);
MHD_destroy_response(resp);
+ free_ms(ms);
return MHD_YES;
}
http://repo.or.cz/w/iwhd.git/commit/89c0b8cace3fe481792e1380e620ac68b060963a
commit 89c0b8cace3fe481792e1380e620ac68b060963a
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Fri Oct 1 12:08:31 2010 -0400
New version reflecting current reality/terminology/etc.
diff --git a/doc/image_repo.odt b/doc/image_repo.odt
index 1264942..b77f1f8 100644
Binary files a/doc/image_repo.odt and b/doc/image_repo.odt differ
-----------------------------------------------------------------------
Summary of changes:
doc/image_repo.odt | Bin 22353 -> 24309 bytes
proxy.c | 2 +-
query.c.diff | 12 ++++++------
query.leg | 40 ++++++++++++++++++++--------------------
rest.c | 1 +
5 files changed, 28 insertions(+), 27 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-132-g69e5866
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 69e5866ad141e535969075fccabcd73f2598a721 (commit)
via 08ea30e37e29169d6b0ab9a1395d54262f3319af (commit)
from 4b78090d0043367ed7a408aa3f04615c4700f12a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/69e5866ad141e535969075fccabcd73f2598a721
commit 69e5866ad141e535969075fccabcd73f2598a721
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Oct 1 19:05:25 2010 +0200
maint: adjust copyright on most files: Red Hat, not FSF
diff --git a/Makefile.am b/Makefile.am
index 20f941e..19fb253 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/backend.c b/backend.c
index 25c2814..e1009db 100644
--- a/backend.c
+++ b/backend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/backend.h b/backend.h
index 97dbcf2..862a10b 100644
--- a/backend.h
+++ b/backend.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/configure.ac b/configure.ac
index 59d76fe..bd0609b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1991, 1993-2010 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1993-2010 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/dc-register-image b/dc-register-image
index 2a18cda..585c40d 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/iwh.h b/iwh.h
index 05c0586..091c3c0 100644
--- a/iwh.h
+++ b/iwh.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/meta.cpp b/meta.cpp
index 9e05da7..d6ce8f7 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/meta.h b/meta.h
index f22f697..8962b26 100644
--- a/meta.h
+++ b/meta.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mpipe.c b/mpipe.c
index 4525e27..28bce3b 100644
--- a/mpipe.c
+++ b/mpipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mpipe.h b/mpipe.h
index 818d760..e5103a0 100644
--- a/mpipe.h
+++ b/mpipe.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/proxy.c b/proxy.c
index b2f3a6b..270928d 100644
--- a/proxy.c
+++ b/proxy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/proxy.h b/proxy.h
index 3004758..f44e884 100644
--- a/proxy.h
+++ b/proxy.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/query.h b/query.h
index 1b2ea72..20a27c9 100644
--- a/query.h
+++ b/query.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/query.leg b/query.leg
index 4dda56b..d950aa2 100644
--- a/query.leg
+++ b/query.leg
@@ -1,5 +1,5 @@
%{
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/rest.c b/rest.c
index 5f06395..6db9a04 100644
--- a/rest.c
+++ b/rest.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/state_defs.h b/state_defs.h
index 6f865fc..5d690e0 100644
--- a/state_defs.h
+++ b/state_defs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/t/Makefile.am b/t/Makefile.am
index 239d635..f68e661 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -1,5 +1,5 @@
## Process this file with automake to create Makefile.in
-# Copyright 2010 Free Software Foundation, Inc.
+# Copyright 2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/template.c b/template.c
index e9809b6..6deba4b 100644
--- a/template.c
+++ b/template.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/template.h b/template.h
index 0848362..a4971a2 100644
--- a/template.h
+++ b/template.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
http://repo.or.cz/w/iwhd.git/commit/08ea30e37e29169d6b0ab9a1395d54262f3319af
commit 08ea30e37e29169d6b0ab9a1395d54262f3319af
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Oct 1 18:51:00 2010 +0200
boiler-plate README files
diff --git a/README-hacking b/README-hacking
new file mode 100644
index 0000000..007b2a1
--- /dev/null
+++ b/README-hacking
@@ -0,0 +1,106 @@
+-*- outline -*-
+
+These notes intend to help people working on the checked-out sources.
+These requirements do not apply when building from a distribution tarball.
+
+* Requirements
+
+We've opted to keep only the highest-level sources in the GIT repository.
+This eases our maintenance burden, (fewer merges etc.), but imposes more
+requirements on anyone wishing to build from the just-checked-out sources.
+Note the requirements to build the released archive are much less and
+are just the requirements of the standard ./configure && make procedure.
+Specific development tools and versions will be checked for and listed by
+the bootstrap script. See README-prereq for specific notes on obtaining
+these prerequisite tools.
+
+Valgrind <http://valgrind.org/> is also highly recommended, if
+Valgrind supports your architecture. See also README-valgrind.
+
+While building from a just-cloned source tree may require installing a
+few prerequisites, later, a plain `git pull && make' should be sufficient.
+
+* First GIT checkout
+
+You can get a copy of the source repository like this:
+
+ $ git clone git://repo.or.cz/iwhd.git
+ $ cd iwhd
+
+As an optional step, if you already have a copy of the gnulib git
+repository on your hard drive, then you can use it as a reference to
+reduce download time and disk space requirements:
+
+ $ export GNULIB_SRCDIR=/path/to/gnulib
+
+The next step is to get and check other files needed to build,
+which are extracted from other source packages:
+
+ $ ./bootstrap
+
+To use the most-recent gnulib (as opposed to the gnulib version that
+the package last synchronized to), do this next:
+
+ $ git submodule foreach git pull origin master
+ $ git commit -m 'build: update gnulib submodule to latest' gnulib
+
+And there you are! Just
+
+ $ ./configure --quiet #[--enable-gcc-warnings] [*]
+ $ make
+ $ make check
+
+At this point, there should be no difference between your local copy,
+and the GIT master copy:
+
+ $ git diff
+
+should output no difference.
+
+Enjoy!
+
+[*] The --enable-gcc-warnings option is useful only with glibc
+and with a very recent version of gcc. You'll probably also have
+to use recent system headers. If you configure with this option,
+and spot a problem, please be sure to send the report to the bug
+reporting address of this package, and not to that of gnulib, even
+if the problem seems to originate in a gnulib-provided file.
+
+* Submitting patches
+
+If you develop a fix or a new feature, please send it to the
+appropriate bug-reporting address as reported by the --help option of
+each program. One way to do this is to use vc-dwim
+<http://www.gnu.org/software/vc-dwim/>), as follows.
+
+ Run the command "vc-dwim --help", copy its definition of the
+ "git-changelog-symlink-init" function into your shell, and then run
+ this function at the top-level directory of the package.
+
+ Edit the ChangeLog file that this command creates, creating a
+ properly-formatted entry according to the GNU coding standards
+ <http://www.gnu.org/prep/standards/html_node/Change-Logs.html>.
+
+ Run the command "vc-dwim" and make sure its output looks good.
+
+ Run "vc-dwim --commit".
+
+ Run the command "git format-patch --stdout -1", and email its output
+ in, using the output's subject line.
+
+-----
+
+Copyright (C) 2002-2010 Free Software Foundation, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/README-prereq b/README-prereq
new file mode 100644
index 0000000..ec9b141
--- /dev/null
+++ b/README-prereq
@@ -0,0 +1,47 @@
+This gives some notes on obtaining the tools required for development.
+I.E. the tools checked for by the bootstrap script and include:
+
+- Autoconf <http://www.gnu.org/software/autoconf/>
+- Automake <http://www.gnu.org/software/automake/>
+- Bison <http://www.gnu.org/software/bison/>
+- Gettext <http://www.gnu.org/software/gettext/>
+- Git <http://git.or.cz/>
+- Gperf <http://www.gnu.org/software/gperf/>
+- Gzip <http://www.gnu.org/software/gzip/>
+- Rsync <http://samba.anu.edu.au/rsync/>
+- Tar <http://www.gnu.org/software/tar/>
+
+Note please try to install/build official packages for your system.
+If these programs are not available use the following instructions
+to build them and install the results into a directory that you will
+then use when building this package.
+
+Even if the official version of a package for your system is too old,
+please install it, as it may be required to build the newer versions.
+The examples below install into $HOME/coreutils/deps/, so if you are
+going to follow these instructions, first ensure that your $PATH is
+set correctly by running this command:
+
+ prefix=$HOME/coreutils/deps
+ export PATH=$prefix/bin:$PATH
+
+* autoconf *
+
+ # Note Autoconf 2.62 or newer is needed to build automake-1.11.1
+ git clone --depth=1 git://git.sv.gnu.org/autoconf.git
+ git checkout v2.62
+ autoreconf -vi
+ ./configure --prefix=$prefix
+ make install
+
+* automake *
+
+ # Note help2man is required to build automake fully
+ git clone git://git.sv.gnu.org/automake.git
+ cd automake
+ git checkout v1.11.1
+ ./bootstrap
+ ./configure --prefix=$prefix
+ make install
+
+Now you can build this package as described in README-hacking.
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 2 +-
README-hacking | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
README-prereq | 47 +++++++++++++++++++++++
backend.c | 2 +-
backend.h | 2 +-
configure.ac | 2 +-
dc-register-image | 2 +-
iwh.h | 2 +-
meta.cpp | 2 +-
meta.h | 2 +-
mpipe.c | 2 +-
mpipe.h | 2 +-
proxy.c | 2 +-
proxy.h | 2 +-
query.h | 2 +-
query.leg | 2 +-
rest.c | 2 +-
state_defs.h | 2 +-
t/Makefile.am | 2 +-
template.c | 2 +-
template.h | 2 +-
21 files changed, 172 insertions(+), 19 deletions(-)
create mode 100644 README-hacking
create mode 100644 README-prereq
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months
[repo.or.cz] iwhd.git branch master updated: v0.0-130-g4b78090
by Jim Meyering
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 4b78090d0043367ed7a408aa3f04615c4700f12a (commit)
via a2bb964aed893e8d4e86fe165244352b2a1746c2 (commit)
via 8a480375b7d4a48ea3c3d76b6a2b8eb6b202e3ab (commit)
from 94932e139d8d58cab65114d340dcf0c201eab125 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/4b78090d0043367ed7a408aa3f04615c4700f12a
commit 4b78090d0043367ed7a408aa3f04615c4700f12a
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Sep 30 13:58:27 2010 +0200
maint: remove empty/unused ChangeLog file
diff --git a/.gitignore b/.gitignore
index e1f85df..e032047 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
*~
.#*
.deps
+ChangeLog
Makefile
Makefile.in
#*#
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index e69de29..0000000
diff --git a/autogen.sh b/autogen.sh
index 90e6c05..5f55a4b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,3 +1,4 @@
#!/bin/bash
-autoreconf -i
+test -f ChangeLog || touch ChangeLog
+autoreconf -iv
http://repo.or.cz/w/iwhd.git/commit/a2bb964aed893e8d4e86fe165244352b2a1746c2
commit a2bb964aed893e8d4e86fe165244352b2a1746c2
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Sep 29 22:26:22 2010 +0200
tests: add more
diff --git a/t/basic b/t/basic
index bd44a03..c1aa5e4 100644
--- a/t/basic
+++ b/t/basic
@@ -80,6 +80,44 @@ emit_provider()
fi
}
+emit_bucket_list()
+{
+ local xml_or_json=$1
+ case $xml_or_json in xml|json);;
+ *) echo "invalid xml_or_json $xml_or_json" 1>&2; exit 1;; esac
+ shift
+
+ local i b k
+ if test $xml_or_json = xml; then
+ printf '<objects>n'
+ for i in "$@"; do
+ b=$(echo "$i"|sed 's/:.*//')
+ k=$(echo "$i"|sed 's/.*://')
+ printf +'t<object>
+tt<bucket>%s</bucket>
+tt<key>%s</key>
+t</object>
+' $b $k
+ done
+ printf '</objects>n'
+ else
+ printf '[n'
+ for i in "$@"; do
+ b=$(echo "$i"|sed 's/:.*//')
+ k=$(echo "$i"|sed 's/.*://')
+ printf +'t{
+tt"bucket": "%s",
+tt"key": "%s"
+t}
+' $b $k
+ done
+ printf ']n'
+ fi
+
+}
+
printf '[{"path": "FS", "type": "fs", "name": "primary"}]n' > iwhd.cfg || fail=1
@@ -95,6 +133,9 @@ wait_for .1 30 "curl -s http://localhost:$port" curl -X PUT http://localhost:$port/b1 || fail=1
test -d FS/b1 || fail=1
+# Post to root; should fail (but FIXME: how to detect failure?)
+curl -X PUT http://localhost:$port || fail=1
+
# Create a file in that bucket.
echo foo | curl -T - http://localhost:$port/b1/f1 || fail=1
test -f FS/b1/f1 || fail=1
@@ -111,11 +152,11 @@ curl -H 'Accept: */json' http://localhost:$port > root || fail=1
compare root root.json || fail=1
# Delete an object and ensure that it's gone from the file system.
-curl -X DELETE http://localhost:$port/b1/f1
+curl -X DELETE http://localhost:$port/b1/f1 || fail=1
test -f FS/b1/f1 && fail=1
# Try to delete a nonexistent object.
-curl -X DELETE http://localhost:$port/b1/no-such-obj
+curl -X DELETE http://localhost:$port/b1/no-such-obj || fail=1
# ################## Providers
@@ -138,6 +179,14 @@ for i in xml json; do
emit_provider $i "$p_name" fs "$host" 0 u p > p.xml || fail=1
compare p.xml p || fail=1
+ # Attempt to modify some other attribute; should fail (but curl won't)
+ curl_H -d provider="$p_name" -d other_attr=foo + http://localhost:$port/_providers || fail=1
+
+ # Attempt to modify nonexistent provider; should fail
+ curl_H -d provider=no_such -d username=v -d password=q + http://localhost:$port/_providers || fail=1
+
# Try to change just one of username and password, not specifying the other.
# Ensure that the attempt fails.
curl_H -d provider="$p_name" -d username=u @@ -159,6 +208,22 @@ for i in xml json; do
emit_provider $i "$p_name" fs "$host" 0 v q > p.exp || fail=1
compare p.exp p || fail=1
+ # List an empty bucket.
+ curl_H http://localhost:$port/b1 > b || fail=1
+ emit_bucket_list $i > b.exp || fail=1
+ compare b.exp b || fail=1
+
+ # Add an object, list non-empty bucket.
+ echo bar | curl -T - http://localhost:$port/b1/f2 || fail=1
+
+ # Ensure that new name appears in the listing.
+ curl_H http://localhost:$port/b1 > b || fail=1
+ emit_bucket_list $i b1:f2 > b.exp || fail=1
+ compare b.exp b || fail=1
+
+ # Remove b1/f2, to restore state for next iteration of this loop.
+ curl -X DELETE http://localhost:$port/b1/f2 || fail=1
+
done
Exit $fail
http://repo.or.cz/w/iwhd.git/commit/8a480375b7d4a48ea3c3d76b6a2b8eb6b202e3ab
commit 8a480375b7d4a48ea3c3d76b6a2b8eb6b202e3ab
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Sep 29 15:13:12 2010 +0200
remove unnecessary casts
diff --git a/rest.c b/rest.c
index 2172b31..5f06395 100644
--- a/rest.c
+++ b/rest.c
@@ -883,7 +883,7 @@ proxy_delete (void *cctx, struct MHD_Connection *conn, const char *url,
DPRINTF("PROXY DELETE %sn",url);
- rc = main_func_tbl->delete_func(ms->bucket,ms->key,(char *)url);
+ rc = main_func_tbl->delete_func(ms->bucket,ms->key,url);
if (rc == MHD_HTTP_OK) {
copied_url = strdup(url);
assert (copied_url);
@@ -891,7 +891,7 @@ proxy_delete (void *cctx, struct MHD_Connection *conn, const char *url,
key = strtok_r(NULL,"/",&stctx);
meta_delete(bucket,key);
free(copied_url);
- replicate_delete((char *)url);
+ replicate_delete(url);
}
resp = MHD_create_response_from_data(0,NULL,MHD_NO,MHD_NO);
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 +
autogen.sh | 3 +-
rest.c | 4 +-
t/basic | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
4 files changed, 72 insertions(+), 5 deletions(-)
delete mode 100644 ChangeLog
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
13 years, 7 months