Commit Graph

202 Commits

Author SHA1 Message Date
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Gustavo André dos Santos Lopes
5c09767d4b - Fixed bug #53198 (changing INI setting "from" with ini_set did not have any
effect)
#Made "from" a proper INI setting and bound it to a global variable.
#Previously, it was simply read from the hash table with the parsed ini file
#by using cfg_get_string (I wonder why this mechanism still exists...)
2010-10-29 15:29:15 +00:00
Pierre Joye
4cda8a7797 -fix logic (and BC break) 2010-08-23 18:05:05 +00:00
Pierre Joye
a0e223b8ba - add follow_location support for http stream, enabled by default to keep BC. Allows one to ignore the location header, w/o having to ignore errors or other tricks, the location data is however still available (meta) 2010-08-23 16:54:57 +00:00
Pierre Joye
7bd81da0b5 - WS 2010-08-16 10:29:01 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Jani Taskinen
5952473b7a - Fixed bug #50832 (HTTP fopen wrapper does not support passwordless HTTP authentication) 2010-01-25 16:28:13 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Ilia Alshanetsky
d56c1fdf14 Fixed bug #50451 (http wrapper breaks on 2048 char long headers)
# Improvement on the fix for bug #49851
2009-12-13 15:44:22 +00:00
Ilia Alshanetsky
47b3371122 Fixed bug #49851 (http wrapper breaks on 1024 char long headers). 2009-12-10 03:23:05 +00:00
Felipe Pena
f61a06350a - Switching to TSRMLS_FETCH version 2009-11-16 10:36:27 +00:00
Felipe Pena
5411bb32a8 - Fixed bug #49936 (crash with ftp stream in php_stream_context_get_option())
(patch by Pierrick)
2009-11-15 20:30:57 +00:00
Antony Dovgal
307a2259e9 fix memleak and possible segfault in HTTP fopen wrapper 2009-08-04 09:24:48 +00:00
Jani Taskinen
be6338014a - Fixed bug #43510 (stream_get_meta_data() does not return same mode as used in fopen) 2009-08-01 03:17:31 +00:00
Jani Taskinen
c0aab038ba Fixed bug #48929 (Double \r\n after HTTP headers when "header" context option is an array) 2009-07-20 10:54:37 +00:00
Arnaud Le Blanc
a5db3627e5 Fixed bug #38802 (max_redirects and ignore_errors)
(patch by datibbaw@php.net)
2009-05-16 20:34:48 +00:00
Greg Beaver
7aabee2ec6 MFH: fix potential free of NULL 2009-05-14 13:36:56 +00:00
Jani Taskinen
0b4875313a MFH: - Fixed Bug #45092header HTTP context option not being used (--with-curlwrappers) 2009-05-05 00:31:56 +00:00
Jani Taskinen
6611eb0b98 - Sync with HEAD 2009-05-05 00:16:21 +00:00
Dmitry Stogov
679c6298e3 - Added "dechunk" filter which can decode HTTP responces with chunked transfer-encoding. HTTP streams use this filter automatically in case "Transfer-Encoding: chunked" header presents in responce. It's possible to disable this behaviour using "http"=>array("auto_decode"=>0) in stream context
- Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked")
2009-04-16 10:16:27 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Arnaud Le Blanc
738346fd92 MFH: Fixed previous fix 2008-07-29 13:57:43 +00:00
Arnaud Le Blanc
0f9026daf9 MFH: When automatically redirecting an HTTP request, use the GET method when the
original method was not HEAD or GET (fixes #45540)
#
# The RFC says that in case of 3xx code, "The action required MAY be
# carried out [...] *only if the method used in the second request is GET or
# HEAD*".
#
# This may not break anything as actually POST requests replying
# with a Location header never worked as the redirecting request was sent using
# the POST method, but without Entity-Body (and without Content-Length header,
# which caused the server to reply with a "411 Length Required" or to treat
# the request as GET).
#
2008-07-28 19:08:02 +00:00
Michael Wallner
15da8367c4 - Changed HTTP stream wrapper to accept any code between and including
200 to 399 as successful. (patch by Noah Fontes)
2008-07-25 08:27:37 +00:00
Antony Dovgal
cf7e15c3a0 MFH: manage references of stream context properly 2008-07-11 10:25:15 +00:00
Dmitry Stogov
2ecf4bb0a7 Lazy EG(active_symbol_table) initialization 2008-04-29 08:15:20 +00:00
Ilia Alshanetsky
8d8e9d273b Fixed bug #44603 (Order issues with Content-Type/Length headers on POST) 2008-04-06 15:21:24 +00:00
Ilia Alshanetsky
016ee0bf39 WS 2008-01-07 15:13:17 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Derick Rethans
2ac81c2e6e - MFH: Fixed a segfault when reading from an HTTP stream. 2007-11-29 12:28:15 +00:00
Sara Golemon
f75ae01f09 MFH: http/ignore_errors context option 2007-11-05 01:00:43 +00:00
Jani Taskinen
6723ed1db3 MFH: Nuked ending dots from error messages 2007-09-30 05:49:45 +00:00
Hannes Magnusson
5eb0037584 MFH: Plug leak when trying to write via the http wrapper 2007-04-23 16:37:28 +00:00
Ilia Alshanetsky
efad70c2cc snprintf() -> slprintf() 2007-02-27 03:28:17 +00:00
Ilia Alshanetsky
aeddf73dc4 Fix win32 build 2007-01-19 00:17:43 +00:00
Ilia Alshanetsky
ef3fcf2894 Added read-timeout context option "timeout" for HTTP streams.
# A patch mostly by Hannes
2007-01-19 00:02:13 +00:00
Hannes Magnusson
a6ff74de28 Fix typo in error message 2007-01-14 14:22:40 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Ilia Alshanetsky
0776e56437 Use %F (ignores locale) for internal representation of floats 2006-12-25 16:48:18 +00:00
Antony Dovgal
5e7eed6a9a MFH: nuke redundant zval_ptr_dtor() call 2006-12-05 18:42:38 +00:00
Hannes Magnusson
7a6fe06e4b url->URL 2006-06-29 14:40:49 +00:00
Ilia Alshanetsky
74672b86b4 Fixed a typo in the previous patch.
# Thanks Tony
2006-04-16 17:40:33 +00:00
Ilia Alshanetsky
79d8f014da Fixed bug #37045 (Fixed check for special chars for http redirects). 2006-04-16 16:54:49 +00:00
Ilia Alshanetsky
a33d64e7b6 Fixed bug #36857 (Added support for partial content fetching to the HTTP
streams wrapper).
2006-03-26 17:12:05 +00:00
Ilia Alshanetsky
0621bcc9e1 Allow get_headers() to return header information even for non-200 responses. 2006-01-20 01:40:32 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Ilia Alshanetsky
a74463e9bd Fixed bug #35629 (crash in http:// wrapper on multiple redirects). 2005-12-12 05:04:15 +00:00
Antony Dovgal
ca42324497 php_stream_get_line() is a macro and it already has TSRMLS_CC 2005-12-09 18:53:09 +00:00
Ilia Alshanetsky
644cf05505 Fixed bug #34359 (Possible crash inside fopen http wrapper). 2005-12-08 02:53:08 +00:00
Sara Golemon
2b059ae91f MFH: (r-1.104) 2005-12-06 19:15:41 +00:00
Ilia Alshanetsky
c4da6009bb MFH: Fixed possible crash in http:// wrapper. 2005-11-15 14:46:34 +00:00
Dmitry Stogov
0988162649 Fixed memory corruption 2005-09-21 15:55:07 +00:00
Dmitry Stogov
3d41ebf595 Allow fopen() make HTTPS requests throug HTTP proxies 2005-09-21 15:04:26 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Ilia Alshanetsky
6be7584eba Properly recognize redirect code 303.
When encountering redirect on POST request follow browsers and cURL and
perform GET on the specified location field.
2005-07-14 14:59:16 +00:00
Derick Rethans
c6ae4a98be - Fixed bug #33242 (Mangled error message when stream fails). 2005-06-06 12:39:57 +00:00
Ilia Alshanetsky
3ae10919c4 Added max_redirects context option that specifies how many HTTP redirects
to follow.
2005-05-06 02:31:07 +00:00
Ilia Alshanetsky
b874c94d81 Missing bit from previous patch. 2005-05-06 02:20:00 +00:00
Ilia Alshanetsky
a63f5d1c3f Fixed bug #32936 (http redirects URLs are not checked for control chars). 2005-05-06 02:13:46 +00:00
Anantha Kesari H Y
549ec65eee removed redundant NEW_LIBC checks 2004-09-27 15:55:04 +00:00
Sara Golemon
532a79aa52 *** empty log message *** 2004-09-08 23:37:55 +00:00
Sara Golemon
92c4a37a6a Chunk Length may optionally be followed by whitespace 2004-09-07 22:46:24 +00:00
Sara Golemon
a85bff9796 Protocol version context option and chunked transfer encoding 2004-09-07 19:27:11 +00:00
Sara Golemon
93f795bb9e Add proxy support to ftp using http wrapper 2004-07-24 04:01:48 +00:00
Stefan Esser
23813d603c Fixed off-by-one in http_fopen_wrapper 2004-05-28 13:38:06 +00:00
Sara Golemon
d5e0742e8d In-HEAD bugfix# 28115 2004-04-23 03:37:20 +00:00
Ilia Alshanetsky
d45b2c6bc3 MFH: Fixed bug #27628 (Simplify the process of making a POST request via
stream context).
2004-03-19 15:41:26 +00:00
foobar
639073bd2a MFB: typofix 2004-02-26 00:13:30 +00:00
Ilia Alshanetsky
0f5f7c6dd0 Handle situation where feof() occurs before the HTTP header is retrieved. 2004-02-26 00:02:27 +00:00
Sebastian Bergmann
184b379fd7 ZTS fix. 2004-02-25 09:36:46 +00:00
Ilia Alshanetsky
895f244236 Fixed bug #27383 (Potential crash inside fopen_wrapper, while parsing
response code).
2004-02-24 21:52:40 +00:00
Sara Golemon
18588497d7 Fix potential bug in http:// proxy support.
Some proxy servers require entire URI be sent in request string.

Add context option "http"/"request_fulluri" to allow this behavior.
2004-01-30 00:24:18 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +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
5ad67a9215 Add http proxy support via context option. 2003-12-03 05:30:16 +00:00
Sascha Schumann
6a7dde29e7 kill warnings 2003-08-28 16:28:33 +00:00
Sara Golemon
82ddb23338 Loosen restrictions on method used with http_fopen_wrapper, still default to GET though. 2003-06-13 19:27:26 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +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
Wez Furlong
169b3f72ed Fix for #23340; fopen on multiple urls from the same server crashes. 2003-04-28 14:41:36 +00:00
Ilia Alshanetsky
3d6fccc08c Fixed bug #23152 ($http_response_header empty on invalid URLs) 2003-04-14 13:55:34 +00:00
Sara Golemon
70155b6dcf Introduce support for context options 'method', 'header', 'content' 2003-04-07 21:02:04 +00:00
Ilia Alshanetsky
53530765ff Added support for http redirects to ftp.
Fixed bug #22508 (Added protection against circular HTML redirects).
2003-03-04 16:04:05 +00:00
Wez Furlong
76ebaa6ee7 - Move https:// and ftps:// wrapper registration into the openssl module.
- Expose the http:// and ftp:// wrappers as PHPAPI
- Remove unused variables
2003-02-27 18:16:35 +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
69094da0e8 Revert accidental commit. 2003-02-20 00:34:03 +00:00
Ilia Alshanetsky
3bff5c0419 Fixed bug #22308 (optimized passthru, code is now ~40 times faster). 2003-02-20 00:32:51 +00:00
Ilia Alshanetsky
a6ef609a37 Fixed bug #22283 (possible crash when opening relative URLs). 2003-02-19 00:49:31 +00:00
Zeev Suraski
4934744b93 Win32 build improvements 2003-02-17 13:29:59 +00:00
Wez Furlong
0a18a9d744 A add much more useful select(2) implementation than is provided by
windows sockets.  The winsock implementation will only work with sockets;
our implementation works with sockets and file descriptors.
By association, stream_select() will now operate correctly with files, pipes and sockets.

This change required linking against the winsock2 library.  In terms of
compatibility, only older versions of windows 95 do not have winsock2
installed by default.  It is available as a redistributable file, and is most likely installed by any OS patches (eg: Internet Explorer) applied by the user.

Also, add a win32 compatible pipe test when opening a stream from a pipe.  This test will only work on NT, win2k and XP platforms.  Without this test, interleaved fread() and select() calls would cause the read buffer to be clobbered.  I will be working on a fix for this issue for win9x.
2003-02-16 03:48:49 +00:00
Ilia Alshanetsky
f8eba6ded2 Added 'x' mode for fopen() used on local files. This mode will create a new
file only if a file does not already exist (O_CREAT|O_EXCL).
2003-02-13 14:40:17 +00:00
Wez Furlong
1c3de808b9 Avoid problems with chunk_size and auto_detect_line_endings. 2003-02-13 13:38:20 +00:00
Sara Golemon
3631b28f44 chunk_size should always be reduced to 1 while scanning response headers to avoid buffering the actual stream prior to any read calls. 2003-02-07 23:44:58 +00:00
Ilia Alshanetsky
71ab7dfccc Fixed a memory leak that occurs if the location specified by redirect header
cannot be opened.
2003-01-03 17:12:35 +00:00
Ilia Alshanetsky
c52cdad25a Further fixes related to bug #21267. 2003-01-03 17:05:16 +00:00
Sebastian Bergmann
b506f5c8f8 Bump year. 2002-12-31 16:08:15 +00:00
Ilia Alshanetsky
88d26985b8 Fixed bug #21267 (opening URLs that result in redirection to a relative
path was failing).
2002-12-29 20:01:33 +00:00
Marcus Boerger
49a99a98f4 -php_error -> php_error_docref
-removed some cases where emalloc result was tested
2002-12-05 20:59:49 +00:00
Wez Furlong
3a8c49afc1 Make PHP follow 301 correctly.
# There may be other cases that need handling properly; I'll have to spend
# some time investigating why we even need special cases now; it's got
# something to do with Ilia's patch to fix memory leaks.
2002-10-13 01:03:43 +00:00