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

refine srs buffer, min interfaces

This commit is contained in:
winlin 2014-06-07 21:09:46 +08:00
parent e6c03c6d6d
commit 8992e217a9
4 changed files with 51 additions and 40 deletions

View file

@ -552,7 +552,7 @@ char* SrsHttpMessage::http_ts_send_buffer()
void SrsHttpMessage::reset()
{
_state = SrsHttpParseStateInit;
_body->clear();
_body->erase(_body->length());
_url = "";
}
@ -666,8 +666,8 @@ string SrsHttpMessage::body()
{
std::string b;
if (_body && !_body->empty()) {
b.append(_body->bytes(), _body->size());
if (_body && _body->length() > 0) {
b.append(_body->bytes(), _body->length());
}
return b;
@ -675,16 +675,12 @@ string SrsHttpMessage::body()
char* SrsHttpMessage::body_raw()
{
if (_body && !_body->empty()) {
return _body->bytes();
}
return NULL;
return _body? _body->bytes() : NULL;
}
int64_t SrsHttpMessage::body_size()
{
return (int64_t)_body->size();
return (int64_t)_body->length();
}
int64_t SrsHttpMessage::content_length()