Recent

Author Topic: streaming error on restserver  (Read 1992 times)

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
streaming error on restserver
« on: June 26, 2020, 03:06:33 pm »
I build my own demo with the examples in $pas2js/fcldb. I took restserver and changed it to my own json file. It works perfect. With 127.0.0.1:3000/packages (I registred this path to find my data) json data and meta data is showed in my browser.

I've also created my own client (demo demorest is not working). Clcking on the searc button start a request to the server. It response, but when the result must be send to the client an error  occurs:

An error (ewriteError)  happened while sending response content :  stream write error.

My client is working. It sends a request to the server. So maybe I did something wrong. I took the 'original' restserver with the country.json file. Sent a new request to the server. But this one is also give the same error message.

There's something wrong when the stream must be uploaded to the client. I can figure it out whats happening. Maybe another person knows the answere to that.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: streaming error on restserver
« Reply #1 on: June 26, 2020, 03:39:46 pm »
as far as i can see the problem relies here (fphttpserver) (package fcl-web)
Code: Pascal  [Select][+][-]
  1. procedure TFPHTTPConnectionResponse.DoSendContent;
  2. begin
  3.   If Assigned(ContentStream) then
  4.     Connection.Socket.CopyFrom(ContentStream,0)
  5.   else
  6.     Contents.SaveToStream(Connection.Socket);
  7. end;            
  8.  
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

 

TinyPortal © 2005-2018