More digging.

Some more interesting, confusing and inconsistant things that come up
during browsing through Jigsaw source code. I know that Jigsaw's code is
relatively neat; i really don't want to know how Netscape enterprise
server or Microsoft web server source code look like. :-}

First easy bits: duplication of code:
1) Client.java duplicates the code in ChunkedOutputStream for (surprise)
chunked output. The only difference is that Client collects number of
bytes sent. (but see later)

2) unescape function in LookupState and Request look very similar for me.
Also the one in Request is even static for those external needs. Should't
this code be moved in some separate class along with escape (which does
not exist, I think but may be very needed in view of some items below).

Another problem with LookupState:
3) It unescapes the path but never escapes it back, when getRemainingPath
is requested. That would create some subtle problems when somebody tries
to write a proxy/redirector resources and uses getRemainingPath to add to
existing url. I think the solution for this (and problem in previous mail)
would be to keep original URI around (already does) and a pointer to
where the last segment has finished and just return a substring of
original URI. That would spare unescaping/escaping, etc.

Another thing that show the problem with escaping/unescaping:
4) Create a resource with a space in its name. (eg directory "test
directory"). Try to access it and familiar "document contains no data"
pops up. Try to modify MirrorDirectory, so it uses getRemainingPath and it
would produce some very interesting results for _some_ of the URLs. Good
example is Add+Extension link on Extensions editor. It becomes unescaped
when it arrives, but later is not escaped before proxy is doing the
request. The only reason MirrorDirectory does not hit this problem is
because it uses original URI string. 


Problem with writing new Fields:
5) Variables are package protected and not protected. The problems arizes
when I am trying to subclass a Field (eg. TextField) and set some of its
variables. I can't. The only two ways left for me is to try doing what I
want by overriding getValue() setValue() only (a bit hard) or copy the
code and modify it instead of reusing it (this might just give the
problems with variables from _its_ parent). Maybe it is design, but I
would like to hear the reason. 
Also, setValue and getValue are not
complimentary, they are called by different classes with different
purposes. That might be an entry for the FAQ.

Confusion with log parameters. This is mostly request for explanation
behind the names/values.

6) Duration parameter. I am just not sure what it is. Jigsaw seem to
define it as time taken to do lookup and perform, but not time taken to
send the data over to the client.

7) Bytes sent. Another mistery. Looking at Client.java, I realised that
bytes count does not include reply headers, but does include the chunk
output headers if chunking is supported. That would mean that the same
output produce different bytes count for different clients. But on another
hand any other headers are not included(?). 

I am very confused as what these numbers can used for and if statistics
generated from them is accurate. :-{


Regards,
 Alex.
Ps. It could be much much worse, I might have been required to decompile
the code and look at mocha output to figure out what is wrong and how to
work around  it. (Anybody ever tried to figure out subtle Jeeves
problems....) :-}

Received on Thursday, 3 April 1997 02:52:31 UTC