Commit Graph

104 Commits

Author SHA1 Message Date
Andrei Zmievski
264cec8be6 Unicode support. 2005-08-11 23:36:07 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Antony Dovgal
d5bb03b11a fix bugs #32742 (segmentation fault when the stream with a wrapper is not closed),
#32171 (Userspace stream wrapper crashes PHP)
2005-05-16 08:37:14 +00:00
Ilia Alshanetsky
c7b931d80d Fixed bug #31515 (Improve performance of scandir() by factor of 10 or so). 2005-02-22 00:24:13 +00:00
Wez Furlong
0569078901 Avoid bug where stream_copy_to_stream() call for precisely 2000000 bytes would
result in entire resource being copied.
The mmap brake is already present inside mmap_range() and is set to 1MB.
2005-02-06 23:17:09 +00:00
Ilia Alshanetsky
d98a44d483 Fixed bug #29801 (Set limit on the size of mmapable data). 2004-11-15 23:43:12 +00:00
Anantha Kesari H Y
a93f75ce6b NETWARE has a proper stat structure Now no need of CLIB_STAT_PATCH checks 2004-09-29 10:54:56 +00:00
Sara Golemon
34550382d8 Added stream_filter_remove() to cancel a stream filter.
Register filters as resources when
instantiated by stream_filter_(ap|pre)pend().

Export php_stream_filter_flush() internal function to wind buffered data
out of a particular filter until consumed by a later filter or sent to
stream->readbuffer or stream->ops->write()
2004-09-14 03:48:17 +00:00
Sara Golemon
955b43ba12 Add stream_wrapper_unregister()
Disables a wrapper (user-defined or built-in) for the life of the request.

Add stream_wrapper_restore()
Restores the wrapper originally defined at the time the request started
to the protocol name mentioned.
2004-09-10 20:45:35 +00:00
Sara Golemon
a2c24ae90e BugFix#28868 (Part Two): This fixes thread unsafety in the userspace
filters which relates to the fix just applied for userspace wrappers.
2004-06-21 21:08:05 +00:00
Sara Golemon
7fcfa8865e BugFix#28868: Wrapper hash not thread-safe.
Userdefined wrappers were being registered into a global wrapper hash
which can cross threads.  Termination of once instance then has the
potential to leave an active stream in another instance with no wrapper
leading to segfault.
2004-06-21 18:58:55 +00:00
Hartmut Holzgraefe
b8f7d9f9f5 wrap all PHPAPI prototypes into BEGIN_EXTERN_C/END_EXTERN_C blocks
(else they won't be usable from C++ extensions)
2004-02-20 08:04:30 +00:00
Sara Golemon
6d10371ec6 'Bug Fix': scandir, being a new function in PHP5 should have always been wrapper aware. 2004-01-28 22:21:54 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Sara Golemon
a67bf6ecc9 Fix Win32 Build. mkdir/rmdir are macros 2003-12-13 18:48:39 +00:00
Sara Golemon
c56647833b Route mkdir()/rmdir() via wrapper ops.
Move current rmdir()/rmdir() code to plain_wrappers.c
Implement mkdir()/rmdir() in ftp:// wrapper
2003-12-13 04:07:18 +00:00
Sara Golemon
b1f8236b63 Route rename() via wrapper ops.
Move current rename() code to main/streams/plain_wrapper.c
Implement ftp/rename()
Implement userstreams/rename()
2003-12-12 23:06:42 +00:00
Sara Golemon
681d18effd Move safemode/basedir checks for url_stat to plain_wrapper. 2003-12-01 19:47:05 +00:00
Sara Golemon
026d4c9e4c Route php_stat() via streams/url_stat API (php_stream_stat_path).
This enables fopen-wrappers support on stat() and related family calls.
2003-11-28 23:25:28 +00:00
Wez Furlong
3ee72aa5be port "liveness" checks and a couple of other things from the 4.3 branch.
Liveness checks are used to validate persistent socket connects when they
are re-used.
2003-11-27 17:39:01 +00:00
Derick Rethans
3ab8d263b8 - Always store the URI path in the streams structure, and expose it with
stream_get_meta_data().
2003-11-03 14:12:46 +00:00
Ilia Alshanetsky
4d98e9ec97 Finalize the closing process of persistent streams. The current
behavior/API is as follows:

1) To close a persistent use php_stream_pclose(), it will close the stream
and remove it from the persistent list.

2) Inside PHP code only explicit fclose() will close persistent streams,
all other actions such as unset() or assigning a value to stream handle
will not.

3) Regular streams can still be closed by either fclose(), unset() or an
assignment of a value to the stream handler.
2003-07-29 18:26:34 +00:00
Wez Furlong
5ecc91c27d Merge selectable descriptor casting from PHP_4_3 branch. 2003-06-28 11:24:47 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sara Golemon
65d359d71a Fold 'options' parameter into wops->unlink method 2003-05-14 15:12:07 +00:00
Sara Golemon
5126fbe556 Setup unlink() method in wrapper_ops structure, implement unlink in plainfiles wrapper, explicitly set method NULL in other wrappers (for now), and rewrite unlink userland function to call into wrapper_ops 2003-05-14 06:10:04 +00:00
Sara Golemon
0c366c24e5 Macro: php_stream_get_from_zval(php_stream *stream, zval **zstream, char *mode, int options, char **opened_path, php_stream_context *context) Z_TYPE_PP(zstream) can be either IS_RESOURCE (An already opened stream) or IS_STRING (a path to a stream to be opened) 2003-04-17 00:00:34 +00:00
Wez Furlong
86fb577d59 Implement persistent plain file streams.
Usage:

php_stream *stream = php_stream_fopen("/path/to/file", "r+b", NULL,
	STREAM_OPEN_PERSISTENT | ENFORCE_SAFE_MODE | REPORT_ERRORS);

the filename and mode are combined to form the hash key for the persistent
list; they must be identical for this same stream to be returned again in the
next request.

Calling php_stream_close() on a persistent stream *will* close it, as is
usual with all persistent resources in PHP/ZE.

This is deliberately *not* exposed to user-space PHP at this time.
2003-03-18 23:37:54 +00:00
Wez Furlong
cfd8150b30 Add a generic meta data api for streams. 2003-02-27 19:10:24 +00:00
Wez Furlong
fd61f69077 Another big commit (tm).
Main Changes:
- Implement a socket transport layer for use by all code that needs to open
  some kind of "special" socket for network or IPC.
- Extensions can register (and override) transports.
- Implement ftruncate() on streams via the ioctl-alike option interface.
- Implement mmap() on streams via the ioctl-alike option interface.
- Implement generic crypto API via the ioctl-alike option interface.
  (currently only supports OpenSSL, but could support other SSL toolkits,
  and other crypto transport protocols).

Impact:
- tcp sockets can be overloaded by the openssl capable sockets at runtime,
  removing the link-time requirement for ssl:// and https:// sockets and
  streams.
- checking stream types using PHP_STREAM_IS_SOCKET is deprecated, since
  there are now a range of possible socket-type streams.

Working towards:
- socket servers using the new transport layer
- mmap support under win32
- Cleaner code.

# I will be updating the win32 build to add the new files shortly
# after this commit.
2003-02-27 17:43:38 +00:00
Sascha Schumann
60dcebd71a rename macro argument so that it does not partially match the string.
fixes a warning on unixware
2003-02-27 10:07:12 +00:00
Ilia Alshanetsky
862634ffa5 Added locking to streams.
Allow PHP to automatically release locks on files when terminating the
stream.
Fixed bugs in the handling of the 3rd optional parameter to flock().
2003-02-25 01:39:06 +00:00
Wez Furlong
088e2692c3 MFB: Bunch of streams related fixes. 2003-02-24 21:40:23 +00:00
Wez Furlong
32165a5546 Implement new filter API, stage 1.
This breaks user-space filters (for the time being), and those
weird convert.* filters in ext/standard/filters.c

The filters stack has been separated into one chain for read and one chain
for write.

The user-space stream_filter_append() type functions currently only operate
on the read chain. They need extending to work with the write chain too.
2003-02-18 01:22:21 +00:00
Wez Furlong
6e296c5cbb Move some of the streams header into supplementary files
# Just when you thought you had learned your way around the streams code;
# I like to keep you all on your toes!
2003-02-17 00:20:38 +00:00
Wez Furlong
35878992d8 Moving away from ANSI stdio for plain files. 2003-02-13 13:40:34 +00:00
Ilia Alshanetsky
f98ea4c46d Added feature request #9173 (added stream_get_line(), this function will
read either the specified number of bytes or until the ending string is
found).
2003-02-09 20:43:05 +00:00
Ilia Alshanetsky
a592f3cc56 Added missing definitions. 2003-02-07 22:49:21 +00:00
Wez Furlong
52a3c29e22 Fix for bug #21406; infinite loop during filter flushing. 2003-01-06 14:00:57 +00:00
Sara Golemon
42e912da79 Expose stream_filters_hash so that it can be searched by stream_get_filters() 2003-01-06 04:06:40 +00:00
Derick Rethans
da9eb594c6 - Fix warnings on UnixWare 2003-01-02 13:31:10 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Wez Furlong
ca58966a0d Merge streams changes from branch. 2002-11-18 11:39:42 +00:00
Marcus Boerger
a73e74c2f8 Make the macro use the function and not the other macro as discussed
with Wez.
2002-11-06 00:17:44 +00:00
Marcus Boerger
1f0b200188 php_stream replacement for fprintf
#Agreed by Wez - I will use this mysel soon.
2002-11-06 00:15:24 +00:00
Marcus Boerger
8f6120fef4 correct define: silences compiler warning in http_fopen_wrapper.c 2002-11-05 11:10:06 +00:00
Ilia Alshanetsky
728eacbf52 A better fix for bug #20110. 2002-10-28 03:45:21 +00:00
Wez Furlong
dabf1053cd Refine stream_select() to work with streams that have data in their read
buffers.
When selecting for read, the streams are examined; if any of them have
pending read data, no actual select(2) call is performed; instead the
streams with buffered data are returned; just like a regular select
call.
Prevent erroneous warning in stream_select when obtaining the fd.
2002-10-21 22:54:37 +00:00
Wez Furlong
829f1855fd made fgets() binary safe.
php_stream_gets is now a macro which calls php_stream_get_line. The latter
has an option argument to return the number of bytes in the line.
Functions like fgetcsv(), fgetss() can be made binary safe by calling
php_stream_get_line directly.

# HEADS UP: You will need to make clean after updating your CVS, as the
# binary signature has changed.
2002-10-19 13:11:48 +00:00
Ilia Alshanetsky
4b83b189fe Fixed bug #19971 (optimized the file() function).
The file() function is now also binary safe.
2002-10-18 20:39:49 +00:00