mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Add server content data and mountableserver
This commit is contained in:
@@ -379,10 +379,23 @@ namespace Tesses::Framework::Http
|
||||
{
|
||||
if(strm == nullptr) return;
|
||||
SendStream(*strm);
|
||||
}
|
||||
ServerContext::~ServerContext()
|
||||
{
|
||||
for(auto item : this->data)
|
||||
{
|
||||
delete item.second;
|
||||
}
|
||||
}
|
||||
ServerContextData::~ServerContextData()
|
||||
{
|
||||
|
||||
}
|
||||
void ServerContext::SendStream(Stream& strm)
|
||||
{
|
||||
if(sent) return;
|
||||
if(!strm.CanRead()) throw TextException("Cannot read from stream");
|
||||
if(strm.EndOfStream()) throw TextException("End of stream");
|
||||
if(strm.CanSeek())
|
||||
{
|
||||
int64_t len=strm.GetLength();
|
||||
@@ -666,6 +679,11 @@ namespace Tesses::Framework::Http
|
||||
{
|
||||
ctx.SendException(ex);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
TextException ex("An unknown error occurred");
|
||||
ctx.SendException(ex);
|
||||
}
|
||||
|
||||
if(ctx.version != "HTTP/1.1" ) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user