View Issue Details

IDProjectCategoryView StatusLast Update
0000109easycwmpQuestionpublic2016-01-25 09:22
Reporterswcims Assigned Tomohamed.kallel  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
PlatformOpenWRTOSLinux 
Summary0000109: Can easycwmp support cookie?
DescriptionHi Manager,
   It seems that easycwmp does not support cookie.
   We have one test: CPE sends inform packet to ACS, ACS will send InformRespose packet with cookies msg(for example,Set-Cookie2: session="xxxxxx"; Version="1"; Discard).Then CPE need to send the cookie information in all subsequent HTTP requests within the same CWMP session, including any final empty posts used to indicate session termination.
  But easycwmp does not response with the cookie.And I cannot get the cookie information from "/tmp/easycwmp_cookies". Is it the issue on curl configuration with COOKIE option ?
  Thanks!
TagsNo tags attached.
e-mail notification

Activities

mohamed.kallel

2016-01-06 09:22

administrator   ~0000363

EasyCwmp supports cookies.
May be it's a libcurl issue.
What libcur version are you using?
I m using libcurl7.43.0 and the cookies work properly!

swcims

2016-01-07 11:24

reporter   ~0000366

Last edited: 2016-01-07 11:25

It seems that curl does not handle "Set-Cookie2" information, only handle "Set-Cookie". Would you please provide advice? Thanks!

swcims

2016-01-08 05:24

reporter   ~0000367

Modify curl and fixed this issue.

mohamed.kallel

2016-01-08 11:18

administrator   ~0000368

Could you share what you have fixed in libcurl and what's the libcurl version

swcims

2016-01-19 05:23

reporter   ~0000381

curl-7.29, Here is the patch:
--- curl-7.29.0.org/lib/http.c 2013-01-18 05:40:43.000000000 +0800
+++ curl-7.29.0/lib/http.c 2016-01-08 11:38:24.588468943 +0800
@@ -3405,6 +3405,20 @@ CURLcode Curl_http_readwrite_headers(str
                       data->state.path);
       Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
     }
+ else if(data->cookies &&
+ checkprefix("Set-Cookie2:", k->p)) {
+ Curl_share_lock(data, CURL_LOCK_DATA_COOKIE,
+ CURL_LOCK_ACCESS_SINGLE);
+ Curl_cookie_add(data,
+ data->cookies, TRUE, k->p+12,
+ /* If there is a custom-set Host: name, use it
+ here, or else use real peer host name. */
+ conn->allocptr.cookiehost?
+ conn->allocptr.cookiehost:conn->host.name,
+ data->state.path);
+ Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
+ }
+
 #endif
     else if(checkprefix("Last-Modified:", k->p) &&
             (data->set.timecondition || data->set.get_filetime) ) {

swcims

2016-01-19 05:35

reporter   ~0000382

This patch can handle packet with "Set-Cookie2" info.
But there is still one issue.
If the cookie messages are without "Path", for example:
        Set-Cookie2: session="xxxxxx"; Version="1"; Discard
  or
        Set-Cookie: session="xxxxxxx"; Max-Age="600"; Version="1"
easycwmp can send the correct cookie info in the subsequent empty post packet.
However, if the cookie msgs are with "Path", for example:
       Set-Cookie2: session="xxxxxxx"; Version="1"; Discard; Path="/"
  or
       Set-Cookie: session="xxxxxxx"; Max-Age="600"; Version="1"; Path="/"
easycwmp will not send the cookie info in the empty post packet.
     It seems that eascycwmp(?curl?) has some problem to handle cookie info with Path.
   Would you please provide your advice? Thanks!

mohamed.kallel

2016-01-19 09:55

administrator   ~0000386

I did not play with set-cookie neither with set-cookie2 in libcurl. I can not make any advice here. But I have a question: Does a such problem appear with the newest version of libcurl?

Issue History

Date Modified Username Field Change
2016-01-06 07:22 swcims New Issue
2016-01-06 09:22 mohamed.kallel Note Added: 0000363
2016-01-06 09:26 mohamed.kallel Category Bug => Question
2016-01-07 11:24 swcims Note Added: 0000366
2016-01-07 11:25 swcims Note Edited: 0000366
2016-01-08 05:24 swcims Note Added: 0000367
2016-01-08 09:12 mohamed.kallel Status new => resolved
2016-01-08 09:12 mohamed.kallel Resolution open => no change required
2016-01-08 09:12 mohamed.kallel Assigned To => mohamed.kallel
2016-01-08 11:18 mohamed.kallel Note Added: 0000368
2016-01-19 05:23 swcims Note Added: 0000381
2016-01-19 05:23 swcims Status resolved => feedback
2016-01-19 05:23 swcims Resolution no change required => reopened
2016-01-19 05:35 swcims Note Added: 0000382
2016-01-19 05:35 swcims Status feedback => assigned
2016-01-19 09:55 mohamed.kallel Note Added: 0000386
2016-01-25 09:22 mohamed.kallel Status assigned => resolved
2016-01-25 09:22 mohamed.kallel Resolution reopened => no change required