Hi Alex,

> But still I want to keep simple things simple. 'httpGate0' connects
> back to the first port without asking, which I think is the worst
> default behavior.

I guess that it depends on the point of view.  I think httpGate is
more complicated than httpGate0 and also it is broken in the sense
that it does not allow to display a *proper* error or timeout page.

> You need a some management *inside* the application to display a
> proper error or timeout page.

Only inside the default server.  That's the only way to display a
*proper* error or timeout page.

With the current httpGate, I have two choices:

1) dont use 'void' and get "connection error"

2) use 'void' and display a page which is "broken" (no way to link to
   the correct app start page)

3) use one httpGate process per application with different 'void'
   pages (each with hardcoded link to the app start page)

All of those are not good.

> Managing more than one application may be done by "home.l", but is
> not required.

As I understand it, home.l does not manage multiple applications.  It
only rewrites urls/redirects.  It only handles the part when I enter a
human readable link in my browser.  After that, the whole picolisp
system looses track of how to get back to the app start page.

> Timeouts are managed by 'httpGate' and 'void'. The app itself does
> not know about those concepts.

That's the choice I do not agree with;-) I think httpGate should not
handle timeouts.  With httpGate0, the applications do not know about
timeouts either, only the default server can handle that if it wishes

I think that the concept of 'void' is complicated and limited.  I
would say that httpGate prematurely handles timeout with the hardwired
piece of C code and this limits usability.

Also, the error handling in lib/http.l where *CondId <> *SesId and
*ConId <> NIL is a bit arbitrary, while that case suddenly makes sense
in the context of httpGate0.

> I know that everything works as before, and not much code is
> added. But it adds a new concept to 'httpGate' (automatic
> reconnection to the default port, as opposed to a direct error (with
> or without 'void')),

It just interprets httpGate differently.

httpGate: if the url is /([0-9]+)/ connect to port $1, if it fails
display page 'void'. For other urls connect to the default port.

httpGate0: if the url is /([0-9]+)/ connect to port $1.  If it fails
or for other urls connect to the default port.

For the httpGate case, once it fails to connect, it is the end of
everything, I cannot fix the problem (display a *proper* error or
timeout page) as the control path is out of any reach and outside my

> and to the syntax of the session ID, which may now hold an
> additional application name.

Well, syntax of a session id can be anything sufficiently unique so I
don't think that is an issue.  It is not used for anything anyway
except for comparing with other session ids.  And, by default,
application name is NIL so the session id will look the same as now.

Also, it is not necessary to think about it as an application name.
It is simply a string which carries custom information in the url.
That information can then be used later, e.g. to handle timeouts

> That's why I think your solution is good and useful, but a little bit
> too much for the default release.

Fair enough, I see that I won't persuade you on this one;-) I'll have
to patch picoLisp with every release though:-(

Thank you,

UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to