After I sent the prior mail to the list Alex and I had a discussion on
IRC and we realized that there were two problems:
1.) In the interaction in this thread Alex assumed I was running a
simple dedicated process with its own simple http function, I wasn't
though, I was testing with the full monty, editing the real http
function.
2.) I realized that due to my changes the routing would never take
place and that that has been the problem all the time.

So I made a change that would prevent (throw "http) to be called and
everything worked.

Except the Hub was still reporting failure. This prompted me to
instead try ht:Read content length since I had noticed that the line
routine was lagging, and it worked!!

The pertinent section now works like this:

((match '("P" "O" "S" "T" " " "/" @U " " "H" "T" "T" "P" "/" "1" "." @H) L)
                  (on *Post)
                  (off *MPartLim *MPartEnd)
                  (_htHead)
                  (if *Xml
                     (setq *Xml
                        (ht:Read *ContLen))
                     (cond
                        (*MPartLim (_htMultipart))
                        ((if *ContLen (ht:Read @) (line))
                           (for L (split @ '&)
                              (when (cdr (setq L (split L "=3D")))
                                 (_htSet (car L) (ht:Pack (cadr L))) ) ) )
                        (T (throw "http")))))

Now I've gathered that the best way of handling this is through
listening on a dedicated port through (task).

Could it be as simple as: (task (port 4000) (load "hubimport.l")) and
then do whatever it is I want to do in the hubimport.l file? Like
defining a dedicated simple version of (http) and using it to read the
payload for instance?

/Henrik

On Thu, Dec 17, 2009 at 11:25 PM, Henrik Sarvell <hsarv...@gmail.com> wrote=
:
> I've changed the whole http function to:
>
> (de http (S)
> =A0 (setq *Xml
> =A0 =A0 =A0(make
> =A0 =A0 =A0 =A0 (in S
> =A0 =A0 =A0 =A0 =A0 =A0(until (eof) (link (line T))))))
> =A0 (and S (close S) (task S)))
>
> I'm not even trying to do anything with the headers. However with an
> http function looking like this I'm not even able to access the server
> directly on http://localhost:3000/@pubsub it just hangs and refuses to
> return anything.
>
> As expected I'm of course getting things where they are supposed to be
> now, the four last lines of the output:
>
> =A0line =3D "</feed>"
> =A0link : "</feed>"
> =A0link =3D "</feed>"
> =A0task : 40 NIL
> =A0task =3D NIL
>
> I also tried simply replacing with
>
> (when *Xml
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq *Xml
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(make
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (until (eof) (link (l=
ine T))))))
>
> in the real http but as we expected the problem of not finishing with
> executing @pubsub is still there.
>
>
> On Thu, Dec 17, 2009 at 10:50 AM, Alexander Burger <a...@software-lab.de> =
wrote:
>> On Wed, Dec 16, 2009 at 10:15:22PM +0100, Henrik Sarvell wrote:
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (make
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(until (eof) (li=
ne T) (link @)))))
>>
>> Here might be the problem: The (link @) has no definite value in '@', as
>> there is no preceding flow function returning non-NIL (as described
>> under "Flow functions" in "doc/ref.html#atres").
>>
>> So better would be
>>
>> =A0 (make
>> =A0 =A0 =A0(until (eof)
>> =A0 =A0 =A0 =A0 (link (line T)) ) )
>>
>>
>> Note that in the previous case of
>>
>> =A0 (make
>> =A0 =A0 =A0(while (line T)
>> =A0 =A0 =A0 =A0 (link @) ) )
>>
>> the situation was different, as 'while' always set the (non-NIL) value
>> of '@' appropriately.
>>
>> Cheers,
>> - Alex
>> --
>> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe
>>
>
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to