Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Cherokee and its mysterious connection dropping

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


skinkie at xs4all

May 28, 2008, 9:59 AM

Post #1 of 7 (375 views)
Permalink
Cherokee and its mysterious connection dropping

Hi,


In the past I found many strange issues using Cherokee for Cisco
telephone provisioning. Basically all request arrived broken. Currently
I have a similar problem with a Java program.

http://xen.bot.nu/josm-request.pcap


It is 100% clear that a program like wget works. But as you can see in
the last packet in pcap, the XML file isn't transfered fully. I saw this
behavior on a big website too, packets that are reset or have a
non-normal scenario seems to be ignored/dropped.

Could anyone take a peek at the file and advise what to do?




Stefan
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


alvaro at sun

May 28, 2008, 10:18 AM

Post #2 of 7 (345 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

On 28 May 2008, at 18:59, Stefan de Konink wrote:

> In the past I found many strange issues using Cherokee for Cisco
> telephone provisioning. Basically all request arrived broken.
> Currently
> I have a similar problem with a Java program.
>
> http://xen.bot.nu/josm-request.pcap
>
>
> It is 100% clear that a program like wget works. But as you can see in
> the last packet in pcap, the XML file isn't transfered fully. I saw
> this
> behavior on a big website too, packets that are reset or have a
> non-normal scenario seems to be ignored/dropped.
>
> Could anyone take a peek at the file and advise what to do?

I'm going to check it out; although I don't think I will be able to do
much if I cannot reproduce the problem locally. Have you found a way
to make it fail?

--
Greetings, alo.

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


skinkie at xs4all

May 29, 2008, 2:18 AM

Post #3 of 7 (339 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Ok :) My mistake, offlist we have discussed what was wrong with my code.


Then again, why should I solve it with:

if (hdl->buffer.len > 0) {
ret = cherokee_buffer_add_buffer (buffer, &hdl->buffer);
cherokee_buffer_move_to_begin (&hdl->buffer, buffer->size);
if (hdl->buffer.len == 0)
return ret_eof_have_data;

return ret_ok;
} else
return ret_eagain;


While server_info itself can do only the add_buffer method? Is this a
shortcut because it is assumed to be less that 8k?

So what am I working on?

I'm creating a handler for the OpenStreetMap project, that uses
MonetDB5/SQL+GIS as backend. In best case to replace Lighttpd+Ruby+MySQL.



Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREKAAYFAkg+dOIACgkQYH1+F2Rqwn18igCcCMWDq3lL4D5/1r/ypvrf4x59
5Z8An3XyYj2CPus+EUaHsCgwKn8srR9g
=Qkfe
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


alvaro at sun

May 29, 2008, 2:46 AM

Post #4 of 7 (342 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

On 29 May 2008, at 11:18, Stefan de Konink wrote:

> While server_info itself can do only the add_buffer method? Is this a
> shortcut because it is assumed to be less that 8k?

I don't think I have understood the question.
Anyway, let me briefly summarize how a handler internally works:

- First of all, the handler is instanced by calling its _new() method.

- Then, the _init() method is called. It ought to prepare whatever the
handler needs to reply the request: a data base connection, open a
file, build a file list, etc.

- The _add_headers() method is invoked, and the handler returns the
request reply headers, if any.

- And finally, the _step() method is called a number of times. It
usually returns a chunk of information each time that it is
called. Actually, the method returns a code that points the server
what has happened inside:

* ret_ok: There is new information in the buffer..
* ret_eagain: No information in the buffer: try again
* ret_eof: It is done. All the information has been sent.
* ret_eof_have_data: It is an optimization. There is information in
the buffer, but you know in advanced that it is the last chunk. It
could be translated to two calls: ret_ok + ret_eof.

> So what am I working on?
>
> I'm creating a handler for the OpenStreetMap project, that uses
> MonetDB5/SQL+GIS as backend. In best case to replace Lighttpd+Ruby
> +MySQL.

Sounds pretty interesting.. :-)

--
Greetings, alo.

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


skinkie at xs4all

May 29, 2008, 2:52 AM

Post #5 of 7 (341 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

On Thu, 29 May 2008, Alvaro Lopez Ortega wrote:

> On 29 May 2008, at 11:18, Stefan de Konink wrote:
>
> > While server_info itself can do only the add_buffer method? Is this a
> > shortcut because it is assumed to be less that 8k?
>
> I don't think I have understood the question.

Please elaborate on the use of:

ret_t
cherokee_handler_admin_step (cherokee_handler_admin_t *ahdl,
cherokee_buffer_t *buffer)
{
cherokee_buffer_add_buffer (buffer, &ahdl->reply);
return ret_eof_have_data;
}



Why on that place, that is allowed, and no need for the advanced method.


Stefan

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


alvaro at sun

May 29, 2008, 3:14 AM

Post #6 of 7 (342 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

On 29 May 2008, at 11:52, Stefan de Konink wrote:
> On Thu, 29 May 2008, Alvaro Lopez Ortega wrote:
>> On 29 May 2008, at 11:18, Stefan de Konink wrote:
>>
>>> While server_info itself can do only the add_buffer method? Is
>>> this a
>>> shortcut because it is assumed to be less that 8k?
>>
>> I don't think I have understood the question.
>
> Please elaborate on the use of:
>
> ret_t
> cherokee_handler_admin_step (cherokee_handler_admin_t *ahdl,
> cherokee_buffer_t *buffer)
> {
> cherokee_buffer_add_buffer (buffer, &ahdl->reply);
> return ret_eof_have_data;
> }

Well, the case of the "admin" handler is a little bit special.

It receives a request, and it parsers it and performs an action before
the reply is sent. Depending on what happens during the action the
answer will be different.

So, when the _step() method is invoked, it already has a buffer with
the full reply. The only thing it does is to copy the reply to the
server buffer. Besides, knowing that it is the last package (the only
one, actually) it returns ret_eof_have_data to let the server know
that it shouldn't call _step() any more.

Anyway, let's see what the common behavior is. For instance, this is
how a simplistic handler "file" would work:

1.- new(): It initializes the new object
2.- init(): It opens the file the will be read
3.- add_headers(): Checks size and adds the content-length header
4.- step(): read() in to the buffer and return ret_ok;
5.- step(): read() in to the buffer and return ret_ok;
6.- step(): read() in to the buffer and return ret_ok;
7.- step(): get an EOF from read() so it returns ret_eof;

So, in the case you would have known in advance that the chunk read on
stage 6 was the last one, you could have replied ret_eof_have_data,
and _step() wouldn't have been invoked the seventh time. (Do not worry
much about this, it's only a small optimization).

Does this help to clarify things?

--
Greetings, alo.

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


skinkie at xs4all

May 29, 2008, 4:37 AM

Post #7 of 7 (338 views)
Permalink
Re: Cherokee and its mysterious connection dropping [In reply to]

Alvaro Lopez Ortega schreef:
> Well, the case of the "admin" handler is a little bit special.
>
> It receives a request, and it parsers it and performs an action before
> the reply is sent. Depending on what happens during the action the
> answer will be different.

I understand why it is required to 'step', but I don't see why (in my
case) where I build the page in the init phase I still need to step,
step, while the admin handler doesn't do this and just copies buffers :)

But maybe it is possible that the admin clearly has a reply (while i'm
still building the page).


Stefan
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.