rejetto forum
Software => HFS ~ HTTP File Server => Bug reports => Topic started by: maverick on November 26, 2007, 05:33:29 AM
-
Looks like this was missed from the beta forum:
Something wrong with this build. I can't say that it actually crashes but on start-up once I start to browse the folders/sub-folders, HFS quits and Exits all of a sudden. I can reproduce this problem everytime I try to browse a folder/sub-folder.
it works with subfolders here
find more clues about the problem or pass me your vfs and ini (privately)
Make one or more of the sub-folders archivable. Then try to browse them. HFS will quit and Exit.
-
I created a virtual folder, then inside a real folder, which has been marked as archivable.
I removed archivable from the root.
I accessed them at all level. No problem. Tried to download the archive. No problem.
We need something else to reproduce it.
-
I ran #146, applied your change to the default tpl, then created this vfs (attached), clicked here and there but no problems at all.
Can you tell me more?
-
My apologies rejetto. I found the cause to my problem and it was on my end. A bad cut & paste in my template was causing the problem. Fixed.
-
But... if HFS quits with a click by the client, it means it has a bug that must be fixed.
Isn't it so?
-
Yes, that is what I thought too. I spent a lot of time tracking down this problem. This bad cut & paste (partial code that was even remarked) wasn't something that was done recently. Not sure how that happened and it was in the archive section that I missed before. I had no errors or anything else running this up to build 145. But build 146 wouldn't allow it and HFS quit as I explained before. I removed that entry from the template and now it is working good again. I'll let you know if something else shows up.
-
I think i was not clear.
I want to reproduce the problem you had.
I want HFS to not quit, if that is not the wish of the user.
Can you provide me the information to reproduce the problem?
-
I don't remember exactly what I removed from the template that caused the problem. However, I added something similar to the default template which reproduces the problem. See attached.
Let me know if you were able to reproduce it ...
-
ok, it was quite "easy" :)
it's the %item-archive% inside the [item-archive], that is infinite recursion.
i will try to put a solution to this, but it's not obvious, because a simple check on current symbol and section won't do: the cycle may close at depth N.
e.g.
[a]
%c%
[c]
%d%
[d]
%a%
-
I'm happy you were able to reproduce the problem and know what causes it. I hope you are able to find a solution.
-
As I mentioned before, this problem started with 2.3 beta 146. This problem did not existed with earlier betas.
Don't know if you tried it or not, but load beta 145 and the files I attached above and you will see that there is no problem with %item-archive% inside the [item-archive]. The looping problem was introduced in beta 146.
-
thank you for reporting, but the bug is actually introduced because of a new power of the template engine: being able to recur on symbols at any level with no overhead.
before it was at 2 (or 3?) levels and with big overhead.
consider using {{comment}} for your comments if you don't want them to reach the user.
-
ok, it was quite "easy" :)
it's the %item-archive% inside the [item-archive], that is infinite recursion.
i will try to put a solution to this, but it's not obvious, because a simple check on current symbol and section won't do: the cycle may close at depth N.
e.g.
[a]
%c%
[c]
%d%
[d]
%a%
I don't know what your capabilities are inside Delphi, but in PHP I'd push each symbol I expand onto a stack and pop it when I'm done. Then it is simply a matter of scanning the stack to see if you are already inside an expansion of that symbol.
-
i search symbols, and as i find one, i "expand" it and recur on the expanded text
i'm now inserting some tests that will prevent infinite recursion.
it is just to not crash in case of user's error.
-
if an infinite loop is detected I think it would be a good idea to have hfs create a message box to alert the error.
-
at the moment the loop is suddenly stopped and the symbol/macro is not expanded.
since with macros not every infinite loop can be detected, i put a hard limit of 50.