1- Infinite loop is caused because the consumers keep looping while their finished conditions are not met or cursor.isReady() remain true but none of the consumers seem to take into consideration the Content-length as a factor.
2- The second is caused because PartListConsumer starts off directly by calling the boundary consume method without taking into consideration that some time their will be garbage character between a part boundary and another.
this is the assumption that is causing problems:
--BLA1--\r\n--Bla2
Instead boundary should consume everything to the end of the body (based on content-length) or untill it hits another boundary.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
There are two problems:
1- between the last boundary-end and the boundary-end before it there are two "\r\n" while boundary consumer assumes there is one.
2- there are no \r\n at the end of the file this will cause an infinite loop.
Regarding the first point I'll look at the HTTP rfc and see if this standard or a bug, but for point two I think its a bug.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I figured out the reason of these bugs:
1- Infinite loop is caused because the consumers keep looping while their finished conditions are not met or cursor.isReady() remain true but none of the consumers seem to take into consideration the Content-length as a factor.
2- The second is caused because PartListConsumer starts off directly by calling the boundary consume method without taking into consideration that some time their will be garbage character between a part boundary and another.
this is the assumption that is causing problems:
--BLA1--\r\n--Bla2
Instead boundary should consume everything to the end of the body (based on content-length) or untill it hits another boundary.
If you could write a test case for the loop that would be great!!