1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #405, improve the HTT FLV to 3k. 2.0.169

This commit is contained in:
winlin 2015-05-24 22:43:02 +08:00
parent b53e9814b3
commit 960341b9b2
8 changed files with 140 additions and 26 deletions

View file

@ -30,6 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <fcntl.h>
#include <sstream>
#include <sys/uio.h>
using namespace std;
#include <srs_kernel_log.hpp>
@ -145,6 +146,27 @@ int SrsFileWriter::write(void* buf, size_t count, ssize_t* pnwrite)
return ret;
}
int SrsFileWriter::writev(iovec* iov, int iovcnt, ssize_t* pnwrite)
{
int ret = ERROR_SUCCESS;
ssize_t nwrite = 0;
for (int i = 0; i < iovcnt; i++) {
iovec* piov = iov + i;
ssize_t this_nwrite = 0;
if ((ret = write(piov->iov_base, piov->iov_len, &this_nwrite)) != ERROR_SUCCESS) {
return ret;
}
nwrite += this_nwrite;
}
if (pnwrite) {
*pnwrite = nwrite;
}
return ret;
}
SrsFileReader::SrsFileReader()
{
fd = -1;