com php-src: finish: main/SAPI.c main/php_memory_streams. h main/streams/memory.c main/streams/php_stream_plain _wrapper.h
main/streams/plain_wrapper.c
| From: | Michael Wallner | Date: | Thu, 03 Jul 2014 18:40:40 +0000 |
| Subject: | com php-src: finish: main/SAPI.c main/php_memory_streams. h main/streams/memory.c main/streams/php_stream_plain _wrapper.h main/streams/plain_wrapper.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79230@lists.php.net to get a copy of this message | ||
Commit: 438b6c5258021d72be3d48d46031ae516aaa0e19
Author: Michael Wallner <mike@php.net> Wed, 2 Jul 2014 14:35:20 +0200
Parents: 40bcd909d8948c53226accf9ceb11987b0f8e442
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=438b6c5258021d72be3d48d46031ae516aaa0e19
Log:
finish
Changed paths:
M main/SAPI.c
M main/php_memory_streams.h
M main/streams/memory.c
M main/streams/php_stream_plain_wrapper.h
M main/streams/plain_wrapper.c
Diff:
diff --git a/main/SAPI.c b/main/SAPI.c
index 653f587..f9e9ccb 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -279,7 +279,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
}
- SG(request_info).request_body = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE);
+ SG(request_info).request_body = php_stream_temp_create_ex(TEMP_STREAM_DEFAULT,
SAPI_POST_BLOCK_SIZE, PG(upload_tmp_dir));
if (sapi_module.read_post) {
int read_bytes;
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index 32a3dae..689d9f2 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -37,7 +37,7 @@
#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM)
#define php_stream_temp_create(mode, max_memory_usage) php_stream_temp_create_ex((mode),
(max_memory_usage), NULL)
#define php_stream_temp_create_ex(mode, max_memory_usage, tmpdir)
_php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC TSRMLS_CC)
-#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode),
(max_memory_usage) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create_ex((mode),
(max_memory_usage), NULL STREAMS_REL_CC TSRMLS_CC)
#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode),
(max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC)
BEGIN_EXTERN_C()
@@ -45,7 +45,6 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC);
PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC
TSRMLS_DC);
PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC
TSRMLS_DC);
-PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC);
PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir
STREAMS_DC TSRMLS_DC);
PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t
length STREAMS_DC TSRMLS_DC);
END_EXTERN_C()
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 6b3fc3f..1f6bfbd 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -357,6 +357,7 @@ typedef struct {
/* {{{ */
+
static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h
index 4370867..d185e74 100644
--- a/main/streams/php_stream_plain_wrapper.h
+++ b/main/streams/php_stream_plain_wrapper.h
@@ -42,11 +42,9 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha
PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC);
#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode)
STREAMS_CC TSRMLS_CC)
-PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC)
-
PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char
**opened_path STREAMS_DC TSRMLS_DC);
#define php_stream_fopen_temporary_file(dir, pfx,
opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC)
+#define php_stream_fopen_tmpfile() _php_stream_fopen_temporary_file(NULL, "php", NULL
STREAMS_CC TSRMLS_CC)
/* This is a utility API for extensions that are opening a stream, converting it
* to a FILE* and then closing it again. Be warned that fileno() on the result
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index aba16ff..d7d25f2 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -188,7 +188,7 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char
char *opened_path = NULL;
int fd;
- fd = php_open_temporary_fd(dir, pfx, opened_path TSRMLS_CC);
+ fd = php_open_temporary_fd(dir, pfx, &opened_path TSRMLS_CC);
if (fd != -1) {
php_stream *stream;
@@ -216,11 +216,6 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char
return NULL;
}
-PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC)
-{
- return php_stream_fopen_temporary_file(NULL, "php", NULL);
-}
-
PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id
STREAMS_DC TSRMLS_DC)
{
php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id);