Harden Tosu init, poll handling, and local request trust#3
Open
sciboy12 wants to merge 1 commit intorewrite-scaling-config-reworkfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
activewhen Tosu integration is enabled.poll()errors and interrupts explicitly instead of treating any non-positive return as a silent continue.main.Description
activetofalseand, when Tosu is enabled, setactive = tosu_get_absolute_state()immediately aftertosu_init()inabs-c.cto avoid uninitialized reads.if (poll(&pfd, 1, -1) <= 0) continue;with explicit handling: checkpoll()return value, continue onEINTR(unlessstopis set), callperror("poll")and break on hard errors, continue on timeout (0), preserve fatalpfd.reventschecks and requirePOLLINbefore reading.struct input_event ev_buf[64];declaration frommaininabs-c.c.#include <errno.h>to support robustpoll()errno checks.tosuhandler.c, changeTOSU_URLfromhttp://localhost:24050/jsontohttp://127.0.0.1:24050/jsonand setCURLOPT_NOPROXYto"*"to prevent environment proxying while preserving existing redirect and protocol settings.emit_abs_deltaand made no change because there was no duplicated unreachablereturn false;in the current tree.Testing
git diff -- abs-c.c tosuhandler.cto verify the code delta (succeeded).git status --shortto confirm staged changes (succeeded).make clean && maketo attempt a build; the build failed in this environment due to missing development headers/libraries (ini.h,cjson/cJSON.h) and not due to the applied changes.Codex Task