# Ok, big ass change list. Most of the changes are NEW's worthy, so

# I'll enter them directly there, not here....  The non-newsworthy code
# is:

Added REGISTER_CURL_CONSTANT() a wrapper around REGISTER_LONG_CONSTANT()
Re-vamp the internal php_curl structure.
Properly free allocated slist's and HttpPost structures
many whitespace changes
speed improvements (in the post handling and slist area's)

# Furthermore, as a side note, while the code I'm committing is correct,
# no one will be able to compile it yet and test it, as it requires a
# patched version of curl (if you really want to try it out and can't
# wait a day or two, send me a private mail)
This commit is contained in:
Sterling Hughes 2001-04-30 14:36:19 +00:00
parent 0a121f855c
commit ea2cf1856f
2 changed files with 723 additions and 542 deletions

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,9 @@
#ifndef _PHP_CURL_H
#define _PHP_CURL_H
#include "php.h"
#include "ext/standard/php_smart_str.h"
#ifdef COMPILE_DL_CURL
#undef HAVE_CURL
#define HAVE_CURL 1
@ -30,6 +33,7 @@
#include <curl/curl.h>
extern zend_module_entry curl_module_entry;
#define curl_module_ptr &curl_module_entry
@ -42,22 +46,47 @@ PHP_FUNCTION(curl_version);
PHP_FUNCTION(curl_init);
PHP_FUNCTION(curl_setopt);
PHP_FUNCTION(curl_exec);
#if LIBCURL_VERSION_NUM >= 0x070401
PHP_FUNCTION(curl_getinfo);
#endif
PHP_FUNCTION(curl_error);
PHP_FUNCTION(curl_errno);
PHP_FUNCTION(curl_close);
typedef struct {
int return_transfer;
int output_file;
int php_stdout;
int cerrno;
char error[CURL_ERROR_SIZE+1];
FILE *tmp_fp;
CURL *cp;
zend_llist to_free;
zval *func;
smart_str buf;
int method;
} php_curl_write;
typedef struct {
zval *func;
long fd;
int method;
} php_curl_read;
typedef struct {
zval *write_header;
zval *passwd;
} php_curl_handlers;
struct _php_curl_error {
char str[CURL_ERROR_SIZE + 1];
int no;
};
struct _php_curl_free {
zend_llist str;
zend_llist post;
zend_llist slist;
};
typedef struct {
CURL *cp;
php_curl_write *write;
php_curl_read *read;
php_curl_handlers *handlers;
struct _php_curl_error err;
struct _php_curl_free to_free;
long id;
} php_curl;