[Klone-users] GET/POST confused methods

Stefano Barbato barbato at koanlogic.com
Sat Apr 19 06:15:41 EDT 2008


Hi Mickeal,

next release will have it :)

bye,
stefano

On 17/apr/08, at 17:03, Mickael Auger wrote:

> Hi Stefano,
>
> > so how would you patch klone?
> >adding two *distinct* arrays holding GET and POST variables  
> indipendently?
> I think that the existing way must be preserved.
> The current way concatenates the GET and POST variables with the  
> "request_parse_urlencoded_data" function.
> When the GET and POST variables have the same name, the POST  
> variables are ignored because the "vars_add_urlvar" function doesn't  
> add two variables with the same name (it's normal).
>
> To distinguish GET and POST methods, I could process as
>
> The "struct request_s", defined in request.c, should have two fields
> ==========================
>    vars_t *getargs;            /* get args */
>    vars_t *postargs;           /* post args */
> ==========================
>
>
> This C file could have the next methods :
> ==========================
> vars_t *request_get_getargs(request_t *rq)
> {
>     dbg_return_if (rq == NULL, NULL);
>     return rq->getargs;
> }
>
> const char *request_get_getarg(request_t *rq, const char *name)
> {
>     var_t *v;
>     dbg_return_if (rq == NULL, NULL);
>     dbg_return_if (name == NULL, NULL);
>     v = vars_get(rq->getargs, name);
>     return v ? var_get_value(v): NULL;
> }
> ==========================
> idem for POST.
>
> The "request_parse_urlencoded_data" function should memorize the GET  
> variables in "getargs" and the POST variables in "postargs" in the  
> "struct request_s" before the concatenation between GET and POST  
> variables.
>
> This feature could be desactivate to the compilation with the  
> presence or not of a "#define".
>
> Thank you.
>
> -- 
> Mickaël AUGER
> mickael.auger at gmail.com
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users





More information about the klone-users mailing list