X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_http_file.cpp;h=00fab9e07c4620f4f336e384d75a0aadfe78fa27;hb=e8545d53fdc2d9eec314f6174c2362a701ef9ad9;hp=d8cc4fba9b0aea8f64f2242816ae30bb3fc9b195;hpb=d0123337d70b0fb97b578cc57467bb94980f1014;p=metaproxy-moved-to-github.git diff --git a/src/filter_http_file.cpp b/src/filter_http_file.cpp index d8cc4fb..00fab9e 100644 --- a/src/filter_http_file.cpp +++ b/src/filter_http_file.cpp @@ -158,7 +158,13 @@ void yf::HttpFile::Rep::fetch_file(mp::Session &session, Z_HTTP_Response *hres = gdu->u.HTTP_Response; hres->content_len = sz; hres->content_buf = (char*) odr_malloc(o, hres->content_len); - fread(hres->content_buf, 1, hres->content_len, f); + if (fread(hres->content_buf, 1, hres->content_len, f) != 1) + { + fclose(f); + Z_GDU *gdu = o.create_HTTP_Response(session, req, 500); + package.response() = gdu; + return; + } fclose(f);