Commit Graph

16 Commits

Author SHA1 Message Date
Michael Wallner
d29a01de3f Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed bug #61548

Conflicts:
	ext/standard/http_fopen_wrapper.c
2013-10-01 11:11:48 +02:00
Michael Wallner
18b04b480e Fixed bug #61548 2013-10-01 11:07:55 +02:00
Adam Harvey
8983a38d51 Request non-keep-alive connections by default in HTTP 1.1 requests.
As noted in FR #65634, at present we don't send a Connection request header
when the protocol version is set to 1.1, which means that RFC-compliant Web
servers should respond with keep-alive connections. Since there's no way of
reusing the HTTP connection at present, this simply means that PHP will appear
to hang until the remote server hits its connection timeout, which may be quite
some time.

This commit sends a "Connection: close" header by default when HTTP 1.1 (or
later) is requested by the user via the context options. It can be overridden
by specifying a Connection header in the context options. It isn't possible to
disable sending of the Connection header, but given "Connection: keep-alive" is
the same as the default HTTP 1.1 behaviour, I don't see this as a significant
issue — users who want to opt in for that still can.

As a note, although I've removed an efree(protocol_version), this doesn't
result in a memory leak: protocol_version is freed in the out: block at the end
of the function anyway, and there are no returns between the removed efree()
and the later call. Yes, I ran the tests with valgrind to check that. ☺

Implements FR #65634 (HTTP wrapper is very slow with protocol_version 1.1).
2013-09-11 14:11:29 -07:00
Gustavo André dos Santos Lopes
d1be77edfb - Fixed bug #60570 (http wrapper leaks context resource if request fails/is
redirected).
2011-12-21 15:44:58 +00:00
Gustavo André dos Santos Lopes
f24f2b4df6 - Fixed bug #60570 (http wrapper leaks context resource if request fails/is
redirected).
2011-12-21 15:44:58 +00:00
Gustavo André dos Santos Lopes
a56c0bd0d8 - Fixed tests in ext/standard/tests/http by adding the INI setting value
allow_url_fopen=1
- Converted test file from dos line endings to unix line endings.
2011-11-14 01:12:23 +00:00
Gustavo André dos Santos Lopes
8b5045fdcd - Fixed tests in ext/standard/tests/http by adding the INI setting value
allow_url_fopen=1
- Converted test file from dos line endings to unix line endings.
2011-11-14 01:12:23 +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
Antony Dovgal
bb8d9fa656 cosmetic fix 2009-08-04 09:27:15 +00:00
Jani Taskinen
a845f681bb - Fix title 2009-08-04 02:55:24 +00:00
Felipe Pena
8ad9bd1930 - Fixed tests 2009-08-01 15:46:50 +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
23a25db653 MFH: New test 2009-05-28 13:22:28 +00:00
Arnaud Le Blanc
8a8e036175 MFH: Test for #38802 2009-05-16 20:45:28 +00:00
Arnaud Le Blanc
ac57b7078b MFH: Minimal HTTP server to test HTTP stream wrapper 2009-05-16 20:44:05 +00:00