Commit Graph

319 Commits

Author SHA1 Message Date
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
f400f0e665 add an open mode for the memory streams that allows the stream to take
ownership of the passed-in buffer
2005-02-06 21:41:36 +00:00
Ilia Alshanetsky
d98a44d483 Fixed bug #29801 (Set limit on the size of mmapable data). 2004-11-15 23:43:12 +00:00
Rob Richards
d563495a24 add support for file://localhost/
support file:/// under windows again
2004-11-11 13:08:32 +00:00
Antony Dovgal
aa35b11afe fix Win32 & Netware build 2004-10-28 05:05:20 +00:00
Antony Dovgal
ceacc834fb fix bug #30388 (rename across filesystems loses ownership and permission info) 2004-10-27 11:58:49 +00:00
Ilia Alshanetsky
5c04e39383 Fixed bug #30362 (stream_get_line() not handling end string correctly). 2004-10-11 18:31:49 +00:00
Wez Furlong
b7182e85c7 Fix the return value check too 2004-10-11 01:40:41 +00:00
Wez Furlong
7cb4e769ff check the correct flag for async connect 2004-10-11 01:30:19 +00:00
Christian Stocker
bd99d77bf6 - Fixed bug #27183 (Userland stream wrapper segfaults on stream_write)
Was applied to PHP 4 ages ago, but not to PHP 5 branch
2004-10-08 14:40:11 +00:00
Anantha Kesari H Y
b855337d39 CLIB_STAT_PATCH check is redundant. So removing it 2004-09-23 13:07:43 +00:00
Wez Furlong
ff4e970fb1 Make new poll stuff work on win32 (and still be safe on unix) 2004-09-17 14:36:55 +00:00
Wez Furlong
99e290f882 Fix for Bug #24189: possibly unsafe select(2) usage.
We avoid the problem by using poll(2).

On systems without poll(2) (older bsd-ish systems, and win32), we emulate
poll(2) using select(2) and check for valid descriptors before attempting
to access them via the descriptor sets.

If an out-of-range descriptor is detected, an E_WARNING is raised suggesting
that PHP should be recompiled with a larger FD_SETSIZE (and also with a
suggested value).

Most uses of select(2) in the source are to poll a single descriptor, so
a couple of handy wrapper functions have been added to make this easier.

A configure option --enable-fd-setsize has been added to both the unix and
win32 builds; on unix we default to 16384 and on windows we default to 256.
Windows FD_SETSIZE imposes a limit on the maximum number of descriptors that
can be select()ed at once, whereas the unix FD_SETSIZE limit is based on the
highest numbered descriptor; 256 should be plenty for PHP scripts under windows
(the default OS setting is 64).

The win32 specific parts are untested; will do that now.
2004-09-17 12:44: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
9cd4320b65 Allocating hash tables should be done via macro, not directly 2004-09-13 21:07:22 +00:00
Sara Golemon
ed5dcbff9b A little extra code to allow overriding plainfiles wrapper as well 2004-09-10 21:50:29 +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
d179ac771c Handle maxlen when stream can't be mmaped 2004-09-08 18:42:15 +00:00
Antony Dovgal
fd6d9cbeac fix bug #29723 (file_get_contents() fails with the file:// wrapper under Win32) 2004-08-31 11:37:02 +00:00
Ilia Alshanetsky
c84bd49fb5 Using int when long should be used. 2004-08-22 18:05:24 +00:00
Wez Furlong
b21a7357fc Fix for #29256 from Dmitry, very slightly modified 2004-08-10 13:44:43 +00:00
Wez Furlong
d0be029908 zts fix... 2004-07-31 16:34:44 +00:00
Wez Furlong
ae7285d658 Misc sendto/recvfrom tweaks that have been pending here for a while... 2004-07-31 10:56:55 +00:00
Wez Furlong
05a3fabacb Make sure this is initialized... 2004-07-31 10:49:09 +00:00
Wez Furlong
71078de71a Implement an fstat cache for plain files. 2004-07-31 10:09:25 +00:00
Wez Furlong
971fcd4254 Looks like Sara forgot to change this too. 2004-07-13 16:34:56 +00:00
Wez Furlong
ae40d0ef2a Fix file_get_contents() bug... 2004-07-12 20:59:24 +00:00
Wez Furlong
cd732f1a3f RIP: greedy ready problems
This allows people to use fread($fp, filesize($filename)) for regular files,
but packet-based non-greedy reads for everything else.
2004-07-10 10:54:09 +00:00
Wez Furlong
8f435013ff Fix for Bug #28964 fread "greedy" behaviour 2004-06-29 21:51:53 +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
Wez Furlong
b369925372 Fix #25939 for good this time.
# How could I miss this??
2004-05-27 13:04:14 +00:00
Wez Furlong
dd9ac710f1 Fix silly mistake.
Thanks Antony :)
2004-05-26 21:19:21 +00:00
Wez Furlong
6873d6839d *sigh*, obviously, we need this to be able to use sapi_module.name 2004-05-25 13:23:20 +00:00
Wez Furlong
ff0ee48537 DEBUG -> PHP_DEBUG 2004-05-25 13:17:01 +00:00
Wez Furlong
146255f35c check if it matches... not if it doesn't... 2004-05-25 13:00:25 +00:00
Wez Furlong
c6dff79138 In debug mode, under CLI don't close stderr.
This is so that we can see any error reports.

# for extra paranoia, could limit this check to happen only after the script is
# finished running.
2004-05-25 12:59:15 +00:00
Sara Golemon
0dae58bb2a Bugfix #28300 Userspace stream/filter names don't need to be lowercased. 2004-05-06 14:29:33 +00:00
Sara Golemon
0180c36951 BugFix#28287 stream_*_register() not calling __autoload(). 2004-05-05 18:18:57 +00:00
Wez Furlong
0fb4bf9771 Fixed bug #19749 (shouldn't mmap() files larger than memory_limit) 2004-04-21 12:02:47 +00:00
Sara Golemon
fac9416797 Only wind filters when appending to the read chain. 2004-04-01 03:52:34 +00:00
Sara Golemon
002f7ef393 This leaks when a stream opener proxy opens another stream. 2004-04-01 01:07:54 +00:00
Sara Golemon
72616e6eae BugFix#27619
Filters not applied to pre-buffered stream data.
(esp. http:// streams)
2004-03-31 23:48:59 +00:00
Sara Golemon
581948ab00 Provide a meaningful error message when registration fails 2004-03-17 00:08:22 +00:00
Ilia Alshanetsky
88058e5715 Fixed bug #27498 (bogus safe_mode error on nonexistent directories for
chdir() and opendir() functions).
2004-03-16 23:23:17 +00:00
Ard Biesheuvel
b303ba089c More wordsize fixes 2004-03-08 23:11:45 +00:00
Wez Furlong
70757063a7 add cast for qsort compare function.
Kinda ugly, but helps assert that we are doing the right thing as well as
kill the warning there.
2004-03-07 22:06:36 +00:00
Wez Furlong
1e35cf4f32 Connect feof() call to user-space stream feof() method.
Fixes Bug #27417 and #27508
2004-03-07 22:05:21 +00:00
Wez Furlong
0dd2280102 Less magic please 2004-03-07 21:36:55 +00:00
Jon Parise
4db900732d Cast the php_stream_dirent to a 'const char *' for estrndup() to avoid a
compiler warning.
2004-03-01 07:02:23 +00:00
Sara Golemon
860daac5d8 Must addref the resource when we make a new zval reference to it that will be exported to userspace. 2004-03-01 05:33:19 +00:00
Hartmut Holzgraefe
8c32fa79d7 EXTERN_C wrapping for PHPAPI prototypes
(Zend and main should now be ok)
2004-02-20 08:22:12 +00:00
Wez Furlong
a44838e8a3 Fix a bug in the persistent socket liveness checks and feof(); they were
using the default socket timeout of 60 seconds before returning the socket
to the calling script.  The reason they were using that value is that the
same code is used for feof(), so the fix is allowing the caller to
indicate the timeout value for liveness checks.

A possible remaining issue now is that 0 second timeout[1] for pfsockopen
is possibly too short; it's impossible to specify a sane value for all
possible uses, so maybe we need a stream context or an .ini option to
control this, or maybe use the timeout value that was passed to
pfsockopen().

# [1] by timeout, I mean the time that PHP will wait for data on a
# persistent socket before deciding if a new connection should be made;
# NOT the timeout while waiting for a new connection to be established.
2004-02-04 22:46:44 +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
Wez Furlong
e1ae61802b Fix segfault for scripts like this:
<?php
pfsockopen("foo");
pfsockopen("foo");
?>
Where the transport fails to connect (since args are bogus);
the problem was that the persistent stream entry was not
correctly freed.
2004-01-27 22:40:44 +00:00
Ilia Alshanetsky
4cc62a06f6 Removed unused variable. 2004-01-27 03:20:35 +00:00
Hartmut Holzgraefe
234e8a76c4 stream_lock() method added to userspace streams wrapper 2004-01-21 10:17:12 +00:00
Ilia Alshanetsky
eb3ff409b0 Fixed bug #26974 (rename() doesn't check the destination file
against safe_mode/open_basedir).
2004-01-21 02:28:50 +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
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Wez Furlong
ab11c8c5ba MFB fix for #25597 2003-12-20 20:25:55 +00:00
Ilia Alshanetsky
1128955aa4 Fixed compiler warnings. 2003-12-14 18:23:15 +00:00
Sara Golemon
822ea95785 Export STREAM_MKDIR_RECURSIVE constant 2003-12-13 23:13:51 +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
Wez Furlong
ab0029cabf Be smarter about which systems should register unix transports.
Fix skip conditions in these network tests
2003-12-05 13:41:02 +00:00
Sara Golemon
dacb3a68fe Register url_stat flag constants in userspace 2003-12-02 20:06:40 +00:00
Sara Golemon
1aaf7da2ce Populate userstream objects with context property 2003-12-02 19:14:31 +00:00
Sara Golemon
88ccc6a630 Update userspace/url_stat proto 2003-12-02 18:52:58 +00:00
Wez Furlong
da9093be3a this can't be persistent 2003-12-02 16:35:19 +00:00
Sara Golemon
dbfe62117b CS 2003-12-02 01:04:14 +00:00
Sara Golemon
681d18effd Move safemode/basedir checks for url_stat to plain_wrapper. 2003-12-01 19:47:05 +00:00
Ilia Alshanetsky
c344754d48 Removed unused variables. 2003-11-30 19:43:30 +00:00
Wez Furlong
37f135ceef Add stream_socket_sendto and stream_socket_recvfrom which work very much
like sendto() and recvfrom() syscalls.
2003-11-29 21:46:50 +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
6d86bb9e40 (sort of) MFB, feof fix for sockets. 2003-11-28 23:20:23 +00:00
Ilia Alshanetsky
baced1d63d Fixed a memory leak. 2003-11-28 00:00: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
Sara Golemon
0831f2b03a Fix for file:// wrapper parsing.
(Cristiano Duarte <cunha17@uol.com.br>)
2003-11-23 17:35:00 +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
Sara Golemon
495fd01ca4 Stop looking once we've found a matching filter. 2003-10-28 23:29:16 +00:00
Sara Golemon
c9b49af990 Extend Filter matching to check wildcards at multiple levels.
Ex:  foo.bar.baz.bomb
Searches:
     foo.bar.baz.bomb itself,
     foo.bar.baz.*,
     foo.bar.*, and
     foo.*

Also changed tempvar "char wildcard[128];" to an estrdup() to
deal with potential filternames longer than 127 bytes.
2003-10-28 21:52:59 +00:00
Shane Caraveo
3a6ff32e2b finish file uri support, this stuff was unecessary. 2003-10-19 21:19:54 +00:00
Shane Caraveo
2a41429472 A simpler patch to add file uri support 2003-10-19 20:59:12 +00:00
Shane Caraveo
0029a45795 revert file: support in preparation for simpler patch 2003-10-19 20:57:20 +00:00
Shane Caraveo
e5103d764a make file uri's work with streams 2003-10-19 20:04:33 +00:00
Wez Furlong
590b3ccc79 Set the EOF indicator after each read attempt.
This prevents it getting stuck in the on position.
2003-10-08 10:55:51 +00:00
Marcus Boerger
3cf2d2f108 Show the whole message when in debug mode 2003-09-13 19:56:38 +00:00
Ard Biesheuvel
f940b0fe3c Pointer size fix 2003-09-13 19:43:39 +00:00
Ard Biesheuvel
6f37733367 Fixed for 64bit archs 2003-09-13 15:27:09 +00:00
Ilia Alshanetsky
ef23b497d4 Fixed bug #25316 (Possible infinite loop inside _php_stream_write()). 2003-09-11 05:07:26 +00:00
Ilia Alshanetsky
0a3d5c9b08 Fixed bug #25429 (fix copying of stdin using copy() function) 2003-09-10 00:58:12 +00:00
Ilia Alshanetsky
9d9727aac5 Fixed compiler warnings. 2003-08-28 19:17:34 +00:00
Sascha Schumann
af8e15b8db kill warnings 2003-08-28 17:07:40 +00:00
Ilia Alshanetsky
a326bde2e8 Prevent a crash when expand_filepath() fails. 2003-08-27 01:10:10 +00:00
Sascha Schumann
602d1b0045 One bit fields need to be unsigned, otherwise there is no storage for
the sign bit

"A signed bit field has a length of 1 bit."
2003-08-17 13:49:52 +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
Ilia Alshanetsky
37ee0e57cc Fixed a double free bug when freeing persistent streams. 2003-07-28 18:57:28 +00:00
Wez Furlong
5cf5248b00 Fix for mips compiler. 2003-07-14 19:38:13 +00:00
Wez Furlong
fa342d2404 MFB: binary mode by default under win32. 2003-07-05 08:25:25 +00:00
Sara Golemon
444615e74c Introduce connection pooling API. I'll use these in http/ftp fopen wrappers soon. 2003-07-02 22:18:59 +00:00
Wez Furlong
49228bd5e2 more size_t -> socklen_t.
Noticed by tychay@php.net
2003-07-02 21:11:35 +00:00
Wez Furlong
989500b347 socklen_t needs this.
We might need some more magic to ensure that socklen_t gets defined in
the correct places; lets see if any more problems arise...
2003-07-02 01:35:39 +00:00
Wez Furlong
17cbf83404 size_t -> socklen_t
fixes warnings under macosx
2003-07-01 19:51:06 +00:00
Wez Furlong
5ecc91c27d Merge selectable descriptor casting from PHP_4_3 branch. 2003-06-28 11:24:47 +00:00
Wez Furlong
c0c20ef6f6 Fix for mips compiler 2003-06-28 11:06:11 +00:00
Sara Golemon
2e4ef86e10 MFB
Plug leak in context notifiers, implement notifier->dtor
2003-06-27 16:23:58 +00:00
Sara Golemon
ac79577776 MFB PHP_4_3 main/streams.c r-1.125.2.70 2003-06-27 04:27:18 +00:00
Sara Golemon
730ce7b06f Add context property to userspace streams object. 2003-06-16 19:13:39 +00:00
Sara Golemon
2f4e91bf8a optionvalue is being copied via zval_copy_ctor, there's no need to addref the original 2003-06-16 18:19:14 +00:00
Edin Kadribasic
6e2743023b Win32 build fixes for openssl 2003-06-15 23:34:46 +00:00
Marcus Boerger
f304458bdb Fix ZTS mode (hopefully all is working fine now again) 2003-06-14 19:30:42 +00:00
Sara Golemon
99db19661a Plug leak (context options not freed)
Make contexts auto-registered, ensures userland contexts
and C API contexts are both dealt with on request shutdown.
Also brings contexts in keeping with streams which are already
auto-registered.
2003-06-13 21:33:59 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Hartmut Holzgraefe
ac2606bf58 fix for crashbug with user level wrapper implementations of stream_stat 2003-05-29 20:19:03 +00:00
Wez Furlong
2d1a6e5dc2 MFB context refcounting and text-mode fopen fixes 2003-05-21 13:33:55 +00:00
Sara Golemon
83b7b75c3c Implement default contexts. For the moment this is useless
but it will be used soon for connection pooling.
2003-05-21 04:04:50 +00:00
Hartmut Holzgraefe
b5bef8f7b3 always return timestamps as 'atime', 'mtime' and 'ctime'
no matter what names the underlying platform uses for them
2003-05-20 13:09:11 +00:00
Wez Furlong
192f632e2e MFB fix for persistent streams recycling. 2003-05-19 22:58:34 +00:00
Marcus Boerger
f10a7b90b2 Fix warning 2003-05-19 18:48:15 +00:00
Marcus Boerger
1b0fdbf63a Fix memleaks 2003-05-19 18:46:59 +00:00
Derick Rethans
92f0da58e6 - Rename stream_register_filter() to stream_filter_register(),
stream_register_wrapper() to stream_wrapper_register() and added an alias for
  the latter change.
2003-05-19 15:35:06 +00:00
Sebastian Bergmann
85a13e3e9a Fix warnings. 2003-05-17 06:21:34 +00:00
Sara Golemon
44743cf9ec Implement userspace wrapper support for unlink method 2003-05-14 18:30:49 +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
Marcus Boerger
b09aa87120 Don't access what is already freed (noticed by Sascha) 2003-04-16 17:30:03 +00:00
Moriyoshi Koizumi
49b43ad115 Changed stream filter factory to be capable of accepting a zval as a parameter
instead of a string
2003-04-16 14:30:25 +00:00
Marcus Boerger
75c8f37c03 Make it static 2003-04-13 20:30:57 +00:00
Marcus Boerger
887d5ec9c1 Speling 2003-04-13 20:12:54 +00:00
Marcus Boerger
bff63db577 Fix persistent stream closing (that one took me at least 3 days) 2003-04-13 19:47:55 +00:00
Sara Golemon
d6c24de842 Add IPv6 support to stream_socket_client/server() 2003-04-05 02:42:12 +00:00
Sara Golemon
c985b780a5 Prevent php_stream_get_record from grabbing more than maxlen characters 2003-04-04 01:34:00 +00:00
Moriyoshi Koizumi
8d2dd87d89 Fixed bug #22538 (stream filter problem) 2003-03-31 23:22:10 +00:00
Ilia Alshanetsky
62909237c4 WS 2003-03-31 22:13:01 +00:00
Wez Furlong
e451d88399 Fix for persistent stream shutdown under debug builds 2003-03-20 01:23:04 +00:00
Wez Furlong
7379f47518 Sanity check for when a stream is requested to be persistent but the wrapper
does not respect the flag.
2003-03-19 00:17:15 +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
6a87651006 Q} 2003-03-18 22:26:02 +00:00
Wez Furlong
ce01fd9526 Avoid using FILE* where possible.
Tidy up handling of potential error situations for the php:// wrapper.
2003-03-18 16:40:29 +00:00
Wez Furlong
267db80b21 avoid unsigned issues. 2003-03-18 15:15:10 +00:00
Wez Furlong
7c2ccb5f65 Fix for #22721 (poor file() performance on systems without mmap) 2003-03-18 14:35:01 +00:00
Ilia Alshanetsky
e15cc99415 Win32 build fix. 2003-03-17 22:25:55 +00:00
Ilia Alshanetsky
27a7eaf4e7 Fixed bug #22538 (failed stat on stdio/stdin/stderr streams). 2003-03-17 18:32:15 +00:00
Wez Furlong
16e705a547 64bit fixes 2003-03-15 13:29:56 +00:00
Stefan Esser
af4aa97d1e Fixing functionicalls with variable number of parameters... 2003-03-06 20:31:20 +00:00
Ilia Alshanetsky
fb4dab36f4 Compiler warning fix. 2003-03-03 19:57:18 +00:00
Wez Furlong
c3e6bcd398 Ensure that all fields are initialized to NULL. 2003-03-01 17:27:23 +00:00
Wez Furlong
242166d601 Don't shutdown() unix sockets.
It causes the server end to close down/break.
2003-03-01 15:22:21 +00:00
Wez Furlong
a3cf1ab8f6 Folding fixes 2003-03-01 15:20:42 +00:00
Wez Furlong
349ce76f96 Tidy up stupid signed/unsigned issues with win32 by introducing a php_socket_t typedef. 2003-02-28 21:03:36 +00:00
Wez Furlong
1b53a2d12e New user-space functions:
. stream_socket_client() - similar to fsockopen(), but more powerful.
  . stream_socket_server() - Creates a server socket.
  . stream_socket_accept() - Accept a client connection.
  . stream_socket_get_name() - Get local or remote name of socket.

Tidy up some leaks and debug printfs.
Move more streams functions into streamsfuncs.c and streamsfuncs.h.
2003-02-28 19:53:21 +00:00
Wez Furlong
cd98ed7b0a Implement memory mapping for win32.
Could do with some rigorous testing; simple readfile() tests here appear to work.
2003-02-28 01:47:28 +00:00
Wez Furlong
cfd8150b30 Add a generic meta data api for streams. 2003-02-27 19:10:24 +00:00
Wez Furlong
203068d055 Fixup build for win32 2003-02-27 18:06:31 +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
Ilia Alshanetsky
5e118977cd Fixed various compiler warnings. 2003-02-25 01:44:57 +00:00
Ilia Alshanetsky
9e0fb1a33c Use native flock() whenever possible. 2003-02-25 01:41:58 +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
Moriyoshi Koizumi
4759048194 Removed unnecessary asserts 2003-02-24 23:13:40 +00:00
Wez Furlong
088e2692c3 MFB: Bunch of streams related fixes. 2003-02-24 21:40:23 +00:00
foobar
8e3f23e3c0 ws fixes + missing $Id$ tags, headers added 2003-02-19 08:40:19 +00:00
Wez Furlong
4c4d77d23e Fix incorrect TSRMLS_CC usage.
Fix com_create_guid()
2003-02-18 19:03:44 +00:00
Sara Golemon
6fe4ab41f0 Fix stream_filter_(ap|pre)pend to allow attaching on the read and/or write chains. Automagically decide what to do if noone tells us. 2003-02-18 02:53:24 +00:00
Wez Furlong
952d5f548e TSRMLS! 2003-02-18 01:39:26 +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
2cc68ad7ad Move streams files around a bit, to ease maintenance.
I will update the win32 .dsp in a moment.
2003-02-16 22:19:28 +00:00