ghkweon / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Webserver not serving updated dws files #457

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start the server as ussual
2. Browse to http://localhost:888, current index.dws get served
3. Change someting in index.dws, as putting a Write('test') or something, and 
save the file
4. Refresh the file in the browser, F5, Ctrl-F4, Shift F5, etc

What is the expected output? What do you see instead?
The page served with the updates, but just the old page keeps been served from 
server. Have to close WebServer and run again to reflect changes

What version of the product are you using? On what operating system?
setup_DWSWebServer_2014_03_05. Windows 7 x64, Delphi XE2

Original issue reported on code.google.com by sistema...@gmail.com on 10 Mar 2014 at 6:16

GoogleCodeExporter commented 8 years ago
Another test, I renamed index.dws to index2.dws, and create a new index.dws 
with just other content. The old content still showing. Then, delete the new 
created index.dws, Error "Not Found" showed. Undelete the deleted file, wich 
has the new content, and the old content still showing. Digging in source, the 
file change gets detected fine, the problem is, I think, here:

procedure TSimpleDWScript.FlushDWSCache(const fileName : String = '');
var
   oldHash : TCompiledProgramHash;
   unitName : String;
begin
   FCompiledProgramsLock.Enter;
   try
      if fileName='' then begin
         FDependenciesHash.Clean;
         FCompiledPrograms.Clear;
      end else begin
         unitName:=ChangeFileExt(ExtractFileName(fileName), '');
         FFlushProgList:=FDependenciesHash.Objects[LowerCase(unitName)];
         {this condition is never becoming true, perhaps the FileChange detection gets fired  }
         if (FFlushProgList<>nil) and (FFlushProgList.Count>0) then begin
            oldHash:=FCompiledPrograms;
            try
               FCompiledPrograms:=TCompiledProgramHash.Create;
               oldHash.Enumerate(AddNotMatching);
            finally
               oldHash.Free;
            end;
            FFlushProgList.Clear;
        end;
      end;
   finally
      FCompiledProgramsLock.Leave;
   end;
end;

Hope you get the idea, and can guide me to the right path, thanks in advance

Original comment by sistema...@gmail.com on 10 Mar 2014 at 9:56

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2450.

Original comment by zar...@gmail.com on 11 Mar 2014 at 7:59