Re: [問題] 抓http檔案

看板C_and_CPP作者 (快樂一整年 ^^~~~)時間11年前 (2013/04/12 08:48), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
※ 引述《a534055 (可樂)》之銘言: : 找到問題點了,http封包回200 OK的時候,就已經開始傳檔案 : 我用strlen去算剩下封包的長度,文字檔沒問題,如果是binary file : strlen 會讀到錯誤的值。 : 實際上資料已經傳完了,是我沒有處理到前面的data : 感謝熱心寄信給我的版友們 copy from MSDN int recv ( SOCKET s, char FAR* buf, int len, int flags ); Return Values If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.248.105.226
文章代碼(AID): #1HPrdDtU (C_and_CPP)
討論串 (同標題文章)
文章代碼(AID): #1HPrdDtU (C_and_CPP)