关于Http中的range(50分)

  • 主题发起人 主题发起人 KCZ
  • 开始时间 开始时间
K

KCZ

Unregistered / Unconfirmed
GUEST, unregistred user!
I am programming at a software about HTTP. I found NetAnts
is a good example. So I want to ask some questions.
If two threads get one file at the same time, the request
of One thread is following:
GET /pub/tmp/b.htm HTTP/1.1
Host: 202.38.135.202
Accept: */*
User-Agent: NetAnts/1.00
Connection: close

the response of the thread is:
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Connection: close
Date: Thu, 21 Oct 1999 07:42:07 GMT
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Fri, 12 Mar 1999 03:05:46 GMT
ETag: "0a11939356cbe1:4234"
Content-Length: 14324


the request of Another thread is :
GET /pub/tmp/b.htm HTTP/1.1
Host: 202.38.135.202
Accept: */*
User-Agent: NetAnts/1.00
Connection: close
Range: bytes=10240-


the response of another thread is:
HTTP/1.1 206 Partial content
Server: Microsoft-IIS/4.0
Connection: close
Date: Thu, 21 Oct 1999 07:42:08 GMT
Content-Type: text/html
Last-Modified: Fri, 12 Mar 1999 03:05:46 GMT
ETag: "0a11939356cbe1:4234"
Content-Length: 4084
Content-Range: bytes 10240-14323/14324

The first thread doesn't show the beginning and ending of
'Range', however the second thread gives us the range is from
10240 to the end. I want to know whether the first thread will
automatically stop at 10239 byte when it finds the second thread
has download the next range. Is the mechanism managed by the
Http Server?
 
no, the first thread do not stop at 10239, the netants do test it
always, and if it >10239 then stop and delete the buffer after 10239.
so, it's none of webserver's business.
 
大家用中文回答我吧!
 
我倒@@$%^$^$^ 你怎么用e文?
其实第一个线程不会在10239停止, netants检测是否有离它最近的起点, 如本例中
2的起点最近, 是10240, 那么, 1在受到数据时会检测是否到了>=10239, 如果是,
就扔掉10239以后的数据.
httpserver与此无关, 关键是要httpserver支持range方法, 即通常所说的断点续传.
 
多人接受答案了。
 
后退
顶部