🐛 fix bug in recvfrom

This commit is contained in:
ValKmjolnir
2023-11-06 00:22:11 +08:00
parent e8c8a6446b
commit 2ea9e03522
4 changed files with 70 additions and 1 deletions

View File

@@ -76,8 +76,9 @@ var socket=func(){
MSG_OOB:0x1,
MSG_PEEK:0x2,
MSG_DONTROUTE:0x4,
MSG_DONTWAIT:0x40,
socket:func(af,type,proto){
socket:func(af,type,proto = 0){
return invoke_iii(sock,af,type,proto);
},
closesocket:func(sd){

View File

@@ -231,6 +231,7 @@ var nas_recvfrom(var* args, usize size, gc* ngc) {
hash["str"] = ngc->newstr(buf);
delete[] buf;
hash["fromip"] = ngc->newstr(inet_ntoa(addr.sin_addr));
hash["port"] = var::num(ntohs(addr.sin_port));
ngc->temp = nil;
return res;
}