Conversation
and I have not compile it
|
感謝提點,照你的方式更改好code,有看到在傳送特定幾張圖片時會出錯誤: Bad file descriptor |
|
我檢查文件的權限 ($ ls -l 指令) ----以下是以下是不可以傳送的圖片的權限(會卡在4.bmp那張圖片,其餘的圖片根本沒被client的browser 請求 GET) |
|
我覺得你可以先釐清是你程式問題,還是系統問題
以上兩個都沒問題的話,那也許應該是程式問題比較有可能 另外我在PTT上要你檢查fdimg的值其實有要你處裡他的意思 還有就是http://man7.org/linux/man-pages/man2/open.2.html |
|
我剛剛又粗略看了你的程式碼 讀bmp時,回傳jpeg的header,應該會有問題 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img |
|
又發現你4.bmp的檔案大小根本是 0 bytes |
|
我明天會根據你的指示和link來確認, 非常感謝!
我html不會呼叫4.bmp這個檔案。
東毅
Sent from Outlook Mobile<https://aka.ms/blhgte>
…________________________________
From: bdvstg <notifications@github.com>
Sent: Monday, April 20, 2020 10:35:10 PM
To: Dungyichao/http_server <http_server@noreply.github.com>
Cc: Dung-Yi <dungyichao@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [Dungyichao/http_server] 我不確定這是否為問題點 (#1)
又發現你4.bmp的檔案大小根本是 0 bytes
應該是檔案損毀吧?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGAQH4UDR6UV7KRTIMXKXA3RNUA55ANCNFSM4MHWNKHQ>.
|
我沒有編譯過,只是依照經驗判斷哪邊有可能有問題
sendfile有可能實際送出的資料少於block_size
因此img_total_size減掉block_size會有問題的
詳細請看sendfile的說明(你註解中的連結)的回傳值的部分