mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
Eliminate dead code of ts cache for HTTP message
This commit is contained in:
parent
ca2b68f428
commit
45ed458927
4 changed files with 6 additions and 22 deletions
|
@ -35,9 +35,13 @@ using namespace std;
|
|||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_kernel_file.hpp>
|
||||
#include <srs_protocol_json.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
|
||||
#define SRS_HTTP_DEFAULT_PAGE "index.html"
|
||||
|
||||
// @see ISrsHttpMessage._http_ts_send_buffer
|
||||
#define SRS_HTTP_TS_SEND_BUFFER_SIZE 4096
|
||||
|
||||
// get the status text of code.
|
||||
string srs_generate_http_status_text(int status)
|
||||
{
|
||||
|
@ -492,7 +496,8 @@ srs_error_t SrsHttpFileServer::copy(ISrsHttpResponseWriter* w, SrsFileReader* fs
|
|||
srs_error_t err = srs_success;
|
||||
|
||||
int left = size;
|
||||
char* buf = r->http_ts_send_buffer();
|
||||
char* buf = new char[SRS_HTTP_TS_SEND_BUFFER_SIZE];
|
||||
SrsAutoFreeA(char, buf);
|
||||
|
||||
while (left > 0) {
|
||||
ssize_t nread = -1;
|
||||
|
@ -822,17 +827,10 @@ srs_error_t SrsHttpCorsMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessag
|
|||
|
||||
ISrsHttpMessage::ISrsHttpMessage()
|
||||
{
|
||||
_http_ts_send_buffer = new char[SRS_HTTP_TS_SEND_BUFFER_SIZE];
|
||||
}
|
||||
|
||||
ISrsHttpMessage::~ISrsHttpMessage()
|
||||
{
|
||||
srs_freepa(_http_ts_send_buffer);
|
||||
}
|
||||
|
||||
char* ISrsHttpMessage::http_ts_send_buffer()
|
||||
{
|
||||
return _http_ts_send_buffer;
|
||||
}
|
||||
|
||||
SrsHttpUri::SrsHttpUri()
|
||||
|
|
|
@ -63,9 +63,6 @@ class SrsJsonObject;
|
|||
#define SRS_HTTP_CRLF "\r\n" // 0x0D0A
|
||||
#define SRS_HTTP_CRLFCRLF "\r\n\r\n" // 0x0D0A0D0A
|
||||
|
||||
// @see ISrsHttpMessage._http_ts_send_buffer
|
||||
#define SRS_HTTP_TS_SEND_BUFFER_SIZE 4096
|
||||
|
||||
// For ead all of http body, read each time.
|
||||
#define SRS_HTTP_READ_CACHE_BYTES 4096
|
||||
|
||||
|
@ -455,16 +452,9 @@ public:
|
|||
// @rmark for mode 2, the infinite chunked, all left data is body.
|
||||
class ISrsHttpMessage
|
||||
{
|
||||
private:
|
||||
// Use a buffer to read and send ts file.
|
||||
// TODO: FIXME: remove it.
|
||||
char* _http_ts_send_buffer;
|
||||
public:
|
||||
ISrsHttpMessage();
|
||||
virtual ~ISrsHttpMessage();
|
||||
public:
|
||||
// The http request level cache.
|
||||
virtual char* http_ts_send_buffer();
|
||||
public:
|
||||
virtual uint8_t method() = 0;
|
||||
virtual uint16_t status_code() = 0;
|
||||
|
|
|
@ -258,7 +258,6 @@ SrsHttpMessage::SrsHttpMessage(ISrsReader* reader, SrsFastStream* buffer) : ISrs
|
|||
infinite_chunked = false;
|
||||
_uri = new SrsHttpUri();
|
||||
_body = new SrsHttpResponseReader(this, reader, buffer);
|
||||
_http_ts_send_buffer = new char[SRS_HTTP_TS_SEND_BUFFER_SIZE];
|
||||
|
||||
jsonp = false;
|
||||
|
||||
|
@ -272,7 +271,6 @@ SrsHttpMessage::~SrsHttpMessage()
|
|||
{
|
||||
srs_freep(_body);
|
||||
srs_freep(_uri);
|
||||
srs_freepa(_http_ts_send_buffer);
|
||||
}
|
||||
|
||||
void SrsHttpMessage::set_basic(uint8_t method, uint16_t status, int64_t content_length)
|
||||
|
|
|
@ -100,8 +100,6 @@ private:
|
|||
// Whether the body is infinite chunked.
|
||||
bool infinite_chunked;
|
||||
// Use a buffer to read and send ts file.
|
||||
// TODO: FIXME: remove it.
|
||||
char* _http_ts_send_buffer;
|
||||
// The transport connection, can be NULL.
|
||||
SrsConnection* owner_conn;
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue