зеркало из https://github.com/github/ruby.git
* ext/socket/socket.c (s_recvfrom): sending length should be an
invariant while retrying on EAGAIN. [ruby-talk:89962] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2a49751d8e
Коммит
8df4564367
|
@ -1,3 +1,8 @@
|
|||
Tue Jan 27 11:04:40 2004 FUKUMOTO Atsushi <fukumoto@nospam.imasy.or.jp>
|
||||
|
||||
* ext/socket/socket.c (s_recvfrom): sending length should be an
|
||||
invariant while retrying on EAGAIN. [ruby-talk:89962]
|
||||
|
||||
Tue Jan 27 10:31:28 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* ext/win32ole/win32ole.c (set_argv): fix condition.
|
||||
|
|
|
@ -416,6 +416,7 @@ s_recvfrom(sock, argc, argv, from)
|
|||
char buf[1024];
|
||||
socklen_t alen = sizeof buf;
|
||||
VALUE len, flg;
|
||||
long buflen;
|
||||
long slen;
|
||||
int fd, flags;
|
||||
|
||||
|
@ -430,13 +431,13 @@ s_recvfrom(sock, argc, argv, from)
|
|||
}
|
||||
fd = fileno(fptr->f);
|
||||
|
||||
slen = NUM2INT(len);
|
||||
str = rb_tainted_str_new(0, slen);
|
||||
buflen = NUM2INT(len);
|
||||
str = rb_tainted_str_new(0, buflen);
|
||||
|
||||
retry:
|
||||
rb_thread_wait_fd(fd);
|
||||
TRAP_BEG;
|
||||
slen = recvfrom(fd, RSTRING(str)->ptr, slen, flags, (struct sockaddr*)buf, &alen);
|
||||
slen = recvfrom(fd, RSTRING(str)->ptr, buflen, flags, (struct sockaddr*)buf, &alen);
|
||||
TRAP_END;
|
||||
|
||||
if (slen < 0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче