Branch: Tag:

2020-08-18

2020-08-18 08:35:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Protocols.DNS.async_client: Survive NULL callbacks.

Do not complain if the callback function has become NULL when
it is time to call it (the initiator may have gone away).

Fixes #10051.

1789:    function(string,mapping,mixed...:void) callback,    mixed ... args)    { +  if (!callback) return UNDEFINED;    for(int e=next_client ? 100 : 256;e>=0;e--)    {    int lid = random(65536);
1850:    function callback,    mixed ... args)    { +  if (!callback) return UNDEFINED;    if(!answer || !answer->an || !sizeof(answer->an))    {    if(multi == -1 || multi >= sizeof(domains)) {
2023:       void connectedcb(int ok)    { +  if (!callback) return;    if (!ok) {callback(domain, 0, @args); return;}    sock->set_nonblocking(readcb, writecb, closecb);    writebuf=sprintf("%2H",req);