Commit da8a1010 authored by jan.koester's avatar jan.koester
Browse files

test

parent 11d8ab65
Loading
Loading
Loading
Loading
+14 −2
Changes for plugins/media/media.cpp: 14 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1277,8 +1277,20 @@ namespace blogi {
                            std::cerr << "media: upstream stream error after "
                                      << ss->produced << "/" << ss->sendSize << " bytes" << std::endl;
                            ss->client.reset();
                            ss->sendSize = ss->produced;
                            return false;
                            // The client was already promised the original,
                            // larger Content-Length (set before streaming
                            // started). Shrinking sendSize to match what we
                            // produced so far would make the framework treat
                            // this as a clean finish, silently truncating the
                            // body. Throw instead so the transport aborts the
                            // stream/connection rather than lying about
                            // completion.
                            libhttppp::HTTPException err;
                            err[libhttppp::HTTPException::Error]
                                << "media: upstream stream error after "
                                << std::to_string(ss->produced) << "/"
                                << std::to_string(ss->sendSize) << " bytes";
                            throw err;
                        }
                        if(n > 0){
                            if(n > remaining) n = remaining;