ONI contexts should include an INVALID state in run_state, checked as usual, set when a call to oni_init_ctx fails. This will force the destruction of any invalid context instead of enabling the possibility of calling init twice, which could result in leaks.
Adittionally, calling oni_set_opt for ONI_OPT_BLOCKREADSIZE or ONI_OPT_BLOCKWRITESIZE when run_state == RUNNING should result in an error.
ONI contexts should include an
INVALIDstate inrun_state, checked as usual, set when a call tooni_init_ctxfails. This will force the destruction of any invalid context instead of enabling the possibility of calling init twice, which could result in leaks.Adittionally, calling
oni_set_optforONI_OPT_BLOCKREADSIZEorONI_OPT_BLOCKWRITESIZEwhenrun_state == RUNNINGshould result in an error.