#1 2024-04-02 15:13:25

yslmyr1990
Member
Registered: 2024-02-02
Posts: 8

It`s seems like a BUG of TRestClientLibraryRequest

Hi ab,
   constructor of the TRestClientLibraryRequest, has some questions maybe.

...
   aClient := TRestClientLibraryRequest.Create(TOrmModel.Create([]), 'Project2.dll');
...
constructor TRestClientLibraryRequest.Create(aModel: TOrmModel;
  const LibraryName: TFileName);
...
  call.Init;
  InternalUri(call);
  if call.OutStatus <> HTTP_NOTFOUND then
  begin
    @fRequest := nil;
    LibraryClose(h);
    raise ERestException.CreateUtf8(
      '%.Create: % doesn''t export a valid LibraryRequest() function (ret=%)',
      [self, LibraryName, call.OutStatus]);
  end;
...
end;

if the call.url is nil, the call.OutStatus must be HTTP_NOTFOUND, then raise the exception. There will never be another return value.

I'm not sure if there's something wrong with what I'm using, or this is a bug.

The rest server in dll is a TRestServerFullMemory, just ExportServerGlobalLibraryRequest.

Offline

#2 2024-04-02 19:38:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: It`s seems like a BUG of TRestClientLibraryRequest

I don't understand what you mean, sorry.
call.url is nil?

Do you mean that HTTP_NOTIMPLEMENTED should be tested instead of HTTP_NOTFOUND?

Offline

#3 2024-04-03 01:49:53

yslmyr1990
Member
Registered: 2024-02-02
Posts: 8

Re: It`s seems like a BUG of TRestClientLibraryRequest

ab wrote:

I don't understand what you mean, sorry.
call.url is nil?

Do you mean that HTTP_NOTIMPLEMENTED should be tested instead of HTTP_NOTFOUND?

no,if call.url is null, after InternalUri() the call.OutStatus is HTTP_BADREQUEST.
sorry, i misunderstood before, i thought this code is test to connect the restserver in dll.

if call.OutStatus <> HTTP_BADREQUEST then

This seems right.

Offline

Board footer

Powered by FluxBB