Re: http server hangs on post without enctype=multipart/form-data

2008-11-26 Thread Tomas Hlavaty
Hi Alex,

 My suspicion is that it has something to do with Keep-Alive, and one

just a thought: even if the client sends keep-alive, the server can
respond close and close the connection.  Is there any particular
reason you do not want to close the connection after you served the
request? Would you get those problem if you always closed the connection?

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-26 Thread Tomas Hlavaty
Hi Alex,

 Sometimes POST seems to lose data, or contain data out of
 context. No idea yet, but I observe this once every few weeks, and
 I'm tracing the activities now.

I haven't noticed this yet but I'll let you know if I do;-)

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-26 Thread Alexander Burger
Hi Tomas,

 it works for me now with ht:Read.

Fine! :-)


 Would it be possible to put comment into CHANGES file?

Usually I mention there only kernel changes (though until 2006 I
regarded some GUI parts also as belonging to the kernel).

At the moment I'm still searching for a Heisenbug, occasionally occuring
at some customer's sites. Sometimes POST seems to lose data, or contain
data out of context. No idea yet, but I observe this once every few
weeks, and I'm tracing the activities now.

I hope I'll find it soon, so I could write 'HTTP protocol bugs in
lib/http.l' after that?


 Do you use any version control system?

None, except for frequent snapshots.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-26 Thread Tomas Hlavaty
Hi Alex,

it works for me now with ht:Read.

Would it be possible to put comment into CHANGES file?

Do you use any version control system?

Thanks,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Alexander Burger
On Sun, Nov 23, 2008 at 10:29:35AM +, Tomas Hlavaty wrote:
 What about using 'peek' on the last char?

Yes, this might do.

 A C function 'char1' might be fastest fix probably.

Or 'ht:Read' in src/ht.c, usable as: (ht:Read *ContLen)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Tomas Hlavaty
 I was thinking about rewriting the server, I already wrote a
 prototype asynchronous http server but I have only the reading part
 non-blocking and not the writing part yet.  I do not want to spend
 too much time on it right now.

Sorry, I was not clear.  It would not have to be a asynhronous server,
just structured a bit differently than the current one... but then how
far do we want to go changing the server?  We would need to be careful
to keep it working with @lib/form.l

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Tomas Hlavaty
 An even better solution might be to extend the built-in 'line' function
 in that a way that when only a single 'cnt' argument is passed it is
 taken as a length parameter. The idea is that in the current semantics
 of 'line' a single 'cnt' argument makes no sense.

But would cnt mean number of chars or number of bytes?  That could be
confusing.

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Alexander Burger
On Sun, Nov 23, 2008 at 01:16:55PM +0100, Alexander Burger wrote:
 Let me investigate a solution like (ht:Read *ContLen), returning a
 single-char-line for a given number of bytes.

OK, I've built this now. The 'ht' library has a new function 'Read'. I
had also to change lib/form.js (remove the linefeeds from the data
sent by a XMLHttpRequest).

It is available in the new picoLisp.tgz. I hope this is all right.
Needs good testing ;-)

@Henrik: Now it should be OK if you remove your patch from jQuery.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Alexander Burger
Hi Tomas,

 you to get http query vars in assoc list (see *HtVars and
 *HtVarsHook).

Sometimes it is possible to make application-specific changes or
extensions dynamically at application startup, without the need to
modify the system files.

For example, your extension of '_htSet'

 (de _htSet (Var Val)
(if (and *HtVarsHook (*HtVarsHook))
   (push '*HtVars (cons (pack Var) Val))
   (use (@N @V @Z)
 ...

can also be be achieved with

   (redef _htSet @
  (if (and *HtVarsHook (*HtVarsHook))
 (push '*HtVars (cons (pack (next)) (next)))
 (pass _htSet) ) )

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Tomas Hlavaty
Hi Alex,

thanks for fixing it.

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Tomas Hlavaty
Hi Alex,

(redef _htSet @
   (if (and *HtVarsHook (*HtVarsHook))
  (push '*HtVars (cons (pack (next)) (next)))
  (pass _htSet) ) )

thank you, I will use this;-)

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Alexander Burger
Henrik + Tomas,

many thanks for pointing out this bug! I feel much better now :-)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: http server hangs on post without enctype=multipart/form-data

2008-11-23 Thread Alexander Burger
Hi Tomas,

 I would expect 'char' to block and return next character when
 available and 'peek' return the next character if available otherwise
 return nothing without blocking.

On that level there is no concept of blocking. Data are read as a
logical stream. Something similar to what you suggest might be achieved
with 'poll', but not completely, and probably not in our case.

'peek' returning nothing would have a different meaning. For normal
operations I *do* it want to block, until I receive all data.


 I guess it seems broken to me because of the two char lookahead in
 'char', but is it necessary?  Is it only to handle different line
 endings?

'char' has to cooperate with 'read', 'line', 'till', 'skip, etc. And the
logic behind these functions (most notably 'read') require that
internally there is always a single-character lookahead, and thus one
more character read than necessary.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]