Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mORMot] - upgrade to mORMot@2.3.9262 with HTTP pipelining mode improvements #9480

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frameworks/Pascal/mormot/setup_and_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo "Download statics from $URL ..."
wget -qO- "$URL" | tar -xz -C ./libs/mORMot/static

# uncomment for fixed commit URL
URL=https://github.com/synopse/mORMot2/tarball/2017bddac17a838c9584763e4bd7538aa6f8a529
URL=https://github.com/synopse/mORMot2/tarball/53bee75f81062db0700c97dfa9dfb5e9ce408679
#URL="https://api.github.com/repos/synopse/mORMot2/tarball/$USED_TAG"
echo "Download and unpacking mORMot sources from $URL ..."
wget -qO- "$URL" | tar -xz -C ./libs/mORMot --strip-components=1
Expand Down
24 changes: 8 additions & 16 deletions frameworks/Pascal/mormot/src/raw.pas
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ function TRawAsyncServer.json(ctxt: THttpServerRequest): cardinal;
msgRec: TMessageRec;
begin
msgRec.message := pointer(HELLO_WORLD);
ctxt.SetOutJson(@msgRec, TypeInfo(TMessageRec));
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(@msgRec, TypeInfo(TMessageRec));
end;

function TRawAsyncServer.db(ctxt: THttpServerRequest): cardinal;
Expand All @@ -329,8 +328,7 @@ function TRawAsyncServer.db(ctxt: THttpServerRequest): cardinal;
begin
w := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld(Lecuyer));
try
ctxt.SetOutJson(w);
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(w);
finally
w.Free;
end;
Expand All @@ -346,9 +344,8 @@ function TRawAsyncServer.queries(ctxt: THttpServerRequest): cardinal;
gen := Lecuyer;
for i := 0 to length(res) - 1 do
res[i] := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld(gen));
ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
result := ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
ObjArrayClear(res);
result := HTTP_SUCCESS;
end;

function TRawAsyncServer.cached_queries(ctxt: THttpServerRequest): cardinal;
Expand All @@ -361,8 +358,7 @@ function TRawAsyncServer.cached_queries(ctxt: THttpServerRequest): cardinal;
gen := Lecuyer;
for i := 0 to length(res) - 1 do
res[i] := fOrmCache.Get(ComputeRandomWorld(gen));
ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
end;

function OrmFortuneCompareByMessage(const A, B): integer;
Expand Down Expand Up @@ -436,9 +432,8 @@ function TRawAsyncServer.rawdb(ctxt: THttpServerRequest): cardinal;
stmt.ExecutePrepared;
if stmt.Step then
begin
ctxt.SetOutJson(
result := ctxt.SetOutJson(
'{"id":%,"randomNumber":%}', [stmt.ColumnInt(0), stmt.ColumnInt(1)]);
result := HTTP_SUCCESS;
stmt.ReleaseRows;
end;
stmt := nil;
Expand All @@ -450,8 +445,7 @@ function TRawAsyncServer.rawqueries(ctxt: THttpServerRequest): cardinal;
begin
if not GetRawRandomWorlds(GetQueriesParamValue(ctxt), res) then
exit(HTTP_SERVERERROR);
ctxt.SetOutJson(@res, TypeInfo(TWorlds));
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(@res, TypeInfo(TWorlds));
end;

function TRawAsyncServer.rawcached(ctxt: THttpServerRequest): cardinal;
Expand All @@ -464,8 +458,7 @@ function TRawAsyncServer.rawcached(ctxt: THttpServerRequest): cardinal;
gen := Lecuyer;
for i := 0 to length(res) - 1 do
res[i] := fRawCache[ComputeRandomWorld(gen) - 1];
ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds));
end;

function TRawAsyncServer.rawfortunes(ctxt: THttpServerRequest): cardinal;
Expand Down Expand Up @@ -555,8 +548,7 @@ function TRawAsyncServer.rawupdates(ctxt: THttpServerRequest): cardinal;
end;
end;
stmt.ExecutePrepared;
ctxt.SetOutJson(@res, TypeInfo(TWorlds));
result := HTTP_SUCCESS;
result := ctxt.SetOutJson(@res, TypeInfo(TWorlds));
end;

// asynchronous PostgreSQL pipelined DB access
Expand Down
Loading