Re: [問題] 關於作業的幾個問題

看板PangSir作者 (噴火龍)時間20年前 (2006/03/29 21:49), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/10 (看更多)
※ 引述《Favonia (xDDDDDDDDDDDDDDDDDDDDDD)》之銘言: : 不會有 : 決定長度是一個學問 我想請教如何決定長度,RFC中如此寫道 When an Entity-Body is included with a message, the length of that body may be determined in one of two ways. If a Content-Length header field is present, its value in bytes represents the length of the Entity-Body. Otherwise, the body length is determined by the closing of the connection by the server. 我的問題是,如果沒有Content-Length資料的話 要如何偵測 connection close 呢? 目前很笨的方法就是一個字元一個字元read,直到read回傳error@@ 謝謝^^" <文章更新> 剛剛突然想到可以用read回傳值作為length參考 就把這部份大致寫出來了 不過有一個測試網站上的gif檔居然還不能完全讀出來 已經確定 IE 有向我的 proxy 做 request 了 後來把 IE 暫存清掉以後竟然可以正常讀取...真怪 希望不是我的程式的問題@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.247.24 ※ 編輯: JY 來自: 140.112.247.24 (03/29 21:53) ※ 編輯: JY 來自: 140.112.247.24 (03/29 22:39)
文章代碼(AID): #14Af1lL7 (PangSir)
討論串 (同標題文章)
文章代碼(AID): #14Af1lL7 (PangSir)