X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=src%2Ffilter_http_file.cpp;h=00fab9e07c4620f4f336e384d75a0aadfe78fa27;hb=0dcfd01a8fc058f1537af7bf16f29ca901a3e61b;hp=d8cc4fba9b0aea8f64f2242816ae30bb3fc9b195;hpb=55cec3a8dbc35efbcfd5ccfb806ef8c56833a9a5;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);