mirror of
https://github.com/fluffos/fluffos
synced 2026-08-12 18:26:06 -04:00
resolve(), async_read(), async_write(), async_getdir() and async_db_exec() ran their callbacks with no user context, so this_player() returned 0 and input_to()/printf() were unusable there. Follow the call_out() precedent: capture command_giver (ref-held) when the request is registered and restore it around the callback, skipping destructed objects, gated on the same 'this_player in call_out' setting. The pending-request holders account for the new ref in the DEBUGMALLOC walkers. The new test registers callbacks from two different living objects and asserts each callback sees its own registrant, which fails without the per-request capture. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lv2Gw2AWqtyN3nNEgob1He
1.1 KiB
1.1 KiB
| title |
|---|
| interactive / resolve |
resolve
NAME
resolve() - resolve an internet address to domain name, or vice versa
SYNOPSIS
int resolve( string address, string callback_func );
DESCRIPTION
resolve() resolves 'address', which should be an internet address in
the form "127.0.0.1" or a domain name, into its domain name, or inter‐
net address. When the resolve is complete, 'callback_func' will be
called in the current object. The form of the callback is:
void callback(string address, string resolved, int key);
'key' will match up with the number that the call to resolve()
returned. 'address' will be the domain name of the host, and
'resolved' the dotted decimal ip address. The unknown value will be 0
if the lookup failed.
NOTE
When the 'this_player in call_out' driver setting is enabled,
this_player() inside the callback is preserved from the time the
request was made, like call_out().
SEE ALSO
query_host_name(3), socket_address(3), query_ip_name(3), query_ip_num‐
ber(3)