Hi Alex,

>> > A direct link to the "default" port might not always be desired, as
>> > this is often not the main application (but some other "home" page).
>> 
>> I cannot see how this can be a problem?  Having the same
>
> As you know, we are using PicoLisp and 'httpGate' for web applications.
> On the default port 80 there is usually some web presence of the
> customer's company, while the web application(s) run "hidden" on other
> ports.
>
> So the default port of 'httpGate' points to the home page, in case
> somebody connects to "www.company.com". But this page will never time
> out, so the above error will never appear.
>
> The application(s) run on "www.company.com/1", or on "app.company.com",
> or similar. Such an application might time out.

I still cannot see why do you think it is a problem.  httpGate0
approach could easily behave the same for your configuration.  It
could even be more user friendly, which is what I am trying to
achieve.  The only problem I see is that you have it deployed already
and do not want a change, i.e. moving 'void' out from httpGate to
default server;-)

> I do not want to hard-code the knowledge of this strategies into
> 'httpGate'.

I did not hardcode anything into httpGate0.  On the contrary, httpGate
has a "magic" convention/file 'void' hardcoded but it is still not
"powerful" enough;-) httpGate0 does not need that hardcoded, it leaves
that behaviour to the default server.

> With the "void" link, the decision is handled dynamically.
>
>> The page can be arbitrary but static.  That means that if I have more
>
> Not as static as a hard-coded redirect to a default port. For example,
> we used
>
>       ...
>       <meta http-equiv="refresh" content="4; URL=<appStartPage>">
>       <title>Timeout</title>
>    </head>
>    <body>
>       <h2>Session timed out</h2>
>       <p>Re-connecting to <a href="<appStartPage>">application</a> in 4 
> seconds ...</p>
>       ...
>
> for some applications. Then the user will see the timeout message, and
> can click on the link to immediately reconnect, or otherwise will be
> connected automatically after the timeout expires (here 4 seconds).
>
> If you immediately connect to the default port, the user will not have a
> chance to see the "timed out" message. He will be very much surprised
> being in the application and at some different (start) page the next
> moment he clicks something.

The exact same thing can be easily achieved using the httpGate0
approach.  By "static" I mean that <appStartPage> does not change, it
is hardcoded in the page while with httpGate0 approach it can be
computed by the default server.

>> The page can be arbitrary but static.  That means that if I have more
>> web applications, the only thing I can display is that the session
>> expired but I cannot show a link or redirect to the original
>> application.
>
> Of course you can display, e.g. a list of links to all those
> applications.

But why the user should be forced to think for a moment, make a
conscious choice and search for the right link when this is completely
unnecessary?  And what if he is not supposed to know what other
applications are there in the first place?


Thinking about it more:

1) lib/http.l should have *AppName variable.  *AppName could be either
   NIL or set by the programmer:

   (setq *AppName "myapp")
   ...
   (server 1234 "@start")

2) *SesId should be

   (pack *AppName (when *AppName "/") (in "/dev/urandom" (rd 7)) "~")

   instead of

   (pack (in "/dev/urandom" (rd 7)) "~")

3) lib/http.l should be changed to allow for "better" handling of
   session error:

            (if (<> *ConId *SesId)
               (if *ConId
                  (out S (http404))
                  (close S)
                  (task S)
                  (off S) )

   should be changed to

            (if (<> *ConId *SesId)
               (if *ConId
                  (sesErr S)
                  (close S)
                  (task S)
                  (off S) )

   (de sesErr (S)
      (out S (http404)) ) # or display some other page/message

4) The default server could simply redefine sesErr and redirect or
   display the right page with a computed link to the original
   application (which can be easily determined from the *ConId). E.g.

   (redef sesErr (S)
      (if (match '(@A "/" @N) *ConId)
         (redirect *Gate "://logand.com/admin/" @A)
         (sesErr) ) )

   Of course, it could render the same page as you described (with
   timed redirect) but <appStartPage> could be computed here from @A.
   Even the configuration files for home.l you posted earlier could be
   reused for this computation.

What do you think?

Thank you,

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

Reply via email to