Update Socket#recvfrom
to use rb_io_blocking_region
.
This commit is contained in:
parent
04ddb7e808
commit
438ef21a9b
Notes:
git
2024-10-09 10:49:11 +00:00
@ -107,6 +107,7 @@ rsock_send_blocking(void *data)
|
||||
}
|
||||
|
||||
struct recvfrom_arg {
|
||||
rb_io_t *fptr;
|
||||
int fd, flags;
|
||||
VALUE str;
|
||||
size_t length;
|
||||
@ -151,7 +152,7 @@ recvfrom_locktmp(VALUE v)
|
||||
{
|
||||
struct recvfrom_arg *arg = (struct recvfrom_arg *)v;
|
||||
|
||||
return rb_thread_io_blocking_region(recvfrom_blocking, arg, arg->fd);
|
||||
return rb_io_blocking_region(arg->fptr, recvfrom_blocking, arg);
|
||||
}
|
||||
|
||||
int
|
||||
@ -192,6 +193,7 @@ rsock_s_recvfrom(VALUE socket, int argc, VALUE *argv, enum sock_recv_type from)
|
||||
rb_raise(rb_eIOError, "recv for buffered IO");
|
||||
}
|
||||
|
||||
arg.fptr = fptr;
|
||||
arg.fd = fptr->fd;
|
||||
arg.alen = (socklen_t)sizeof(arg.buf);
|
||||
arg.str = str;
|
||||
|
Loading…
x
Reference in New Issue
Block a user