mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Micro changes and fix utest fail.
This commit is contained in:
parent
1e6143e2eb
commit
d32bd72527
4 changed files with 22 additions and 23 deletions
|
@ -1011,8 +1011,6 @@ void SrsHttpResponseWriter::write_default_header()
|
|||
SrsHttpRequestWriter::SrsHttpRequestWriter(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
writer_ = new SrsHttpMessageWriter(io, this);
|
||||
method_ = NULL;
|
||||
path_ = NULL;
|
||||
}
|
||||
|
||||
SrsHttpRequestWriter::~SrsHttpRequestWriter()
|
||||
|
@ -1040,10 +1038,10 @@ srs_error_t SrsHttpRequestWriter::writev(const iovec* iov, int iovcnt, ssize_t*
|
|||
return writer_->writev(iov, iovcnt, pnwrite);
|
||||
}
|
||||
|
||||
void SrsHttpRequestWriter::write_header(const char* method, const char* path)
|
||||
void SrsHttpRequestWriter::write_header(const std::string& method, const std::string& path)
|
||||
{
|
||||
if (writer_->header_wrote()) {
|
||||
srs_warn("http: multiple write_header calls, current=%s(%s), now=%s(%s)", method_, path_, method, path);
|
||||
srs_warn("http: multiple write_header calls, current=%s(%s), now=%s(%s)", method_.c_str(), path_.c_str(), method.c_str(), path.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -290,8 +290,8 @@ class SrsHttpRequestWriter : public ISrsHttpRequestWriter, public ISrsHttpFirstL
|
|||
protected:
|
||||
SrsHttpMessageWriter* writer_;
|
||||
// The method and path passed to WriteHeader, for request only.
|
||||
const char* method_;
|
||||
const char* path_;
|
||||
std::string method_;
|
||||
std::string path_;
|
||||
public:
|
||||
SrsHttpRequestWriter(ISrsProtocolReadWriter* io);
|
||||
virtual ~SrsHttpRequestWriter();
|
||||
|
@ -301,7 +301,7 @@ public:
|
|||
virtual SrsHttpHeader* header();
|
||||
virtual srs_error_t write(char* data, int size);
|
||||
virtual srs_error_t writev(const iovec* iov, int iovcnt, ssize_t* pnwrite);
|
||||
virtual void write_header(const char* method, const char* path);
|
||||
virtual void write_header(const std::string& method, const std::string& path);
|
||||
// Interface ISrsHttpFirstLineWriter
|
||||
public:
|
||||
virtual srs_error_t build_first_line(std::stringstream& ss, char* data, int size);
|
||||
|
|
|
@ -270,7 +270,7 @@ public:
|
|||
// Thus explicit calls to WriteHeader are mainly used to
|
||||
// send error codes.
|
||||
// @remark, user must set header then write or write_header.
|
||||
virtual void write_header(const char* method, const char* path) = 0;
|
||||
virtual void write_header(const std::string& method, const std::string& path) = 0;
|
||||
};
|
||||
|
||||
// Objects implementing the Handler interface can be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue