GithubHelp home page GithubHelp logo

Comments (8)

synopse avatar synopse commented on August 16, 2024

Nice catch!

Should be fixed now.

from mormot2.

synopse avatar synopse commented on August 16, 2024

In fact, the exception was overkill here.
It will now return 404 with e3223fd6
as the blocking server does.

from mormot2.

Coldzer0 avatar Coldzer0 commented on August 16, 2024

In fact, the exception was overkill here.

That's true Because after testing the free fix here bfc4422
Another Access Violation started, And I was about to report it.

I'll check the e3223fd6 and report back after testing.



btw I was testing the download of a file using the STATICFILE_CONTENT_TYPE flag like this

if Ctxt.Url = '/installer.zip' then
begin
  Ctxt.OutContentType := STATICFILE_CONTENT_TYPE;
  Ctxt.OutContent := 'G:\installers\latest_stable.zip';
end;

But the server is sending data at maximum speed like 700 MB/S (in my case)
How can I control the speed of the download? The MaximumAllowedContentLength didn't do anything in this case.

from mormot2.

synopse avatar synopse commented on August 16, 2024

Why do you need to cut down the download speed?
On production, the available bandwidth will be shared among all connections: the async server is sending all output at the pace of each connection socket buffer.

from mormot2.

Coldzer0 avatar Coldzer0 commented on August 16, 2024

For the download speed, I have a business logic in the server related to the users to limit the download speed or make it faster.

Plus the upload part, I didn't find any way in mormot2 to handle file uploads from an HTTP client.

The thing Is, I have a Client that needs to upload multiple files simultaneously,
but he wants to limit the Speed because his internet is not that fast.

And I found out that the MaximumAllowedContentLength is only for the HTTP Server.

Maybe I might use Nginx as a proxy to handle the speed part! I'll check it out later.

By the way, the Speed is super impressive, especially since it didn't use any memory from the App part.
image

from mormot2.

synopse avatar synopse commented on August 16, 2024

So you expect the download speed to be limited depending on each connection/user?
It won't be feasible with nginx.

Note that for nginx, you can set NginxSendFileFrom() to let the nginx proxy do the work.
On Linux, it would use sendfile() or tlssendfile() to make it even more efficient.

About speed and memory, it just serves a TFileStream content directly into the socket connection buffers, with async sending.
So it actually minimize resources usage.

About the upload, direct file support is in my to-do list.

Note: all this discussion would benefit from being in our forum, because it would stay available, whereas here it is "lost" once the issue is closed.

from mormot2.

Coldzer0 avatar Coldzer0 commented on August 16, 2024

Thanks for the reply.
I'll open a new thread in the forum about the current discussion.

And the last fix works very well, And the ProcessClass is very helpful.

Thanks for your fantastic work, as usual.

from mormot2.

synopse avatar synopse commented on August 16, 2024

Closing since should be fixed now.
Please reopen if you the fix was not enough, or discuss on the forum.

from mormot2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.