Jump to content

TheSim:QueryServer memory abuse

  • Pending

Currently I'm working on utility mod, which will upload all changes in strings to our translation server.

Of course, I use built in TheSim:QueryServer function. Recently I noticed, that it uses enormous amount of memory to send data, if this data is larger than 20-30kb.

For instance, to send up 70kb data dump it requires more than 2gb of memory (and a lot of cpu aswell)!

Go, check it yourself!


P.S. b.t.w. can you reveal all TheSim:QueryServer parameters meaning? Is it TheSim:QueryServer(string domain, function callback, string method, integer timeout) ?

Is it possible to modify this function, so that it would be capable to process user-given http request header fields? Currently I'm unable to provide normal cookie-based login, cause this function doesn't allow me to get/set cookies, as well it doesn't allow me to change content-type field, which could be crucial in particular conditions. The way I see this improvement is to add an optional table-parameter, that would override existing and add new header fields to request: TheSim:QueryServer(domain, callbackFn, "POST", {["Cookie"] = "....", ["Content-Type"] = "application/x-www-form-urlencoded"})
and callbackFn should have fourth table parameter, filled with responce header fields: function callbackFn(data, status, resultCode, headers) print(headers.Cookie) end

What do you think?

Steps to Reproduce
TheSim:QueryServer("somewhere", function (a,b,c) end, "POST", ('a'):rep(70000))
  • Like 2

User Feedback

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...