mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
🐛 fix bug in recvfrom
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user