2014-02-04 Roberto De Ioris <[email protected]>:
>
>> Hi,
>>
>> I have chatted with some of you on IRC, but
>> today's DDoS on FreeNode made me resort to the list :P
>>
>> So basically I'm writting a C++/Qt web framework, and
>> because uWSGI allows me to get all uWSGI goodies
>> without worrying to create parsers I created a plugin.
>>
>> It's almost done thanks to some people on IRC but
>> I still have two issues, how do I iterate over
>> wsgi_request->headers (trying to access any struct
>> member crashes the app),
>
>
> This pointer holds the currently built response headers, why you need to
> access it ?

hmm I actually need the request headers how do I get them?


>> and how should I handle loading application
>> on init_apps(), by this I unsure because this method
>> doesn't have arguments and so from where could
>> I get the path to the apps to load.
>
> you should initialize your application in that hook (not in the ->init()
> one that is used to generically initialize the plugin).
>
> In init_apps() hook you shoud have (generally at the end):
>
> // get the current app id
> int id = uwsgi_apps_cnt;
> // register a new app under a specific "mountpoint"
> uwsgi_add_app(id, your_plugin.modifier1, "", 0, NULL, NULL);
> // if in lazy-apps mode, fix it
> uwsgi_emulate_cow_for_apps(id);

Ok, I dunno how one configure an uWSGI server
but I imagine it could be something like:

[Foo App]
plugin=cutelyst.so
app=foo.so
root="/foo"

[Bar App]
plugin=cutelyst.so
app=bar.so
root="/bar"

so in init_apps how do
I get which app the user wants
and the root or mountpoint?

Thanks


-- 
Daniel Nicoletti

KDE Developer - http://dantti.wordpress.com
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to