summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorBryan Ischo <bryan@ischo.com>2008-07-02 11:06:07 +0000
committerBryan Ischo <bryan@ischo.com>2008-07-02 11:06:07 +0000
commit1b6c5f1b4697416a32ddd1190541b09fb1931f21 (patch)
tree585dba43b0931cd38438e7d1b5a746dc3a511543 /inc
parent4d64cc90e237079b6d0a2aa17ffc78dff1551442 (diff)
downloadceph-libs3-1b6c5f1b4697416a32ddd1190541b09fb1931f21.tar.gz
* Work in progress. list, test, create, and delete buckets kinda works
Diffstat (limited to 'inc')
-rw-r--r--inc/libs3.h18
-rw-r--r--inc/private.h8
2 files changed, 19 insertions, 7 deletions
diff --git a/inc/libs3.h b/inc/libs3.h
index f554358..8626bf2 100644
--- a/inc/libs3.h
+++ b/inc/libs3.h
@@ -101,6 +101,8 @@ typedef enum
S3StatusContentTypeTooLong ,
S3StatusBadMD5 ,
S3StatusMD5TooLong ,
+ S3StatusBadCacheControl ,
+ S3StatusCacheControlTooLong ,
S3StatusBadContentDispositionFilename ,
S3StatusContentDispositionFilenameTooLong ,
S3StatusBadContentEncoding ,
@@ -238,9 +240,9 @@ typedef enum
**/
typedef enum
{
- S3CannedAclNone = 0, /* private */
- S3CannedAclRead = 1, /* public-read */
- S3CannedAclReadWrite = 2, /* public-read-write */
+ S3CannedAclPrivate = 0, /* private */
+ S3CannedAclPublicRead = 1, /* public-read */
+ S3CannedAclPublicReadWrite = 2, /* public-read-write */
S3CannedAclAuthenticatedRead = 3 /* authenticated-read */
} S3CannedAcl;
@@ -478,6 +480,11 @@ typedef struct S3RequestHeaders
**/
const char *md5;
/**
+ * If present, this gives a Cache-Control header string to be supplied to
+ * HTTP clients which download this
+ **/
+ const char *cacheControl;
+ /**
* If present, this gives the filename to save the downloaded file to,
* whenever the object is downloaded via a web browser. This is only
* relevent for objects which are intended to be shared to users via web
@@ -889,7 +896,7 @@ S3Status S3_list_service(S3Protocol protocol, const char *accessKeyId,
S3Status S3_test_bucket(S3Protocol protocol, const char *accessKeyId,
const char *secretAccessKey, const char *bucketName,
int locationConstraintReturnSize,
- const char *locationConstraintReturn,
+ char *locationConstraintReturn,
S3RequestContext *requestContext,
S3ResponseHandler *handler, void *callbackData);
@@ -912,6 +919,7 @@ S3Status S3_test_bucket(S3Protocol protocol, const char *accessKeyId,
S3Status S3_create_bucket(S3Protocol protocol, const char *accessKeyId,
const char *secretAccessKey,
const char *bucketName,
+ S3CannedAcl cannedAcl,
const char *locationConstraint,
S3RequestContext *requestContext,
S3ResponseHandler *handler, void *callbackData);
@@ -1072,4 +1080,6 @@ S3Status S3_clear_acl(S3BucketContext *bucketContext, const char *key,
* xxx todo
* functions for generating form stuff for posting to s3
**/
+
+
#endif /* LIBS3_H */
diff --git a/inc/private.h b/inc/private.h
index 4511537..b6758b6 100644
--- a/inc/private.h
+++ b/inc/private.h
@@ -121,6 +121,9 @@ typedef struct RequestParams
// The read callback to be called by curl, if needed; req will be passed
// in as the Request structure for this request
size_t (*curlReadCallback)(void *data, size_t s, size_t n, void *req);
+ // This is the number of bytes that will be provided by the read callback,
+ // if the read callback is set
+ int64_t readSize;
// The following are computed ---------------------------------------------
@@ -137,6 +140,8 @@ typedef struct RequestParams
char urlEncodedKey[MAX_URLENCODED_KEY_SIZE + 1];
// Canonicalized resource
char canonicalizedResource[MAX_CANONICALIZED_RESOURCE_SIZE + 1];
+ // Cache-Control header (or empty)
+ char cacheControlHeader[128];
// Content-Type header (or empty)
char contentTypeHeader[128];
// Content-MD5 header (or empty)
@@ -194,9 +199,6 @@ typedef struct Request
// The callback to make when the response has been completely handled
S3ResponseCompleteCallback *completeCallback;
- // This is set to nonzero after the complete callback has been made
- int completeCallbackMade;
-
// This will be 0 if S3 didn't send any XML error
int receivedS3Error;