Skip to content

Commit

Permalink
fix #509, always alloc big object at heap. 2.0.205
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 22, 2015
1 parent 8b24319 commit 5d3a183
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ Remark:

## History

* v2.0, 2015-12-22, for [#509][bug #509] always alloc big object at heap. 2.0.205
* v2.0, 2015-12-22, for [#418][bug #418] ignore null connect props to make RED5 happy. 2.0.204
* v2.0, 2015-12-22, for [#546][bug #546] thread terminate normally dispose bug. 2.0.203
* v2.0, 2015-12-22, for [#541][bug #541] failed when chunk size too small. 2.0.202
Expand Down Expand Up @@ -1213,6 +1214,7 @@ Winlin
[bug #541]: https://github.com/ossrs/srs/issues/541
[bug #546]: https://github.com/ossrs/srs/issues/546
[bug #418]: https://github.com/ossrs/srs/issues/418
[bug #509]: https://github.com/ossrs/srs/issues/509
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 204
#define VERSION_REVISION 205

// server info.
#define RTMP_SIG_SRS_KEY "SRS"
Expand Down
16 changes: 12 additions & 4 deletions trunk/src/protocol/srs_rtmp_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,11 +1981,19 @@ int SrsRtmpClient::handshake()

srs_assert(hs_bytes);

SrsComplexHandshake complex_hs;
if ((ret = complex_hs.handshake_with_server(hs_bytes, io)) != ERROR_SUCCESS) {
// maybe st has problem when alloc object on stack, always alloc object at heap.
// @see https://github.com/ossrs/srs/issues/509
SrsComplexHandshake* complex_hs = new SrsComplexHandshake();
SrsAutoFree(SrsComplexHandshake, complex_hs);

if ((ret = complex_hs->handshake_with_server(hs_bytes, io)) != ERROR_SUCCESS) {
if (ret == ERROR_RTMP_TRY_SIMPLE_HS) {
SrsSimpleHandshake simple_hs;
if ((ret = simple_hs.handshake_with_server(hs_bytes, io)) != ERROR_SUCCESS) {
// always alloc object at heap.
// @see https://github.com/ossrs/srs/issues/509
SrsSimpleHandshake* simple_hs = new SrsSimpleHandshake();
SrsAutoFree(SrsSimpleHandshake, simple_hs);

if ((ret = simple_hs->handshake_with_server(hs_bytes, io)) != ERROR_SUCCESS) {
return ret;
}
}
Expand Down

0 comments on commit 5d3a183

Please sign in to comment.