IronsDu / brynet

A Header-Only cross-platform C++ TCP network library . We can use vcpkg(https://github.com/Microsoft/vcpkg/tree/master/ports/brynet) install brynet.
MIT License
1.04k stars 241 forks source link

Crashing when session send response with post close #107

Closed hrnozel closed 2 years ago

hrnozel commented 2 years ago

First of all, thank you for your efforts.

I think your library is great and working as properly in Win10 and as I have tested it, It never crashed to now.

But My application is a cross-platform application and it needs to be run on Macintosh and Linux distros.

I have tried my code when I did not any changes in my codes, your library was crashed. I investigated to find what was going to be wrong. I found that if I send response with "post-close" your library will be crashed.

If you want me to get any information such as core dump, debug info I can send it.

My compiler is AppleClang 13.0.0.13000029. My code is here that how to send my response:

session->send(httpResponse.getResult(), [session]() { session->postClose(); });

IronsDu commented 2 years ago

@thirtyninekilovolts thans for you found this issue.
I fix it on this commit: https://github.com/IronsDu/brynet/commit/999247744e2df63491f915ccc7401742147f9a94. please try again. Thank you.

hrnozel commented 2 years ago

@IronsDu Thank you for your interest, it seems that the issue is solved.

hrnozel commented 2 years ago

This issue exists in Linux distros. But it resolved in that commit 9992477, just a piece of information.

IronsDu commented 2 years ago

@thirtyninekilovolts you said is : publish a release version?

IronsDu commented 2 years ago

This issue exists in Linux distros. But it resolved in that commit 9992477, just a piece of information.

The master branch still exist this issue?

hrnozel commented 2 years ago

This issue exists in Linux distros. But it resolved in that commit 9992477, just a piece of information.

The master branch still exist this issue?

I meant that was just to say that this bug is also present in Linux distributions so there is no longer exists a bug related to my issue. It was resolved in your commit.

IronsDu commented 2 years ago

@thirtyninekilovolts Oh, now, I understand.. I n fact, I fix the issue under my WSL subsystem. hahahah, thank you again.