<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/php-git.git/sapi/cli/tests/bug65066_511.phpt, branch php-5.5.21</title>
<subtitle>git.php.net: repository/php-src.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/'/>
<entry>
<title>Change the search in get_status_string() to correctly handle unknown codes.</title>
<updated>2013-06-20T16:31:57+00:00</updated>
<author>
<name>Adam Harvey</name>
<email>aharvey@php.net</email>
</author>
<published>2013-06-19T18:32:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=283f56af6696f57400bdbf8ce29ee66e64249c0d'/>
<id>283f56af6696f57400bdbf8ce29ee66e64249c0d</id>
<content type='text'>
This previously used a buggy implementation of binary search that would loop
infinitely for unknown codes when searching in reason arrays of particular
sizes (such as the one we have at the moment). Since C provides bsearch(),
we'll just use that instead, since libc authors hopefully get this right.

There was also an additional bug that was masked by the first one: the design
was that an unknown code would result in get_status_string() returning NULL,
which would then result in a segfault in append_http_status_line(), since it
assumed that it would always receive a valid string pointer that could be
handed off to smart_str_appends_ex(). We'll now return a placeholder in that
case.

Fixes bug #65066 (Cli server not responsive when responding with 422 http
status code).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This previously used a buggy implementation of binary search that would loop
infinitely for unknown codes when searching in reason arrays of particular
sizes (such as the one we have at the moment). Since C provides bsearch(),
we'll just use that instead, since libc authors hopefully get this right.

There was also an additional bug that was masked by the first one: the design
was that an unknown code would result in get_status_string() returning NULL,
which would then result in a segfault in append_http_status_line(), since it
assumed that it would always receive a valid string pointer that could be
handed off to smart_str_appends_ex(). We'll now return a placeholder in that
case.

Fixes bug #65066 (Cli server not responsive when responding with 422 http
status code).
</pre>
</div>
</content>
</entry>
</feed>
