Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
HTTP HTTP
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • RiscOS
    • SSources
    • NNetworking
  • Fetchers
  • HTTPHTTP
  • Merge requests
  • !9

Closed
Created Jan 18, 2022 by Matthew Phillips@mphillipsDeveloper
  • Report abuse
Report abuse

Correct the counting of stored and queued cookies

  • Overview 9
  • Commits 1
  • Changes 1

Tallies of the stored and queued cookies are maintained in total_cookies and unread_cookies. The values are returned in HTTP_EnumerateCookies. Both have errors in their calculation.

The queued cookie count continued going up even when MAX_COOKIES_IN_QUEUE was reached and older cookies were being discarded. Also errors in the counting and the condition meant that two more cookies were queued than defined in MAX_COOKIES_IN_QUEUE.

The total_cookies count was reduced when a cookie was discarded from the queue via HTTP_ConsumeCookie because destroy_cookie is used for freeing a cookie structure in both situations. The count was also reduced in two situations where new cookies were not added to the store because they were invalid. One case was HTTP_AddCookie if an invalid parameter was given, and the other case was in creating a cookie via an HTTP response.

To solve this the total_cookies decrement operation is moved from destroy_cookie to remove_cookie_from_list.

I have also corrected a comment in the code, which had a misleading "not" in.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: FixCookieCounts