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

Mailing List Archive: Cherokee: users

'External' handler development

 

 

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


skinkie at xs4all

Jun 16, 2008, 7:06 PM

Post #1 of 2 (212 views)
Permalink
'External' handler development

Hi,


For sake of documentation I have created a start for handler_example.c
(forked from server_info). A module that should be well documented and
shows some patterns for new developers.

I see two things if I pull this file from the well found source tree;
since it is required to include <cherokee/cherokee.h> instead of the
loose headers it looks more easy, but it fact it gets buggy:


skinkie[at]xen01 ~/development/htdocs/cherokee $ make
gcc -fPIC -shared -I/opt/cherokee/include -o libplugin_example.so
handler_example.c
In file included from /opt/cherokee/include/cherokee/cherokee.h:35,
from handler_example.h:37,
from handler_example.c:26:
/opt/cherokee/include/cherokee/util.h:102: warning: 'struct passwd'
declared inside parameter list
/opt/cherokee/include/cherokee/util.h:102: warning: its scope is only
this definition or declaration, which is probably not what you want
/opt/cherokee/include/cherokee/util.h:103: warning: 'struct group'
declared inside parameter list


It also seems that...

connection-protected.h:#define CONN_SRV(c) (SRV(CONN(c)->server))

Provides some non trivial header magic. But including this file by
itself pulls in *a lot* of other header files. Including
config.h/constants.h


I managed to get all the header files:

connection-protected.h
common-internal.h <-- needs update <config.h/constants.h> -> "..."
socket.h
iocache.h
encoder_table.h
header-protected.h
matching_list.h
virtual_server.h
virtual_server_names.h
rule_list.h
config.h
constants.h

...obviously cherokee/cherokee.h need to include connection-protected.h


Sources:
http://xen.bot.nu/cherokee/


I hope it would we could get some examples dir in the source tree
containing some useful examples for cherokee development.



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


alvaro at gnu

Jun 17, 2008, 12:55 AM

Post #2 of 2 (196 views)
Permalink
Re: 'External' handler development [In reply to]

On 17 Jun 2008, at 04:06, Stefan de Konink wrote:

> For sake of documentation I have created a start for handler_example.c
> (forked from server_info). A module that should be well documented and
> shows some patterns for new developers.

Good!! The "hello world" example we talked about..

> connection-protected.h:#define CONN_SRV(c) (SRV(CONN(c)->server))
>
> Provides some non trivial header magic. But including this file by
> itself pulls in *a lot* of other header files. Including
> config.h/constants.h
>
> I managed to get all the header files:
>
> connection-protected.h
> common-internal.h <-- needs update <config.h/constants.h> -> "..."
> socket.h
> iocache.h
> encoder_table.h
> header-protected.h
> matching_list.h
> virtual_server.h
> virtual_server_names.h
> rule_list.h
> config.h
> constants.h
>
> ...obviously cherokee/cherokee.h need to include connection-
> protected.h

No, it does not.

Actually, from an OOP point of view, you must think of the *-
protected.h header files as headers that only contains protected and
private methods and properties. Thus, it should never be part of the
public cherokee API, which is what cherokee/cherokee.h is exporting.

Having said that, I acknowledge a few issues about the API that is
currently being exported: there are a few private classes and methods
for public classes that ought to be exported.

Currently, the world around is to include the cherokee headers from
the source tree and compile the handler without including <cherokee/
cherokee.h> but the individual header files. But, of course, this is
only a temporal work-around.

> Sources:
> http://xen.bot.nu/cherokee/
>
> I hope it would we could get some examples dir in the source tree
> containing some useful examples for cherokee development.

I would rather create a new independent package for it: "cherokee-
hello-world" or something. In that way, we would show the source code
and an example on how to compile it.

--
Greetings, alo.
http://www.alobbs.com/

_______________________________________________
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.