[#11357] [PATCH] an analogue of `long long' — "Nobuyoshi.Nakada" <nobu.nakada@...>

なかだです。

18 messages 2000/11/01
[#11358] Re: [PATCH] an analogue of `long long' — matz@... (Yukihiro Matsumoto) 2000/11/01

まつもと ゆきひろです

[#11364] Re: [PATCH] an analogue of `long long' — EGUCHI Osamu <eguchi@...> 2000/11/02

えぐち@エスアンドイー です。

[#11440] class Character (was: Ruby I18N) — Yasushi Shoji <yashi@...>

[ruby-dev:11428] からの続きですが、threadは切りました。

14 messages 2000/11/08
[#11442] Re: class Character (was: Ruby I18N) — TAKAHASHI Masayoshi <maki@...> 2000/11/08

高橋征義です。用語について。

[#11443] Re: class Character (was: Ruby I18N) — Yasushi Shoji <yashi@...> 2000/11/08

At Wed, 8 Nov 2000 20:44:55 +0900,

[#11520] A problem of Socket methods on Windows — OKA Toshiyuki <oka@...>

岡と申します。

22 messages 2000/11/15
[#11523] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11528] Re: A problem of Socket methods on Windows — matz@... (Yukihiro Matsumoto) 2000/11/15

まつもと ゆきひろです

[#11532] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11534] Re: A problem of Socket methods on Windows — OKA Toshiyuki <oka@...> 2000/11/15

岡です。

[#11535] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11538] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11662] IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org>

In article <E140cR3-0002ls-00@ev.netlab.zetabits.co.jp>,

22 messages 2000/11/28
[#11663] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/11/28

まつもと ゆきひろです

[#11664] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/28

In article <E140fxW-0002u9-00@ev.netlab.zetabits.co.jp>,

[#11665] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/28

In article <hvor93w5wb8.fsf@coulee.m17n.org>,

[#11669] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/29

In article <hvoofz05uwz.fsf@coulee.m17n.org>,

[#11672] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/11/29

まつもと ゆきひろです

[#11675] Re: IO (Re: fork problem?) — Koji Arai <JCA02266@...> 2000/11/30

新井です。

[#11677] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/12/01

まつもと ゆきひろです

[ruby-dev:11523] Re: A problem of Socket methods on Windows

From: "Nobuyoshi.Nakada" <nobu.nakada@...>
Date: 2000-11-15 03:50:10 UTC
List: ruby-dev #11523
なかだです。

At Wed, 15 Nov 2000 09:18:19 +0900
OKA Toshiyuki <oka@langedge.com> wrote:
> ということで、渡ってきた SOCKET引数が、本当にソケットハンドルかど
> うかを確認してやればよかろう、と考え、添付のようなパッチを当てま
> した。当方のビルド環境 (VC6 + SP4) では、うまく動いているようです。

  というより、なぜか TO_SOCKET()/my_open_osfhandle() が抜けてるのでは。

  ていうか、myfdopen() がさっぱり分からない。この fd はファイルディスク
リプタ? ファイルハンドル? コメントにも `brain damaged' って書いてあるけ
ど、たしかに。


diff -pruPX ./.excludes current/win32/win32.c devel/win32/win32.c
--- current/win32/win32.c	Tue Nov 14 16:10:31 2000
+++ devel/win32/win32.c	Wed Nov 15 12:43:11 2000
@@ -1756,7 +1756,7 @@ myfdopen (int fd, const char *mode)
     if (is_socket((SOCKET)fd)) {
 	int fh;
 
-	fh = my_open_osfhandle((SOCKET)fd, O_RDWR|O_BINARY);
+	fh = my_open_osfhandle(TO_SOCKET(fd), O_RDWR|O_BINARY);
 	return _fdopen(fh, mode);		// return file pointer
     }
     else {
@@ -2056,7 +2056,6 @@ SOCKET
 myaccept (SOCKET s, struct sockaddr *addr, int *addrlen)
 {
     SOCKET r;
-    int trap_immediate = rb_trap_immediate;
 
     if (!NtSocketsInitialized++) {
 	StartSockets();
@@ -2076,7 +2075,7 @@ mybind (SOCKET s, struct sockaddr *addr,
     if (!NtSocketsInitialized++) {
 	StartSockets();
     }
-    if ((r = bind (s, addr, addrlen)) == SOCKET_ERROR)
+    if ((r = bind (TO_SOCKET(s), addr, addrlen)) == SOCKET_ERROR)
 	errno = WSAGetLastError();
     return r;
 }
@@ -2090,7 +2089,7 @@ myconnect (SOCKET s, struct sockaddr *ad
     if (!NtSocketsInitialized++) {
 	StartSockets();
     }
-    if ((r = connect (s, addr, addrlen)) == SOCKET_ERROR)
+    if ((r = connect (TO_SOCKET(s), addr, addrlen)) == SOCKET_ERROR)
 	errno = WSAGetLastError();
     return r;
 }
@@ -2133,7 +2132,7 @@ mygetsockopt (SOCKET s, int level, int o
     if (!NtSocketsInitialized++) {
 	StartSockets();
     }
-    if ((r = getsockopt (s, level, optname, optval, optlen)) == SOCKET_ERROR)
+    if ((r = getsockopt (TO_SOCKET(s), level, optname, optval, optlen)) == SOCKET_ERROR)
 	errno = WSAGetLastError();
     return r;
 }
@@ -2161,7 +2160,7 @@ mylisten (SOCKET s, int backlog)
     if (!NtSocketsInitialized++) {
 	StartSockets();
     }
-    if ((r = listen (s, backlog)) == SOCKET_ERROR)
+    if ((r = listen (TO_SOCKET(s), backlog)) == SOCKET_ERROR)
 	errno = WSAGetLastError();
     return r;
 }
@@ -2233,7 +2232,7 @@ mysetsockopt (SOCKET s, int level, int o
     if (!NtSocketsInitialized++) {
 	StartSockets();
     }
-    if ((r = setsockopt (s, level, optname, optval, optlen))
+    if ((r = setsockopt (TO_SOCKET(s), level, optname, optval, optlen))
     		 == SOCKET_ERROR)
 	errno = WSAGetLastError();
     return r;
@@ -2266,7 +2265,7 @@ mysocket (int af, int type, int protocol
 	errno = WSAGetLastError();
 	//fprintf(stderr, "socket fail (%d)", WSAGetLastError());
     }
-    return s;
+    return my_open_osfhandle(s, O_RDWR|O_BINARY);
 }
 
 #undef gethostbyaddr


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦


In This Thread