Ignore:
Timestamp:
20/01/13 16:26:24 (10 years ago)
Author:
fielding@…
Message:

(editorial) move byte range examples closer to defs

Location:
draft-ietf-httpbis/latest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p5-range.html

    r2144 r2145  
    674674         at zero.
    675675      </p>
    676       <p id="rfc.section.2.1.p.6">If the last-byte-pos value is present, it <em class="bcp14">MUST</em> be greater than or equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec is syntactically invalid. The
    677          recipient of a byte-range-set that includes one or more syntactically invalid byte-range-spec values <em class="bcp14">MUST</em> ignore the header field that includes that byte-range-set.
    678       </p>
    679       <p id="rfc.section.2.1.p.7">If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the representation
    680          data, last-byte-pos is taken to be equal to one less than the current length of the representation in bytes.
    681       </p>
    682       <p id="rfc.section.2.1.p.8">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the representation.</p>
    683       <div id="rfc.figure.u.4"></div><pre class="inline"><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
    684   <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
    685 </pre><p id="rfc.section.2.1.p.10">A suffix-byte-range-spec is used to specify the suffix of the representation data, of a length given by the suffix-length
    686          value. (That is, this form specifies the last N bytes of a representation.) If the representation is shorter than the specified
    687          suffix-length, the entire representation is used.
    688       </p>
    689       <p id="rfc.section.2.1.p.11">If a syntactically valid byte-range-set includes at least one byte-range-spec whose first-byte-pos is less than the current
    690          length of the representation, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the byte-range-set
    691          is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status code. Otherwise, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.206" class="smpl">206 (Partial Content)</a> status code containing the satisfiable ranges of the representation.
    692       </p>
    693       <p id="rfc.section.2.1.p.12">In the byte range syntax, <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a>, <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>, and <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> are expressed as decimal number of octets. Since there is no predefined limit to the length of an HTTP payload, recipients <em class="bcp14">SHOULD</em> anticipate potentially large decimal numerals and prevent parsing errors due to integer conversion overflows.
    694       </p>
    695       <p id="rfc.section.2.1.p.13">Examples of byte-ranges-specifier values (assuming a representation of length 10000): </p>
     676      <p id="rfc.section.2.1.p.6">Examples of byte-ranges-specifier values: </p>
    696677      <ul>
    697678         <li>The first 500 bytes (byte offsets 0-499, inclusive):
    698             <div id="rfc.figure.u.5"></div><pre class="text">  bytes=0-499
     679            <div id="rfc.figure.u.4"></div><pre class="text">  bytes=0-499
    699680</pre> </li>
    700681         <li>The second 500 bytes (byte offsets 500-999, inclusive):
    701             <div id="rfc.figure.u.6"></div><pre class="text">  bytes=500-999
     682            <div id="rfc.figure.u.5"></div><pre class="text">  bytes=500-999
    702683</pre> </li>
     684      </ul>
     685      <p id="rfc.section.2.1.p.7">If the last-byte-pos value is present, it <em class="bcp14">MUST</em> be greater than or equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec is syntactically invalid. The
     686         recipient of a byte-range-set that includes one or more syntactically invalid byte-range-spec values <em class="bcp14">MUST</em> ignore the header field that includes that byte-range-set.
     687      </p>
     688      <p id="rfc.section.2.1.p.8">If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the representation
     689         data, last-byte-pos is taken to be equal to one less than the current length of the representation in bytes.
     690      </p>
     691      <p id="rfc.section.2.1.p.9">By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the representation.</p>
     692      <div id="rfc.figure.u.6"></div><pre class="inline"><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span>  <a href="#rule.ranges-specifier" class="smpl">suffix-byte-range-spec</a> = "-" <a href="#rule.ranges-specifier" class="smpl">suffix-length</a>
     693  <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
     694</pre><p id="rfc.section.2.1.p.11">A suffix-byte-range-spec is used to specify the suffix of the representation data, of a length given by the suffix-length
     695         value. (That is, this form specifies the last N bytes of a representation.) If the representation is shorter than the specified
     696         suffix-length, the entire representation is used. For example (assuming a representation of length 10000):
     697      </p>
     698      <ul>
    703699         <li>The final 500 bytes (byte offsets 9500-9999, inclusive):
    704700            <div id="rfc.figure.u.7"></div><pre class="text">  bytes=-500
     
    713709</pre> </li>
    714710      </ul>
     711      <p id="rfc.section.2.1.p.12">If a syntactically valid byte-range-set includes at least one byte-range-spec whose first-byte-pos is less than the current
     712         length of the representation, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the byte-range-set
     713         is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.416" class="smpl">416 (Range Not Satisfiable)</a> status code. Otherwise, the server <em class="bcp14">SHOULD</em> send a response with a <a href="#status.206" class="smpl">206 (Partial Content)</a> status code containing the satisfiable ranges of the representation.
     714      </p>
     715      <p id="rfc.section.2.1.p.13">In the byte range syntax, <a href="#rule.ranges-specifier" class="smpl">first-byte-pos</a>, <a href="#rule.ranges-specifier" class="smpl">last-byte-pos</a>, and <a href="#rule.ranges-specifier" class="smpl">suffix-length</a> are expressed as decimal number of octets. Since there is no predefined limit to the length of an HTTP payload, recipients <em class="bcp14">SHOULD</em> anticipate potentially large decimal numerals and prevent parsing errors due to integer conversion overflows.
     716      </p>
    715717      <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a>&nbsp;<a id="range.units.other" href="#range.units.other">Other Range Units</a></h2>
    716718      <p id="rfc.section.2.2.p.1">Range units are intended to be extensible. New range units ought to be registered with IANA, as defined in <a href="#range.unit.registry" title="Range Unit Registry">Section&nbsp;5.1</a>.
  • draft-ietf-httpbis/latest/p5-range.xml

    r2144 r2145  
    235235</t>
    236236<t>
     237   Examples of byte-ranges-specifier values:
     238  <list style="symbols">
     239     <t>The first 500 bytes (byte offsets 0-499, inclusive):
     240<figure><artwork type="example" x:indent-with="   ">
     241  bytes=0-499
     242</artwork></figure>
     243    </t>
     244     <t>The second 500 bytes (byte offsets 500-999, inclusive):
     245<figure><artwork type="example" x:indent-with="   ">
     246  bytes=500-999
     247</artwork></figure>
     248    </t>
     249  </list>
     250</t>
     251<t>
    237252   If the last-byte-pos value is present, it &MUST; be greater than or
    238253   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
     
    260275   this form specifies the last N bytes of a representation.) If the
    261276   representation is shorter than the specified suffix-length, the entire
    262    representation is used.
     277   representation is used. For example (assuming a representation of
     278   length 10000):
     279  <list style="symbols">
     280     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
     281<figure><artwork type="example" x:indent-with="   ">
     282  bytes=-500
     283</artwork></figure>
     284    Or:
     285<figure><artwork type="example" x:indent-with="   ">
     286  bytes=9500-
     287</artwork></figure>
     288    </t>
     289     <t>The first and last bytes only (bytes 0 and 9999):
     290<figure><artwork type="example" x:indent-with="   ">
     291  bytes=0-0,-1
     292</artwork></figure>
     293     </t>
     294     <t>Other valid (but not canonical) specifications of the second 500
     295        bytes (byte offsets 500-999, inclusive):
     296<figure><artwork type="example" x:indent-with="   ">
     297  bytes=500-600,601-999
     298  bytes=500-700,601-999
     299</artwork></figure>
     300     </t>
     301  </list>
    263302</t>
    264303<t>
     
    280319   potentially large decimal numerals and prevent parsing errors due to integer
    281320   conversion overflows.
    282 </t>
    283 <t>
    284    Examples of byte-ranges-specifier values (assuming a representation of
    285    length 10000):
    286   <list style="symbols">
    287      <t>The first 500 bytes (byte offsets 0-499, inclusive):
    288 <figure><artwork type="example" x:indent-with="   ">
    289   bytes=0-499
    290 </artwork></figure>
    291     </t>
    292      <t>The second 500 bytes (byte offsets 500-999, inclusive):
    293 <figure><artwork type="example" x:indent-with="   ">
    294   bytes=500-999
    295 </artwork></figure>
    296     </t>
    297      <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
    298 <figure><artwork type="example" x:indent-with="   ">
    299   bytes=-500
    300 </artwork></figure>
    301     Or:
    302 <figure><artwork type="example" x:indent-with="   ">
    303   bytes=9500-
    304 </artwork></figure>
    305     </t>
    306      <t>The first and last bytes only (bytes 0 and 9999):
    307 <figure><artwork type="example" x:indent-with="   ">
    308   bytes=0-0,-1
    309 </artwork></figure>
    310      </t>
    311      <t>Other valid (but not canonical) specifications of the second 500
    312         bytes (byte offsets 500-999, inclusive):
    313 <figure><artwork type="example" x:indent-with="   ">
    314   bytes=500-600,601-999
    315   bytes=500-700,601-999
    316 </artwork></figure>
    317      </t>
    318   </list>
    319321</t>
    320322</section>
Note: See TracChangeset for help on using the changeset viewer.