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

support http methods, support js crossdomain request

This commit is contained in:
winlin 2014-04-01 14:28:19 +08:00
parent 51c1615173
commit 6ca9b774c1
5 changed files with 145 additions and 46 deletions

View file

@ -49,18 +49,34 @@ int SrsBuffer::size()
return (int)data.size();
}
bool SrsBuffer::empty()
{
return size() <= 0;
}
char* SrsBuffer::bytes()
{
return &data.at(0);
}
void SrsBuffer::erase(int size)
void SrsBuffer::erase(int _size)
{
data.erase(data.begin(), data.begin() + size);
if (_size == size()) {
clear();
return;
}
data.erase(data.begin(), data.begin() + _size);
}
void SrsBuffer::append(char* bytes, int size)
void SrsBuffer::clear()
{
data.clear();
}
void SrsBuffer::append(const char* bytes, int size)
{
srs_assert(size > 0);
data.insert(data.end(), bytes, bytes + size);
}