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

Fixed an infinite loop blocking bug related to multipart requests #92

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

yawillianpsb
Copy link
Contributor

#38
The problem was an infinite while loop that didn't end.
When multipart request had begun, loop started and blocked all further requests.

@yawillianpsb
Copy link
Contributor Author

@pmusolino

@pmusolino pmusolino self-requested a review August 28, 2020 09:12
@pmusolino
Copy link
Owner

Good catch @yawillianpsb if this is the reason. Did you test if everything is working fine using only return request.httpBody when there is a multipart request?

@yawillianpsb
Copy link
Contributor Author

yawillianpsb commented Aug 28, 2020

@pmusolino Yes all works fine, except of the request body for multipart/data. All other requests works fine both of them request and response. Without the fix we can't see request body for multipart/form-data anyway.
The problem was in while loop. The loop wouldn't stop. I think it's issue in AFNetworking with streams. We are using AFNetworking and maybe it is have bad work with streams.

@yawillianpsb
Copy link
Contributor Author

@pmusolino

1 similar comment
@yawillianpsb
Copy link
Contributor Author

@pmusolino

Copy link
Owner

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :shipit:

stream.close()
return data as Data
}
return request.httpBody
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me, at least for the moment since it's better to not show the body rather than send the app in an infinite loop.
I opened a related issue here #93

@pmusolino pmusolino added the bug Something isn't working label Sep 7, 2020
@pmusolino pmusolino merged commit 5fc7811 into pmusolino:master Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants