projects
/
php
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd50bf2
)
Improve error message for ssl request
author
Xinchen Hui
<laruence@php.net>
Sun, 22 Jul 2012 11:20:23 +0000
(19:20 +0800)
committer
Xinchen Hui
<laruence@php.net>
Sun, 22 Jul 2012 11:20:23 +0000
(19:20 +0800)
sapi/cli/php_cli_server.c
patch
|
blob
|
history
diff --git
a/sapi/cli/php_cli_server.c
b/sapi/cli/php_cli_server.c
index 876c57a34d4915da7ed7dfe244e12c1171f9739c..02f885484f5b06c5860f4d3e9a684a925399b790 100644
(file)
--- a/
sapi/cli/php_cli_server.c
+++ b/
sapi/cli/php_cli_server.c
@@
-1618,7
+1618,11
@@
static int php_cli_server_client_read_request(php_cli_server_client *client, cha
client->parser.data = client;
nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read);
if (nbytes_consumed != nbytes_read) {
- *errstr = estrdup("Malformed HTTP request");
+ if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
+ *errstr = estrdup("Unsupported SSL request");
+ } else {
+ *errstr = estrdup("Malformed HTTP request");
+ }
return -1;
}
if (client->current_header_name) {