Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 853
    • Issues 853
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !645

gsocketlistener: Fix multiple returns of GTask when accepting sockets

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Philip Withnall requested to merge pwithnall/glib:gdbus-peer-fix-multiple-returns into master Feb 08, 2019
  • Overview 5
  • Commits 1
  • Pipelines 2
  • Changes 1

When calling g_socket_listener_accept_socket_async() on a GSocketListener with multiple sockets, the accept_ready() callback is called for the first incoming connection on each socket. It will return success/failure for the entire accept_socket_async() GTask, and then free the GSources for listening for incoming connections on the other sockets in the GSocketListener. The GSources are freed when the GTask is finalised.

However, if incoming connections arrive for multiple sockets within the same GMainContext iteration, accept_ready() will be called multiple times, and will call g_task_return_() multiple times, before the GTask is finalised. Calling g_task_return_() multiple times is not allowed.

Propagate the first success/failure, as before, but then ignore all subsequent incoming connections until the GTask is finalised.

Signed-off-by: Philip Withnall withnall@endlessm.com

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gdbus-peer-fix-multiple-returns