added description about choice of acepted client socket methods

This commit is contained in:
hyung-hwan 2021-08-08 07:22:50 +00:00
parent 807eb3e74c
commit 53ddebff6d
2 changed files with 17 additions and 8 deletions

View File

@ -710,7 +710,7 @@ static void on_dnc_resolve(hio_svc_dnc_t* dnc, hio_dns_msg_t* reqmsg, hio_errnum
printf (">>>>>>>> RRDLEN = %d\n", (int)pi->_rrdlen); printf (">>>>>>>> RRDLEN = %d\n", (int)pi->_rrdlen);
printf (">>>>>>>> RCODE %s(%d) EDNS exist %d uplen %d version %d dnssecok %d\n", hio_dns_rcode_to_bcstr(pi->hdr.rcode), pi->hdr.rcode, pi->edns.exist, pi->edns.uplen, pi->edns.version, pi->edns.dnssecok); printf (">>>>>>>> RCODE %s(%d) EDNS exist %d uplen %d version %d dnssecok %d qdcount %d ancount %d nscount %d arcount %d\n", hio_dns_rcode_to_bcstr(pi->hdr.rcode), pi->hdr.rcode, pi->edns.exist, pi->edns.uplen, pi->edns.version, pi->edns.dnssecok, pi->qdcount, pi->ancount, pi->nscount, pi->arcount);
if (pi->hdr.rcode == HIO_DNS_RCODE_BADCOOKIE) if (pi->hdr.rcode == HIO_DNS_RCODE_BADCOOKIE)
{ {
/* TODO: must retry?? there shoudl be no RRs in the payload */ /* TODO: must retry?? there shoudl be no RRs in the payload */
@ -727,8 +727,12 @@ static void on_dnc_resolve(hio_svc_dnc_t* dnc, hio_dns_msg_t* reqmsg, hio_errnum
printf ("CLIENT COOKIE IS OK>>>>>>>>>>>>>>>>>>>%d\n", hio_svc_dnc_checkclientcookie(dnc, reqmsg, pi)); printf ("CLIENT COOKIE IS OK>>>>>>>>>>>>>>>>>>>%d\n", hio_svc_dnc_checkclientcookie(dnc, reqmsg, pi));
} }
//if (pi->hdr.rcode != HIO_DNS_RCODE_NOERROR) goto no_data; //if (pi->hdr.rcode != HIO_DNS_RCODE_NOERROR) goto no_data;
if (pi->ancount < 0) goto no_data; if (pi->ancount < 0)
{
goto no_data;
}
for (i = 0; i < pi->ancount; i++) for (i = 0; i < pi->ancount; i++)
{ {
@ -1216,8 +1220,8 @@ for (i = 0; i < 5; i++)
reply_tmout.sec = 1; reply_tmout.sec = 1;
reply_tmout.nsec = 0; reply_tmout.nsec = 0;
//hio_bcstrtoskad (hio, "8.8.8.8:53", &servaddr); hio_bcstrtoskad (hio, "8.8.8.8:53", &servaddr);
hio_bcstrtoskad (hio, "198.41.0.4:53", &servaddr); // a.root-servers.net //hio_bcstrtoskad (hio, "198.41.0.4:53", &servaddr); // a.root-servers.net
//hio_bcstrtoskad (hio, "130.59.31.29:53", &servaddr); // ns2.switch.ch //hio_bcstrtoskad (hio, "130.59.31.29:53", &servaddr); // ns2.switch.ch
//hio_bcstrtoskad (hio, "134.119.216.86:53", &servaddr); // ns.manyhost.net //hio_bcstrtoskad (hio, "134.119.216.86:53", &servaddr); // ns.manyhost.net
//hio_bcstrtoskad (hio, "[fe80::c7e2:bd6e:1209:ac1b]:1153", &servaddr); //hio_bcstrtoskad (hio, "[fe80::c7e2:bd6e:1209:ac1b]:1153", &servaddr);

View File

@ -1711,10 +1711,15 @@ static int make_accepted_client_connection (hio_dev_sck_t* rdev, hio_syshnd_t cl
return 0; return 0;
} }
/* use rdev->dev_size when instantiating a client sck device /* rdev->dev_size:
* instead of HIO_SIZEOF(hio_dev_sck_t). therefore, the * use rdev->dev_size when instantiating a client sck device
* extension area as big as that of the master sck device * instead of HIO_SIZEOF(hio_dev_sck_t). therefore, the
* is created in the client sck device */ * extension area as big as that of the master socket device
* is created in the client sck device
* dev_mth:
* choose the client socket method base on the master socket
* device capability. currently, stream or non-stream is supported.
*/
dev_mth = (sck_type_map[clisck_type].extra_dev_cap & HIO_DEV_CAP_STREAM)? &dev_mth_clisck_stream: &dev_mth_clisck_stateless; dev_mth = (sck_type_map[clisck_type].extra_dev_cap & HIO_DEV_CAP_STREAM)? &dev_mth_clisck_stream: &dev_mth_clisck_stateless;
clidev = (hio_dev_sck_t*)hio_dev_make(hio, rdev->dev_size, dev_mth, rdev->dev_evcb, &clisck); clidev = (hio_dev_sck_t*)hio_dev_make(hio, rdev->dev_size, dev_mth, rdev->dev_evcb, &clisck);
if (HIO_UNLIKELY(!clidev)) if (HIO_UNLIKELY(!clidev))