fix leaks; all tests pass
[m6w6/ext-http] / php_http_client.h
index 308361f50193e5e4f7c6ea738bdbf507a73bba0b..792581a4da017906ffa05b5e550069b39a0b2157 100644 (file)
 typedef enum php_http_client_setopt_opt {
        PHP_HTTP_CLIENT_OPT_ENABLE_PIPELINING,
        PHP_HTTP_CLIENT_OPT_USE_EVENTS,
+       PHP_HTTP_CLIENT_OPT_CONFIGURATION,
 } php_http_client_setopt_opt_t;
 
 typedef enum php_http_client_getopt_opt {
-       PHP_HTTP_CLIENT_OPT_PROGRESS_INFO,              /* php_http_client_progress_state_t** */
-       PHP_HTTP_CLIENT_OPT_TRANSFER_INFO,              /* HashTable* */
+       PHP_HTTP_CLIENT_OPT_PROGRESS_INFO,              /* php_http_client_enqueue_t*, php_http_client_progress_state_t** */
+       PHP_HTTP_CLIENT_OPT_TRANSFER_INFO,              /* php_http_client_enqueue_t*, HashTable* */
+       PHP_HTTP_CLIENT_OPT_AVAILABLE_OPTIONS,          /* NULL, HashTable* */
+       PHP_HTTP_CLIENT_OPT_AVAILABLE_CONFIGURATION,/* NULL, HashTable */
 } php_http_client_getopt_opt_t;
 
 typedef struct php_http_client_enqueue {
@@ -62,13 +65,14 @@ typedef struct php_http_client_ops {
 } php_http_client_ops_t;
 
 typedef struct php_http_client_driver {
-       const char *name_str;
-       size_t name_len;
+       zend_string *driver_name;
+       zend_string *client_name;
+       zend_string *request_name;
        php_http_client_ops_t *client_ops;
 } php_http_client_driver_t;
 
 PHP_HTTP_API ZEND_RESULT_CODE php_http_client_driver_add(php_http_client_driver_t *driver);
-PHP_HTTP_API php_http_client_driver_t *php_http_client_driver_get(const char *name_str, size_t name_len);
+PHP_HTTP_API php_http_client_driver_t *php_http_client_driver_get(zend_string *name);
 
 typedef struct php_http_client_progress_state {
        struct {
@@ -84,7 +88,7 @@ typedef struct php_http_client_progress_state {
        unsigned finished:1;
 } php_http_client_progress_state_t;
 
-typedef ZEND_RESULT_CODE (*php_http_client_response_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, php_http_message_t **request, php_http_message_t **response);
+typedef ZEND_RESULT_CODE (*php_http_client_response_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, php_http_message_t **response);
 typedef void (*php_http_client_progress_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, php_http_client_progress_state_t *state);
 
 typedef struct php_http_client {
@@ -111,6 +115,8 @@ PHP_HTTP_API zend_class_entry *php_http_client_class_entry;
 
 typedef struct php_http_client_object {
        php_http_client_t *client;
+       php_http_object_method_t *update;
+       php_http_object_method_t notify;
        long iterator;
        zend_object zo;
 } php_http_client_object_t;