aboutsummaryrefslogtreecommitdiff
path: root/src/eclat.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2015-01-23 12:45:51 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2015-01-23 13:08:19 +0200
commit0ed8a2275a3a6cda553b82e9e0222b9d3b8b3ff2 (patch)
tree2b617611ddeb6f97d9f316750496ac13c5ce59ad /src/eclat.c
parentb1824338b366e25756e4c64f04e535684529832d (diff)
downloadeclat-0ed8a2275a3a6cda553b82e9e0222b9d3b8b3ff2.tar.gz
eclat-0ed8a2275a3a6cda553b82e9e0222b9d3b8b3ff2.tar.bz2
Implement HTTP POST
* NEWS: Update. * doc/eclat.conf.5: Document http-method. Reorganize description of endpoints and regions. * lib/libeclat.h (ec2_request) <postdata>: New member (eclat_request_finalize): New proto. * lib/req2url.c (eclat_request_to_url): Remove second argument. All uses changed. (eclat_request_finalize): New function. * lib/reqfree.c: Free postdata. * lib/reqsign.c (requestsign4): Implement post. * src/config.c: New configuration statement http-method. * src/eclat.c (use_post): New variable. * src/eclat.h (use_post): New extern. * src/util.c (eclat_send_request): Implement post.
Diffstat (limited to 'src/eclat.c')
-rw-r--r--src/eclat.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/eclat.c b/src/eclat.c
index beaa934..2e46930 100644
--- a/src/eclat.c
+++ b/src/eclat.c
@@ -31,6 +31,7 @@ char *secret_key;
char *security_token;
char *region_name;
int use_ssl;
+int use_post;
int ssl_verify_peer = 1;
char *ssl_ca_file;
char *ssl_ca_path;
@@ -646,10 +647,15 @@ eclat_do_command(eclat_command_env_t *env, struct eclat_command *command,
int rc;
if (!(command->flags & CMD_NOQRY)) {
- env->request = eclat_request_create(use_ssl ? EC2_RF_HTTPS : 0,
- endpoint, "/",
- region_name, access_key,
- security_token);
+ int flags = 0;
+ if (use_ssl)
+ flags |= EC2_RF_HTTPS;
+ if (use_post)
+ flags |= EC2_RF_POST;
+ env->request = eclat_request_create(flags,
+ endpoint, "/",
+ region_name, access_key,
+ security_token);
}
if (command->tag)

Return to:

Send suggestions and report system problems to the System administrator.