aboutsummaryrefslogtreecommitdiff
path: root/lib/q2url.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-09-20 00:49:00 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-09-20 00:49:00 +0300
commitdf0d5f4df874bd47e5e47d08c67fea7ac17eec1e (patch)
tree2097591c3fd1a8e82bf6101c6d311fc9480917f1 /lib/q2url.c
parent96871660d41c0130460f52057c0334cec46f7dd3 (diff)
downloadeclat-df0d5f4df874bd47e5e47d08c67fea7ac17eec1e.tar.gz
eclat-df0d5f4df874bd47e5e47d08c67fea7ac17eec1e.tar.bz2
Implement start-instance.
* lib/qaddparm.c: New file. * lib/qcreat.c: New file. * lib/qencode.c: New file. * lib/qfree.c: new file. * lib/Makefile.am: Add new files. * lib/libeclat.h (ec2_query) <https, verb>: Remove. <flags>: New member. (eclat_query_create, eclat_query_free) (eclat_query_encode): New protos. * lib/q2url.c (eclat_query_to_url): Fix. * lib/reqsign.c (eclat_query_signature): Bugfixes. * src/config.c (config_finish): Call grecs_tree_process. * src/eclat.c (url_base): Remove. (main): Install curl debugging function if required. * src/eclat.h: Update. * src/startinst.c (eclat_start_instance): Implement.
Diffstat (limited to 'lib/q2url.c')
-rw-r--r--lib/q2url.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/q2url.c b/lib/q2url.c
index a96e2e9..d677404 100644
--- a/lib/q2url.c
+++ b/lib/q2url.c
@@ -37,18 +37,18 @@ char *
eclat_query_to_url(struct ec2_query *req, char **post_params)
{
struct grecs_txtacc *acc;
- char *ret = NULL;
+ char *ret = NULL, *p;
acc = grecs_txtacc_create();
grecs_txtacc_grow(acc, "http", 4);
- if (req->https)
+ if (req->flags & EC2_QF_HTTPS)
grecs_txtacc_grow_char(acc, 's');
- grecs_txtacc_grow(acc, "//", 2);
+ grecs_txtacc_grow(acc, "://", 3);
grecs_txtacc_grow(acc, req->endpoint, strlen(req->endpoint));
grecs_txtacc_grow(acc, req->uri, strlen(req->uri));
- if (strcmp(req->verb, "POST") == 0) {
+ if (req->flags & EC2_QF_POST) {
grecs_txtacc_grow_char(acc, 0);
ret = grecs_txtacc_finish(acc, 1);
} else {
@@ -56,9 +56,13 @@ eclat_query_to_url(struct ec2_query *req, char **post_params)
}
/* Add signature */
- grecs_txtacc_grow(acc, "Signature", sizeof ("Signature"));
+ grecs_txtacc_grow(acc, "Signature", sizeof("Signature")-1);
grecs_txtacc_grow_char(acc, '=');
- grecs_txtacc_grow(acc, req->signature, strlen(req->signature));
+
+ urlencode(req->signature, strlen(req->signature), &p, NULL);
+ grecs_txtacc_grow(acc, p, strlen(p));
+ free(p);
+
/* Add other parameters */
grecs_symtab_enumerate(req->params, add_param, acc);

Return to:

Send suggestions and report system problems to the System administrator.