#1 Re: mORMot 2 » TURiRouter.add » 2023-03-23 15:05:36

Thank you ab, I only use the THttpServerGeneric framework

#2 mORMot 2 » TURiRouter.add » 2023-03-23 01:12:44

redhan_xp
Replies: 2

I need to add a find method to the TURiRouter class to determine whether it exists in the OnBeforeBody event. If it does not, access will be denied.


function TURiRouter.Find(const aUri, aMethod: RawUtf8): TUriTreeNode;

or


function TURiRouter.Find(const aUri, aMethod: RawUtf8): TUriTreeNodeData;

Is the proposal feasible




If possible, it is best to temporarily store the find results for use by THttpServerRequest, such as: THttpServerRequest. fRoute?

#3 Re: mORMot 2 » THttpServerRequest create? » 2023-03-20 10:15:33

I need to implement the interface and try it out for the dll. Let me handle it in a different way, thank you

#4 Re: mORMot 2 » THttpServerRequest create? » 2023-03-20 03:31:57

THttpServerRequest.create ?


mormot.net.async.pas:   (row 3366)
3364             HTTP_UPG_FLAGS[hfConnectionUpgrade in fHttp.HeaderFlags];
3365    if fRequest = nil then // created once, if not rejected by OnBeforeBody
3366:     fRequest := THttpServerRequest.Create(
3367        fServer, fConnectionID, fReadThread, flags, @fConnectionOpaque)
3368    else


mormot.net.server.pas:   (3082;  4088)
3081    // compute the response
3082:   req := THttpServerRequest.Create(self, ConnectionID, ConnectionThread,
3083      HTTP_TLS_FLAGS[ClientSock.TLS.Enabled] +
3084      HTTP_UPG_FLAGS[hfConnectionUpgrade in ClientSock.Http.HeaderFlags],
....
4086      if global_verbs[hvOPTIONS] = '' then
4087        global_verbs := VERB_TEXT;
4088:     ctxt := THttpServerRequest.Create(self, 0, self, [], nil);
4089      // main loop reusing a single ctxt instance for this thread
4090      reqid := 0;

#5 Re: mORMot 2 » THttpServerRequest create? » 2023-03-20 03:15:59

Thank you. I didn't find the ComputeContext method before.

#6 mORMot 2 » THttpServerRequest create? » 2023-03-19 01:56:57

redhan_xp
Replies: 6

Hello Ab,


I want to implement THttpServerRequest inheritance,

For example: TWebSocketAsyncServer.ProcessClass

#7 Re: mORMot 2 » websocket parse bug » 2023-03-18 09:04:28

until P^ <> ' ';

test ok, thanks

#8 mORMot 2 » websocket parse bug » 2023-03-18 07:21:20

redhan_xp
Replies: 2

CONNECTION: KEEP-ALIVE, UPGRADE

mormot.net.http 

1374                repeat
1375                  inc(P);
1376                until P^ <= ' ';
                      Inc(P); // add ok

Board footer

Powered by FluxBB