Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http/request: reset body mbuf pos on re-sending #1116

Merged
merged 1 commit into from
May 12, 2024

Conversation

maximilianfridrich
Copy link
Contributor

This fixes the following bug:

If a HTTP request is resent (e.g. with Authentication after a 401 response), the body of the request is not sent.

This is because in req_body_handler mbuf_advance(conn->body, len) is called. Then the request is re-sent and the body size is obtained by calling mbuf_get_left(conn->body) which is now incorrect.

The fix is to reset the mbuf position of conn->body before re-sending a request.

@alfredh alfredh merged commit 475573a into baresip:main May 12, 2024
37 checks passed
@maximilianfridrich maximilianfridrich deleted the fix_http_body_401 branch May 13, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants