Hi Alex,

Regarding your first comment:
1) The patch doesn't break compilation on my side…
2) I did change the call:
-    *cgivars = parse_cgivars(client->url);
+    *cgivars = parse_cgivars(client->method, client->url, 
client->request->body);
Please could you check again?


Regarding your second comment:
1) I re-used parse_cgivars() on purpose. If we create 2 different functions, 
about 75% of the code (the actual parsing) will be the same. So we should 
create instead 3 functions: 1 to process the GET parameters, 1 to process the 
POST parameters and a shared one to actually parse the variables.
It seems over-complicated compared to the 4 lines I have added in 
parse_cgivars().
2) Where did you see that CGI variables are only related to the GET method? As 
far as I know, POST and GET are only 2 different methods to pass CGI variables.

Regards,
Franck


From: Alexander Malysh [mailto:malys...@gmail.com] On Behalf Of 
amal...@kannel.org
Sent: Wednesday, October 28, 2015 10:58 AM
To: Lamasuta, Franck, Vodafone Automotive
Cc: devel@kannel.org
Subject: Re: [PATCH] Parsing of parameters in POST requests

Hi Franck,

thanks for your patch but I can’t accept it.

1. It break compilation, because you change function declaration but not a 
calls.
2. I don’t think that parse cgivars function is the right place to do it. CGI 
vars are GET method

I think it’s better to implement new parse function and caller should decide 
wich one to use.

Alex

Am 20.10.2015 um 17:41 schrieb Lamasuta, Franck, Vodafone Automotive 
<franck.lamas...@vodafonetelematics.com<mailto:franck.lamas...@vodafonetelematics.com>>:

Hi list,

When Kannel receives HTTP requests, it parses the parameters in the URL. This 
is fine for GET or HEAD requests. But it isn't for POST requests as the 
parameters are supposed to be supplied in the body.

One of our partners (Maxis, in Malaysia)  sends HTTP POST requests to submit 
the delivery reports and Kannel can't process them correctly.
Please find attached a patch to fix this issue.
It allows Kannel to parse the parameters from the body when it's a POST and 
from the URL, like before, for the other HTTP methods.

Regards,
Franck

This message and any files or documents attached are strictly confidential or 
otherwise legally protected. It is intended only for the individual or entity 
named. If you are not the named addressee or have received this email in error, 
please inform the sender immediately, delete it from your system and do not 
copy or disclose it or its contents or use it for any purpose. Please also note 
that transmission cannot be guaranteed to be secure or 
error-free.<gwlib_http.c.diff>

This message and any files or documents attached are strictly confidential or 
otherwise legally protected. It is intended only for the individual or entity 
named. If you are not the named addressee or have received this email in error, 
please inform the sender immediately, delete it from your system and do not 
copy or disclose it or its contents or use it for any purpose. Please also note 
that transmission cannot be guaranteed to be secure or error-free.

Reply via email to