You are not logged in.
Pages: 1
in SynCrtSock (in procedure THttpServer.Process(ClientSock: THttpServerSocket; aCallingThread: TNotifiedThread);)
try
FileToSend := TFileStream.Create(
{$ifdef UNICODE}UTF8ToUnicodeString{$else}Utf8ToAnsi{$endif}(Context.OutContent),
fmOpenRead or fmShareDenyNone);
try
SetString(Context.fOutContent,nil,FileToSend.Size);
FileToSend.Position := 0;
FileToSend.Read(Pointer(Context.fOutContent),length(Context.fOutContent)); // THIS PROBLEM !!!
Context.OutContentType := '';
finally
FileToSend.Free;
end;
except
on Exception do begin
Code := 404;
Context.OutContent := '';
end;
end;
try
FileToSend := TFileStream.Create(
{$ifdef UNICODE}UTF8ToUnicodeString{$else}Utf8ToAnsi{$endif}(Context.OutContent),
fmOpenRead or fmShareDenyNone);
try
SetString(Context.fOutContent,nil,FileToSend.Size);
FileToSend.Position := 0;
FileToSend.Read(PAnsiChar(Context.fOutContent)^,length(Context.fOutContent)); // WORKED !!!
Context.OutContentType := '';
finally
FileToSend.Free;
end;
except
on Exception do begin
Code := 404;
Context.OutContent := '';
end;
end;
Last edited by VLT (2014-02-26 06:30:18)
Offline
Oups...
Should be fixed by http://synopse.info/fossil/info/7ed5734831
Offline
Pages: 1