serf.h | serf.h | |||
---|---|---|---|---|
skipping to change at line 703 | skipping to change at line 703 | |||
* APR_EAGAIN will never be returned. | * APR_EAGAIN will never be returned. | |||
*/ | */ | |||
apr_status_t (*peek)(serf_bucket_t *bucket, | apr_status_t (*peek)(serf_bucket_t *bucket, | |||
const char **data, apr_size_t *len); | const char **data, apr_size_t *len); | |||
/** | /** | |||
* Destroy @a bucket, along with any associated resources. | * Destroy @a bucket, along with any associated resources. | |||
*/ | */ | |||
void (*destroy)(serf_bucket_t *bucket); | void (*destroy)(serf_bucket_t *bucket); | |||
/** | ||||
* Save the current state of the @a bucket for later retrieval and retu | ||||
rn | ||||
* APR_SUCCESS. A previously set snapshot will be cleared. | ||||
* In case of error, the bucket should be considered invalid. | ||||
*/ | ||||
apr_status_t (*snapshot)(serf_bucket_t *bucket); | ||||
/** | ||||
* Restore the state of the @a bucket to the state set in the last | ||||
* snapshot and returns APR_SUCCESS. If no snapshot was set, the bucket | ||||
's | ||||
* state is unchanged and APR_SUCCESS is returned. | ||||
* In case of error, the bucket should be considered invalid. | ||||
*/ | ||||
apr_status_t (*restore_snapshot)(serf_bucket_t *bucket); | ||||
/** | ||||
* Test if a snapshot is set. Returns 0 if no snapshot was set, a non-0 | ||||
* value if there is a snapshot set. | ||||
*/ | ||||
int (*is_snapshot_set)(serf_bucket_t *bucket); | ||||
/* ### apr buckets have 'copy', 'split', and 'setaside' functions. | /* ### apr buckets have 'copy', 'split', and 'setaside' functions. | |||
### not sure whether those will be needed in this bucket model. | ### not sure whether those will be needed in this bucket model. | |||
*/ | */ | |||
}; | }; | |||
/** | /** | |||
* Should the use and lifecycle of buckets be tracked? | * Should the use and lifecycle of buckets be tracked? | |||
* | * | |||
* When tracking, the system will ensure several semantic requirements | * When tracking, the system will ensure several semantic requirements | |||
* of bucket use: | * of bucket use: | |||
skipping to change at line 746 | skipping to change at line 767 | |||
#define serf_bucket_read(b,r,d,l) SERF__RECREAD(b, (b)->type->read(b,r,d,l) ) | #define serf_bucket_read(b,r,d,l) SERF__RECREAD(b, (b)->type->read(b,r,d,l) ) | |||
#define serf_bucket_readline(b,a,f,d,l) \ | #define serf_bucket_readline(b,a,f,d,l) \ | |||
SERF__RECREAD(b, (b)->type->readline(b,a,f,d,l)) | SERF__RECREAD(b, (b)->type->readline(b,a,f,d,l)) | |||
#define serf_bucket_read_iovec(b,r,s,v,u) \ | #define serf_bucket_read_iovec(b,r,s,v,u) \ | |||
SERF__RECREAD(b, (b)->type->read_iovec(b,r,s,v,u)) | SERF__RECREAD(b, (b)->type->read_iovec(b,r,s,v,u)) | |||
#define serf_bucket_read_for_sendfile(b,r,h,f,o,l) \ | #define serf_bucket_read_for_sendfile(b,r,h,f,o,l) \ | |||
SERF__RECREAD(b, (b)->type->read_for_sendfile(b,r,h,f,o,l)) | SERF__RECREAD(b, (b)->type->read_for_sendfile(b,r,h,f,o,l)) | |||
#define serf_bucket_read_bucket(b,t) ((b)->type->read_bucket(b,t)) | #define serf_bucket_read_bucket(b,t) ((b)->type->read_bucket(b,t)) | |||
#define serf_bucket_peek(b,d,l) ((b)->type->peek(b,d,l)) | #define serf_bucket_peek(b,d,l) ((b)->type->peek(b,d,l)) | |||
#define serf_bucket_destroy(b) ((b)->type->destroy(b)) | #define serf_bucket_destroy(b) ((b)->type->destroy(b)) | |||
#define serf_bucket_snapshot(b) ((b)->type->snapshot(b)) | ||||
#define serf_bucket_restore_snapshot(b) ((b)->type->restore_snapshot(b)) | ||||
#define serf_bucket_is_snapshot_set(b) ((b)->type->is_snapshot_set(b)) | ||||
/** | /** | |||
* Check whether a real error occurred. Note that bucket read functions | * Check whether a real error occurred. Note that bucket read functions | |||
* can return EOF and EAGAIN as part of their "normal" operation, so they | * can return EOF and EAGAIN as part of their "normal" operation, so they | |||
* should not be considered an error. | * should not be considered an error. | |||
*/ | */ | |||
#define SERF_BUCKET_READ_ERROR(status) ((status) \ | #define SERF_BUCKET_READ_ERROR(status) ((status) \ | |||
&& !APR_STATUS_IS_EOF(status) \ | && !APR_STATUS_IS_EOF(status) \ | |||
&& !APR_STATUS_IS_EAGAIN(status)) | && !APR_STATUS_IS_EAGAIN(status)) | |||
skipping to change at line 878 | skipping to change at line 902 | |||
SERF_DECLARE(apr_status_t) serf_debug__record_read( | SERF_DECLARE(apr_status_t) serf_debug__record_read( | |||
const serf_bucket_t *bucket, | const serf_bucket_t *bucket, | |||
apr_status_t status); | apr_status_t status); | |||
SERF_DECLARE(void) serf_debug__entered_loop(serf_bucket_alloc_t *allocator) ; | SERF_DECLARE(void) serf_debug__entered_loop(serf_bucket_alloc_t *allocator) ; | |||
SERF_DECLARE(void) serf_debug__closed_conn(serf_bucket_alloc_t *allocator); | SERF_DECLARE(void) serf_debug__closed_conn(serf_bucket_alloc_t *allocator); | |||
SERF_DECLARE(void) serf_debug__bucket_destroy(const serf_bucket_t *bucket); | SERF_DECLARE(void) serf_debug__bucket_destroy(const serf_bucket_t *bucket); | |||
SERF_DECLARE(void) serf_debug__bucket_alloc_check(serf_bucket_alloc_t *allo cator); | SERF_DECLARE(void) serf_debug__bucket_alloc_check(serf_bucket_alloc_t *allo cator); | |||
/* Version info */ | /* Version info */ | |||
#define SERF_MAJOR_VERSION 0 | #define SERF_MAJOR_VERSION 0 | |||
#define SERF_MINOR_VERSION 2 | #define SERF_MINOR_VERSION 3 | |||
#define SERF_PATCH_VERSION 0 | #define SERF_PATCH_VERSION 0 | |||
/* Version number string */ | /* Version number string */ | |||
#define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ | #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ | |||
APR_STRINGIFY(SERF_MINOR_VERSION) "." \ | APR_STRINGIFY(SERF_MINOR_VERSION) "." \ | |||
APR_STRINGIFY(SERF_PATCH_VERSION) | APR_STRINGIFY(SERF_PATCH_VERSION) | |||
/** | /** | |||
* Check at compile time if the Serf version is at least a certain | * Check at compile time if the Serf version is at least a certain | |||
* level. | * level. | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 27 lines changed or added | |||
serf_bucket_types.h | serf_bucket_types.h | |||
---|---|---|---|---|
skipping to change at line 404 | skipping to change at line 404 | |||
serf_ssl_need_server_cert_t callback, | serf_ssl_need_server_cert_t callback, | |||
void *data); | void *data); | |||
/** | /** | |||
* Use the default root CA certificates as included with the OpenSSL librar y. | * Use the default root CA certificates as included with the OpenSSL librar y. | |||
*/ | */ | |||
SERF_DECLARE(apr_status_t) | SERF_DECLARE(apr_status_t) | |||
serf_ssl_use_default_certificates(serf_ssl_context_t *context); | serf_ssl_use_default_certificates(serf_ssl_context_t *context); | |||
/** | /** | |||
* Return the depth of the certificate. | ||||
*/ | ||||
SERF_DECLARE(int) serf_ssl_cert_depth(const serf_ssl_certificate_t *cert); | ||||
/** | ||||
* Extract the fields of the issuer in a table with keys (E, CN, OU, O, L, | * Extract the fields of the issuer in a table with keys (E, CN, OU, O, L, | |||
* ST and C). The returned table will be allocated in @a pool. | * ST and C). The returned table will be allocated in @a pool. | |||
*/ | */ | |||
SERF_DECLARE(apr_hash_t *) | SERF_DECLARE(apr_hash_t *) | |||
serf_ssl_cert_issuer(const serf_ssl_certificate_t *cert, apr_pool_t *pool); | serf_ssl_cert_issuer(const serf_ssl_certificate_t *cert, apr_pool_t *pool); | |||
/** | /** | |||
* Extract the fields of the subject in a table with keys (E, CN, OU, O, L, | * Extract the fields of the subject in a table with keys (E, CN, OU, O, L, | |||
* ST and C). The returned table will be allocated in @a pool. | * ST and C). The returned table will be allocated in @a pool. | |||
*/ | */ | |||
skipping to change at line 425 | skipping to change at line 430 | |||
serf_ssl_cert_subject(const serf_ssl_certificate_t *cert, apr_pool_t *pool) ; | serf_ssl_cert_subject(const serf_ssl_certificate_t *cert, apr_pool_t *pool) ; | |||
/** | /** | |||
* Extract the fields of the certificate in a table with keys (sha1, notBef ore, | * Extract the fields of the certificate in a table with keys (sha1, notBef ore, | |||
* notAfter). The returned table will be allocated in @a pool. | * notAfter). The returned table will be allocated in @a pool. | |||
*/ | */ | |||
SERF_DECLARE(apr_hash_t *) | SERF_DECLARE(apr_hash_t *) | |||
serf_ssl_cert_certificate(const serf_ssl_certificate_t *cert, apr_pool_t *p ool); | serf_ssl_cert_certificate(const serf_ssl_certificate_t *cert, apr_pool_t *p ool); | |||
/** | /** | |||
* Export a certificate to base64-encoded, zero-terminated string. | ||||
* The returned string is allocated in @a pool. Returns NULL on failure. | ||||
*/ | ||||
SERF_DECLARE(const char *) | ||||
serf_ssl_cert_export(const serf_ssl_certificate_t *cert, apr_pool_t *pool); | ||||
/** | ||||
* Load a CA certificate file from a path @a file_path. If the file was loa ded | * Load a CA certificate file from a path @a file_path. If the file was loa ded | |||
* and parsed correctly, a certificate @a cert will be created and returned . | * and parsed correctly, a certificate @a cert will be created and returned . | |||
* This certificate object will be alloced in @a pool. | * This certificate object will be alloced in @a pool. | |||
*/ | */ | |||
SERF_DECLARE(apr_status_t) | SERF_DECLARE(apr_status_t) | |||
serf_ssl_load_cert_file(serf_ssl_certificate_t **cert, const char *file_pat h, | serf_ssl_load_cert_file(serf_ssl_certificate_t **cert, const char *file_pat h, | |||
apr_pool_t *pool); | apr_pool_t *pool); | |||
/** | /** | |||
* Adds the certificate @a cert to the list of trusted certificates in | * Adds the certificate @a cert to the list of trusted certificates in | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 12 lines changed or added | |||
serf_bucket_util.h | serf_bucket_util.h | |||
---|---|---|---|---|
skipping to change at line 98 | skipping to change at line 98 | |||
/** | /** | |||
* Default implementation of the @see destroy functionality. | * Default implementation of the @see destroy functionality. | |||
* | * | |||
* This function will return the @a bucket, and the data member to its | * This function will return the @a bucket, and the data member to its | |||
* allcoator. | * allcoator. | |||
*/ | */ | |||
SERF_DECLARE(void) serf_default_destroy_and_data(serf_bucket_t *bucket); | SERF_DECLARE(void) serf_default_destroy_and_data(serf_bucket_t *bucket); | |||
/** | /** | |||
* Default implementation of the @see snapshot functionality | ||||
* | ||||
* This function will return an error to indicate it's not implemented. | ||||
*/ | ||||
SERF_DECLARE(apr_status_t) serf_default_snapshot(serf_bucket_t *bucket); | ||||
/* | ||||
* Default implementation of the @see restore_snapshot functionality | ||||
* | ||||
* This function will return an error to indicate it's not implemented. | ||||
*/ | ||||
SERF_DECLARE(apr_status_t) serf_default_restore_snapshot(serf_bucket_t *buc | ||||
ket); | ||||
/* | ||||
* Default implementation of the @see is_snapshot_set functionality | ||||
* | ||||
* This function will return 0 (no snapshot set). | ||||
*/ | ||||
SERF_DECLARE(int) serf_default_is_snapshot_set(serf_bucket_t *bucket); | ||||
/** | ||||
* Allocate @a size bytes of memory using @a allocator. | * Allocate @a size bytes of memory using @a allocator. | |||
*/ | */ | |||
SERF_DECLARE(void *) serf_bucket_mem_alloc( | SERF_DECLARE(void *) serf_bucket_mem_alloc( | |||
serf_bucket_alloc_t *allocator, | serf_bucket_alloc_t *allocator, | |||
apr_size_t size); | apr_size_t size); | |||
/** | /** | |||
* Allocate @a size bytes of memory using @a allocator and set all of the | ||||
* memory to 0. | ||||
*/ | ||||
SERF_DECLARE(void *) serf_bucket_mem_calloc( | ||||
serf_bucket_alloc_t *allocator, | ||||
apr_size_t size); | ||||
/** | ||||
* Free the memory at @a block, returning it to @a allocator. | * Free the memory at @a block, returning it to @a allocator. | |||
*/ | */ | |||
SERF_DECLARE(void) serf_bucket_mem_free( | SERF_DECLARE(void) serf_bucket_mem_free( | |||
serf_bucket_alloc_t *allocator, | serf_bucket_alloc_t *allocator, | |||
void *block); | void *block); | |||
/** | /** | |||
* Analogous to apr_pstrmemdup, using a bucket allocator instead. | * Analogous to apr_pstrmemdup, using a bucket allocator instead. | |||
*/ | */ | |||
SERF_DECLARE(char *) serf_bstrmemdup(serf_bucket_alloc_t *allocator, | SERF_DECLARE(char *) serf_bstrmemdup(serf_bucket_alloc_t *allocator, | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 30 lines changed or added | |||