Skip to content

Ku range fix#17

Merged
kuenishi merged 3 commits intomasterfrom
ku-range-fix
Jan 16, 2015
Merged

Ku range fix#17
kuenishi merged 3 commits intomasterfrom
ku-range-fix

Conversation

@kuenishi
Copy link
Copy Markdown
Contributor

This is cherry-pick of #7, for basho/riak_cs#1047. Needs tagging and webmachine update followed.

Shunichi Shinohara added 2 commits January 15, 2015 20:20
RFC 2616 14.35.1 Byte Ranges

   If the last-byte-pos value is absent, or if the value is greater than
   or equal to the current length of the entity-body, last-byte-pos is
   taken to be equal to one less than the current length of the entity-
   body in bytes.

Conflicts:
	src/mochiweb_http.erl
@shino
Copy link
Copy Markdown

shino commented Jan 16, 2015

Was there any conflict in cherry-pick?
I guess range_skip_length was independently fixed in upstream (mochi's) repository [1] and incorporated in this fork by #15 [2].

[1] mochi/mochiweb@fe5e0c5?w=1
[2] b802b92

@shino
Copy link
Copy Markdown

shino commented Jan 16, 2015

Ah, you did right.
The upstream change had a bug in case Size < Start < End. So, as you did, we should adopt the one in #7.

Comment thread src/mochiweb_http.erl Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The test cases around this are all for invalid_rage as an comment at line 271 (new) says.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There are already cases for Size < End around line 258, this case should move to there.

@shino
Copy link
Copy Markdown

shino commented Jan 16, 2015

The test case to catch the bug when Size < Start < End at current master (bff08e8).

    ?assertEqual(invalid_range,
                 range_skip_length({BodySize + 1, BodySize + 5}, BodySize)),

@kuenishi
Copy link
Copy Markdown
Contributor Author

Okay, here's updated unitests.

@shino
Copy link
Copy Markdown

shino commented Jan 16, 2015

Code looks nice, eunit test pass.
I will +1 after Riak CS's test passes.

@shino
Copy link
Copy Markdown

shino commented Jan 16, 2015

This fix works well.
+1 to merge.

kuenishi added a commit that referenced this pull request Jan 16, 2015
@kuenishi kuenishi merged commit ade2a9b into master Jan 16, 2015
@kuenishi kuenishi deleted the ku-range-fix branch January 16, 2015 07:38
@kuenishi
Copy link
Copy Markdown
Contributor Author

Tagged v2.9.0p1 for this fix.

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.

2 participants