aboutsummaryrefslogtreecommitdiff
path: root/libseat/backend/seatd.c
AgeCommit message (Collapse)Author
2021-08-15Make libseat_seat_listener constSimon Ser
libseat will never write to that struct. Let's allow callers to make it read-only.
2021-08-06seatd: We shouldn't poll if predispatch > 0Kenny Levinsen
This condition was accidentally botched as part of 5923e0edc9bb157cf6398b63d51cc3c0aaf06001
2021-07-09libseat: Rename dispatch_background in backendsKenny Levinsen
This name never made much sense. dispatch_and_execute is more meaningful, especially when compared to the non-executing dispatch function.
2021-07-09libseat/seatd: Add dispatch_pending_and_executeKenny Levinsen
This handler returns the number of dispatched or executed events, or -1 if dispatch_pending failed. This helper is used to clean up dispatch_background, which now ensures that all events are executed before we read or poll the connection, and have improved error handling in the corner case where the second dispatch_pending failed.
2021-07-08libseat/seatd: Return executed eventsKenny Levinsen
Dispatch needs to report if something has happened, which includes events executed from the queue as these could have lead to additional dispatch and queuing.
2021-04-25libseat/seatd: downgrade ENOENT log to infoSimon Ser
The socket is expected not to be found if seatd is not running. In general other backends will be attempted after seatd. There is already an error message in case no backend can be started.
2021-02-27Convert a few debug logs to error logsKenny Levinsen
2020-11-21libseat: log error when failing to open socketIsaac Freund
The most common pain point I've seen with people trying out seat is forgetting to add themselves to whatever group the distro has chosen to own the socket. Logging this error and path of the socket should make it easier to tell why things aren't working.
2020-09-22libseat/seatd: Fix socket path boundsKenny Levinsen
2020-09-22meson: Make default seatd socket path configurableKenny Levinsen
FreeBSD and Linux have different preferred socket locations. Expose an option to set the location, and implement simple auto-logic for linux/freebsd.
2020-09-22libseat: Execute bg events after IPC callsKenny Levinsen
If a background event was queued during call dispatch, and no unread data was left on the socket, there would be no incentive for the user to call dispatch, and as a result, the events would never be executed. Execute events at the end of IPC calls that read from the socket to avoid stalls.
2020-09-22libseat: Dispatch all non-bg events on IPC callKenny Levinsen
Dispatch on IPC call only dispatched until the first message was successfully processed. This could lead to premature dispatch termination if a background event was received during an IPC call. Instead, continue dispatching until a non-bg opcode is reported or an error is received.
2020-09-07libseat: Handle SERVER_ERROR correctlyKenny Levinsen
The connection buffer position was erroneously rewinded before reading the protocol message when the message was a SERVER_ERROR.
2020-08-31client: Do not leak idle clients on exitKenny Levinsen
2020-08-31linked_list: linked_list_take should concat listsKenny Levinsen
2020-08-30seatd: Remove unused device_closed msg bodyKenny Levinsen
2020-08-30linked_list: Implement linked_list_takeKenny Levinsen
2020-08-29libseat: Check euid before using builtinKenny Levinsen
2020-08-29libseat: Remove pointless checkKenny Levinsen
2020-08-29libseat: Keep track of error stateKenny Levinsen
Store if an error has occurred and return -1 with ENOTCONN from all future calls, avoiding attempts to use a broken connection.
2020-08-29libseat: Improve logging with seatd conn helpersKenny Levinsen
Add helpers around connection access to have all logging centralized and reduce code duplication. Improve existing helpers to further reduce code duplication. The seatd backend should have much better logging after this.
2020-08-29libseat: Assert that listener is non-NULLKenny Levinsen
2020-08-28libseat: Expand logging in all backendsKenny Levinsen
2020-08-05libseat: Rename libseat_impl to seat_implKenny Levinsen
2020-08-03libseat: Convert clients to linked_listKenny Levinsen
2020-08-03server: Stack-allocate the serverKenny Levinsen
2020-08-01seatd: Perform clean server shutdownKenny Levinsen
2020-08-01FreeBSD compiler warning fixKenny Levinsen
2020-07-31Initial implementation of seatd and libseatKenny Levinsen