{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/753","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/753/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/753/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/753/events","html_url":"https://github.com/esp8266/Arduino/pull/753","id":105118780,"number":753,"title":"add ESP8266WebServer::sendContent_P and ESP8266WebServer::send_P with contentLength","user":{"login":"martinayotte","id":9724344,"avatar_url":"https://avatars.githubusercontent.com/u/9724344?v=3","gravatar_id":"","url":"https://api.github.com/users/martinayotte","html_url":"https://github.com/martinayotte","followers_url":"https://api.github.com/users/martinayotte/followers","following_url":"https://api.github.com/users/martinayotte/following{/other_user}","gists_url":"https://api.github.com/users/martinayotte/gists{/gist_id}","starred_url":"https://api.github.com/users/martinayotte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinayotte/subscriptions","organizations_url":"https://api.github.com/users/martinayotte/orgs","repos_url":"https://api.github.com/users/martinayotte/repos","events_url":"https://api.github.com/users/martinayotte/events{/privacy}","received_events_url":"https://api.github.com/users/martinayotte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-06T21:44:26Z","updated_at":"2015-09-09T15:59:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/esp8266/Arduino/pulls/753","html_url":"https://github.com/esp8266/Arduino/pull/753","diff_url":"https://github.com/esp8266/Arduino/pull/753.diff","patch_url":"https://github.com/esp8266/Arduino/pull/753.patch"},"body":"- add ESP8266WebServer::sendContent_P and ESP8266WebServer::send_P with size_t contentLength argument to allow binary content to be send, such as images.\r\n- fix in WiFiClient::write_P to use memcpy instead of memccpy allow binary content to be send, such as images.\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/138956516","html_url":"https://github.com/esp8266/Arduino/pull/753#issuecomment-138956516","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/753","id":138956516,"user":{"login":"martinayotte","id":9724344,"avatar_url":"https://avatars.githubusercontent.com/u/9724344?v=3","gravatar_id":"","url":"https://api.github.com/users/martinayotte","html_url":"https://github.com/martinayotte","followers_url":"https://api.github.com/users/martinayotte/followers","following_url":"https://api.github.com/users/martinayotte/following{/other_user}","gists_url":"https://api.github.com/users/martinayotte/gists{/gist_id}","starred_url":"https://api.github.com/users/martinayotte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinayotte/subscriptions","organizations_url":"https://api.github.com/users/martinayotte/orgs","repos_url":"https://api.github.com/users/martinayotte/repos","events_url":"https://api.github.com/users/martinayotte/events{/privacy}","received_events_url":"https://api.github.com/users/martinayotte/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T15:59:53Z","updated_at":"2015-09-09T15:59:53Z","body":"Hi again Ivan,\r\nI hate putting my hands/arms into a wringer.\r\nduring my previous tests, I forgot to add PSTR(\"image/png\") in my calls.\r\nAdding that, I got some crashes, even in Makuna original code.\r\nSo, I conclude that original code isn't working : \r\n\r\nprepareHeader(header, code, String(FPSTR(content_type)).c_str(), contentLength);\r\n\r\nChanging that to what you suggest me doesn't work either : \r\n\r\nString type = String(FPSTR(content_type));\r\n_prepareHeader(header, code, type.c_str(), contentLength);\r\n\r\nSo, I've think the proper way is again to use memccpy_P(), but I feel it is a bit ugly : \r\n\r\nchar type[64];\r\nmemccpy_P((void*)type, (PGM_VOID_P)content_type, 0, sizeof(type));\r\n_prepareHeader(header, code, (const char* )type, contentLength);\r\n\r\nI will commit that for now, but I think it needs to be revisited...\r\nI will appreciate you help here !\r\n"}}