Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/radosgw/s3/cpp.rst: update usage of libs3 APIs to make the examples work #10851

Merged
merged 1 commit into from Apr 14, 2017

Conversation

Projects
None yet
2 participants
@atheism
Copy link
Contributor

atheism commented Aug 25, 2016

The libs3 APIs are changed in the current libs3 packages from https://github.com/bji/libs3. It leads to compiling errors with the current S3 cpp API examples.

s3-api-test.cc: In function ‘int main(int, char*)’:
s3-api-test.cc:166:103: error: cannot convert ‘S3ListServiceHandler
’ to ‘S3RequestContext_’ for argument ‘6’ to ‘void S3_list_service(S3Protocol, const char_, const char_, const char_, const char_, S3RequestContext_, const S3ListServiceHandler_, void_)’
S3_list_service(S3ProtocolHTTP, access_key, secret_key, host, 0, &listServiceHandler, &header_printed);
^
s3-api-test.cc:168:134: error: cannot convert ‘S3CannedAcl’ to ‘const char_’ for argument ‘6’ to ‘void S3_create_bucket(S3Protocol, const char_, const char_, const char_, const char_, const char_, S3CannedAcl, const char_, S3RequestContext_, const S3ResponseHandler_, void_)’
S3_create_bucket(S3ProtocolHTTP, access_key, secret_key, host, sample_bucket, S3CannedAclPrivate, NULL, NULL, &responseHandler, NULL);
^

The reason is that the related APIs are changed.

void S3_list_service(S3Protocol protocol, const char *accessKeyId,
const char *secretAccessKey, const char *securityToken,
const char *hostName, S3RequestContext *requestContext,
const S3ListServiceHandler *handler,
void *callbackData);

void S3_create_bucket(S3Protocol protocol, const char *accessKeyId,
const char *secretAccessKey, const char *securityToken,
const char *hostName, const char *bucketName,
S3CannedAcl cannedAcl, const char *locationConstraint,
S3RequestContext *requestContext,
const S3ResponseHandler *handler, void *callbackData);

We do not use security token in the examples.
Change the document accordingly to make the examples work.
Signed-off-by: Weibing Zhang zhangweibing@unitedstack.com

zhangweibing
doc/radosgw/s3/cpp.rst: update usage of libs3 APIs to make the exampl…
…es work

Signed-off-by: Weibing Zhang <zhangweibing@unitedstack.com>
@@ -105,7 +105,7 @@ for each bucket.
&listServiceCallback
};
bool header_printed = false;
S3_list_service(S3ProtocolHTTP, access_key, secret_key, host, 0, &listServiceHandler, &header_printed);
S3_list_service(S3ProtocolHTTP, access_key, secret_key, host, 0, NULL, &listServiceHandler, &header_printed);

This comment has been minimized.

Copy link
@tchaikov

tchaikov Apr 14, 2017

Contributor

for posterity,

void S3_list_service(S3Protocol protocol, const char *accessKeyId,
                     const char *secretAccessKey, const char *hostName,
                     S3RequestContext *requestContext,
                     const S3ListServiceHandler *handler,
                     void *callbackData);

see https://github.com/ceph/libs3/blob/dcf98ff04bc5dacd5d45854a32870d86dd7b26c7/inc/libs3.h#L1457

@tchaikov tchaikov merged commit 125f27e into ceph:master Apr 14, 2017

2 checks passed

Signed-off-by all commits in this PR are signed
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.