View Issue Details

IDProjectCategoryView StatusLast Update
0000106easycwmpBugpublic2016-01-05 14:59
Reporterswcims Assigned Tomohamed.kallel  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOpenWRTOSLinux 
Summary0000106: Supporting HTTP 302, 307 status code in EasyCwmp
DescriptionFrom TR-069_Amendment-3, p35:
A CPE MUST support the 302 (Found) and 307 (Temporary Redirect) HTTP status codes.
The CPE MUST allow redirection to occur at any point during a session (including
the Inform response), and the ACS MAY issue a redirect at any point during a
session.
• If the CPE is redirected, it MUST attempt to continue the session using the URL
provided in the HTTP redirect response. Specifically, the CPE MUST re-send the
HTTP POST that resulted in the redirect response to the ACS at the redirected URL,
and the CPE MUST then attempt to proceed with the session exactly as if no
redirection had occurred
It seems that easycwmp does not support this requirement now.Is there any plan to implement it?
Thanks!
TagsNo tags attached.
e-mail notification

Activities

mohamed.kallel

2015-12-30 11:52

administrator   ~0000350

Last edited: 2015-12-30 12:08

EasyCwmp does not support the 302 (Found) and 307 (Temporary Redirect) HTTP status codes because the libcurl does not support them.

We have a plan to implement this feature.

If you have any patch proposal, please do no hesitate to share it.

swcims

2015-12-31 09:17

reporter  

http302-easycwmp.cap (77,119 bytes)

swcims

2015-12-31 09:18

reporter   ~0000352

Last edited: 2015-12-31 09:30

Hi manager,

   I have some debugging information, hope it can be of help.
   1) I add "curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);" in http.c.curl would send "GET" packet to the redirect url; then the redirect url sent "Authorization Required" to easycwmp, but easycwmp did not sent authorization packet and still sent "GET" packet. Please see the packets. I do not why curl in easycwmp sent "GET" not "Post" packet to redirect url, and how to do authorization with this redirect url?
   2) I add "char *redirect_url;curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &redirect_url);". It is able to get the redirect url from http 302 packet. So it seems need to write special sending packets function to redirect url, but I am not so familiar with the packet sending/receiving flow/mechanism.
   Is it possible to do improvement on 1)? Would you please provide advice? Thanks!
   (In packet captured, ip address 6.0.0.1 is ACS server, 10.0.0.2 is device with easycwmp , the redirect url is 192.168.201.1)

mohamed.kallel

2015-12-31 09:58

administrator   ~0000353

Last edited: 2015-12-31 09:59

Does the http digest authentication work without redirect?

swcims

2015-12-31 10:50

reporter   ~0000354

Last edited: 2015-12-31 10:53

Http digest authentication worked when easycwmp interacted with ACS Server at the beginning of this test.easycwmp worked well with ACS.
Then ACS send the http 302 packet with redirect url.If "CURLOPT_FOLLOWLOCATION was set", curl in easycwmp sent "GET" packet to the redirect url. And then redirect url sent "Authorization Required" to easycwmp. This authentication failed.
(In this test, ACS server and redirect url are in the same PC, they are simulated by the test tool, for example, CDRouter test tool from QACAF)

mohamed.kallel

2016-01-04 14:35

administrator   ~0000355

fixed in EasyCwmp-1.2.6

swcims

2016-01-05 11:47

reporter   ~0000358

Last edited: 2016-01-05 11:48

Hi Manager,
   There should have one error.http_client_exit() should behind of strdup().
   In your patch,http_redirect_url will be freed because http_client_exit() will call curl_easy_cleanup().Here is the new patch:

+ if (httpCode == 302 || httpCode == 307) {
+ curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &http_redirect_url);
+ if ((http_redirect_url = strdup(http_redirect_url)) == NULL)
+ return -1;
+ http_client_exit();

mohamed.kallel

2016-01-05 12:02

administrator   ~0000360

Yes, you are right. Thank you.
I will apply your patch

mohamed.kallel

2016-01-05 14:59

administrator   ~0000361

fixed in EasyCwmp-1.2.7

Issue History

Date Modified Username Field Change
2015-12-29 10:56 swcims New Issue
2015-12-30 11:52 mohamed.kallel Note Added: 0000350
2015-12-30 12:08 mohamed.kallel Note Edited: 0000350
2015-12-31 09:17 swcims File Added: http302-easycwmp.cap
2015-12-31 09:18 swcims Note Added: 0000352
2015-12-31 09:20 swcims Note Edited: 0000352
2015-12-31 09:30 swcims Note Edited: 0000352
2015-12-31 09:58 mohamed.kallel Note Added: 0000353
2015-12-31 09:59 mohamed.kallel Note Edited: 0000353
2015-12-31 10:50 swcims Note Added: 0000354
2015-12-31 10:53 swcims Note Edited: 0000354
2016-01-04 14:16 mohamed.kallel Summary When will easycwmp support HTTP 302, 307 status code? => EasyCwmp support HTTP 302, 307 status code
2016-01-04 14:16 mohamed.kallel Summary EasyCwmp support HTTP 302, 307 status code => Supporting HTTP 302, 307 status code in EasyCwmp
2016-01-04 14:35 mohamed.kallel Note Added: 0000355
2016-01-04 14:35 mohamed.kallel Status new => resolved
2016-01-04 14:35 mohamed.kallel Resolution open => fixed
2016-01-04 14:35 mohamed.kallel Assigned To => mohamed.kallel
2016-01-05 11:47 swcims Note Added: 0000358
2016-01-05 11:47 swcims Status resolved => feedback
2016-01-05 11:47 swcims Resolution fixed => reopened
2016-01-05 11:48 swcims Note Edited: 0000358
2016-01-05 12:02 mohamed.kallel Note Added: 0000360
2016-01-05 14:59 mohamed.kallel Note Added: 0000361
2016-01-05 14:59 mohamed.kallel Status feedback => resolved
2016-01-05 14:59 mohamed.kallel Resolution reopened => fixed