This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26361 - "If dots seen is 0 or 2, increase piece pointer ..."
Summary: "If dots seen is 0 or 2, increase piece pointer ..."
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 23:50 UTC by Albert Wiersch
Modified: 2014-07-30 13:47 UTC (History)
2 users (show)

See Also:


Attachments

Description Albert Wiersch 2014-07-16 23:50:08 UTC
http://url.spec.whatwg.org/#host-parsing

[[
If dots seen is 0 or 2, increase piece pointer by one. 
]]

Shouldn't this be

If dots seen is 1 or 3, increase piece pointer by one.
Comment 1 Anne 2014-07-29 09:22:43 UTC
Could you perhaps explain why? This was written a while ago. I'm a bit rusty on the details and it would take me a while to get back into it.
Comment 2 Albert Wiersch 2014-07-29 13:46:22 UTC
The piece needs to be set based on the first two IPv4 values so the piece pointer must remain the same until after the first two IPv4 values have been extracted and the piece has been set with its final value. This means that the piece pointer should not change until dots seen is 1 (when the first two IPv4 values have been extracted) or 3 (when all 4 IPv4 values have been extracted) otherwise the piece is not calculated correctly (i.e. not calculated on two IPv4 values). I had to make this change in my code for it to work properly. Hope this is clear enough.