eventmachine 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +1 -1
- data/RELEASE_NOTES +7 -1
- data/ext/Makefile +139 -0
- data/ext/binder.cpp +1 -1
- data/ext/binder.h +3 -2
- data/ext/cmain.cpp +1 -1
- data/ext/ed.cpp +1 -1
- data/ext/ed.h +1 -1
- data/ext/em.cpp +6 -4
- data/ext/em.h +1 -1
- data/ext/emwin.cpp +1 -1
- data/ext/emwin.h +1 -1
- data/ext/eventmachine.h +1 -1
- data/ext/extconf.rb +17 -15
- data/ext/mkmf.log +59 -0
- data/ext/page.cpp +1 -1
- data/ext/page.h +1 -1
- data/ext/project.h +1 -1
- data/ext/rubymain.cpp +2 -164
- data/ext/sigs.cpp +1 -1
- data/ext/sigs.h +1 -1
- data/ext/ssl.cpp +2 -2
- data/ext/ssl.h +1 -1
- data/lib/eventmachine.rb +2 -1
- data/tests/testem.rb +1 -1
- metadata +4 -2
data/README
CHANGED
data/RELEASE_NOTES
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
$Id: RELEASE_NOTES
|
1
|
+
$Id: RELEASE_NOTES 64 2006-05-17 07:00:16Z blackhedd $
|
2
2
|
|
3
3
|
RUBY/EventMachine RELEASE NOTES
|
4
4
|
|
5
|
+
--------------------------------------------------
|
6
|
+
Version: 0.5.3, released 17May06
|
7
|
+
Fixed bugs in extconf.rb, thanks to Daniel Harple, dharple@generalconsumption.org.
|
8
|
+
Added proper setup.rb and rake tasks, thanks to Austin Ziegler.
|
9
|
+
Fixed a handful of reported problems with builds on various platforms.
|
10
|
+
|
5
11
|
--------------------------------------------------
|
6
12
|
Version: 0.5.2, released 05May06
|
7
13
|
Made several nonvisible improvements to the Windows
|
data/ext/Makefile
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = /home/francis/rubyforge/eventmachine/version_0/ext
|
7
|
+
topdir = /usr/local/lib/ruby/1.8/i686-linux
|
8
|
+
hdrdir = $(topdir)
|
9
|
+
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
10
|
+
prefix = $(DESTDIR)/usr/local
|
11
|
+
exec_prefix = $(DESTDIR)/usr/local
|
12
|
+
sitedir = $(prefix)/lib/ruby/site_ruby
|
13
|
+
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
14
|
+
archdir = $(rubylibdir)/$(arch)
|
15
|
+
sbindir = $(exec_prefix)/sbin
|
16
|
+
datadir = $(prefix)/share
|
17
|
+
includedir = $(prefix)/include
|
18
|
+
infodir = $(prefix)/info
|
19
|
+
sysconfdir = $(prefix)/etc
|
20
|
+
mandir = $(prefix)/man
|
21
|
+
libdir = $(DESTDIR)/usr/local/lib
|
22
|
+
sharedstatedir = $(prefix)/com
|
23
|
+
oldincludedir = $(DESTDIR)/usr/include
|
24
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
25
|
+
bindir = $(exec_prefix)/bin
|
26
|
+
localstatedir = $(prefix)/var
|
27
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
28
|
+
libexecdir = $(exec_prefix)/libexec
|
29
|
+
|
30
|
+
CC = gcc
|
31
|
+
LIBRUBY = $(LIBRUBY_A)
|
32
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
33
|
+
LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -L.
|
34
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
35
|
+
|
36
|
+
CFLAGS = -fPIC -g -O2
|
37
|
+
CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DOS_UNIX -DBUILD_FOR_RUBY -DWITH_SSL
|
38
|
+
CXXFLAGS = $(CFLAGS)
|
39
|
+
DLDFLAGS =
|
40
|
+
LDSHARED = $(CXX) -shared
|
41
|
+
AR = ar
|
42
|
+
EXEEXT =
|
43
|
+
|
44
|
+
RUBY_INSTALL_NAME = ruby
|
45
|
+
RUBY_SO_NAME = ruby
|
46
|
+
arch = i686-linux
|
47
|
+
sitearch = i686-linux
|
48
|
+
ruby_version = 1.8
|
49
|
+
ruby = /usr/local/bin/ruby
|
50
|
+
RUBY = $(ruby)
|
51
|
+
RM = rm -f
|
52
|
+
MAKEDIRS = mkdir -p
|
53
|
+
INSTALL = /usr/bin/install -c
|
54
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
55
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
56
|
+
COPY = cp
|
57
|
+
|
58
|
+
#### End of system configuration section. ####
|
59
|
+
|
60
|
+
preload =
|
61
|
+
|
62
|
+
libpath = $(libdir)
|
63
|
+
LIBPATH = -L'$(libdir)' -Wl,-R'$(libdir)'
|
64
|
+
DEFFILE =
|
65
|
+
|
66
|
+
CLEANFILES =
|
67
|
+
DISTCLEANFILES =
|
68
|
+
|
69
|
+
extout =
|
70
|
+
extout_prefix =
|
71
|
+
target_prefix =
|
72
|
+
LOCAL_LIBS =
|
73
|
+
LIBS = -lcrypto -lssl -lpthread -ldl -lcrypt -lm -lc
|
74
|
+
SRCS = binder.cpp cmain.cpp sigs.cpp rubymain.cpp ed.cpp ssl.cpp em.cpp emwin.cpp page.cpp
|
75
|
+
OBJS = binder.o cmain.o sigs.o rubymain.o ed.o ssl.o em.o emwin.o page.o
|
76
|
+
TARGET = rubyeventmachine
|
77
|
+
DLLIB = $(TARGET).so
|
78
|
+
STATIC_LIB =
|
79
|
+
|
80
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
81
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
82
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
83
|
+
|
84
|
+
TARGET_SO = $(DLLIB)
|
85
|
+
CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
|
86
|
+
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
87
|
+
|
88
|
+
all: $(DLLIB)
|
89
|
+
static: $(STATIC_LIB)
|
90
|
+
|
91
|
+
clean:
|
92
|
+
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
93
|
+
|
94
|
+
distclean: clean
|
95
|
+
@-$(RM) Makefile extconf.h conftest.* mkmf.log
|
96
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
97
|
+
|
98
|
+
realclean: distclean
|
99
|
+
install: install-so install-rb
|
100
|
+
|
101
|
+
install-so: $(RUBYARCHDIR)
|
102
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
103
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
104
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
105
|
+
install-rb: pre-install-rb install-rb-default
|
106
|
+
install-rb-default: pre-install-rb-default
|
107
|
+
pre-install-rb: Makefile
|
108
|
+
pre-install-rb-default: Makefile
|
109
|
+
$(RUBYARCHDIR):
|
110
|
+
$(MAKEDIRS) $@
|
111
|
+
|
112
|
+
site-install: site-install-so site-install-rb
|
113
|
+
site-install-so: install-so
|
114
|
+
site-install-rb: install-rb
|
115
|
+
|
116
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
117
|
+
|
118
|
+
.cc.o:
|
119
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
|
120
|
+
|
121
|
+
.cxx.o:
|
122
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
|
123
|
+
|
124
|
+
.cpp.o:
|
125
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
|
126
|
+
|
127
|
+
.C.o:
|
128
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
|
129
|
+
|
130
|
+
.c.o:
|
131
|
+
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
132
|
+
|
133
|
+
$(DLLIB): $(OBJS)
|
134
|
+
@-$(RM) $@
|
135
|
+
$(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $@ $(OBJS) $(LOCAL_LIBS) $(LIBS)
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
$(OBJS): ruby.h defines.h
|
data/ext/binder.cpp
CHANGED
data/ext/binder.h
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*****************************************************************************
|
2
2
|
|
3
|
-
$Id: binder.h
|
3
|
+
$Id: binder.h 61 2006-05-17 04:58:31Z blackhedd $
|
4
4
|
|
5
5
|
File: binder.h
|
6
6
|
Date: 07Apr06
|
@@ -40,7 +40,8 @@ class Bindable_t
|
|
40
40
|
Bindable_t();
|
41
41
|
virtual ~Bindable_t();
|
42
42
|
|
43
|
-
string GetBinding() {return Binding;}
|
43
|
+
const string &GetBinding() {return Binding;}
|
44
|
+
const char *GetBindingChars() {return Binding.c_str();}
|
44
45
|
|
45
46
|
private:
|
46
47
|
string Binding;
|
data/ext/cmain.cpp
CHANGED
data/ext/ed.cpp
CHANGED
data/ext/ed.h
CHANGED
data/ext/em.cpp
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
/*****************************************************************************
|
2
2
|
|
3
|
-
$Id: em.cpp
|
3
|
+
$Id: em.cpp 61 2006-05-17 04:58:31Z blackhedd $
|
4
4
|
|
5
5
|
File: ed.cpp
|
6
6
|
Date: 06Apr06
|
7
7
|
|
8
8
|
Copyright (C) 2006 by Francis Cianfrocca. All Rights Reserved.
|
9
|
-
Gmail:
|
9
|
+
Gmail: garbagecat10
|
10
10
|
|
11
11
|
This program is free software; you can redistribute it and/or modify
|
12
12
|
it under the terms of the GNU General Public License as published by
|
@@ -259,8 +259,10 @@ const char *EventMachine_t::InstallOneshotTimer (int seconds)
|
|
259
259
|
// get called before the main event machine is running.
|
260
260
|
|
261
261
|
Timer_t t;
|
262
|
-
|
263
|
-
|
262
|
+
multimap<time_t,Timer_t>::iterator i =
|
263
|
+
Timers.insert (make_pair (time(NULL) + seconds, t));
|
264
|
+
//return t.GetBinding().c_str();
|
265
|
+
return i->second.GetBindingChars();
|
264
266
|
}
|
265
267
|
|
266
268
|
|
data/ext/em.h
CHANGED
data/ext/emwin.cpp
CHANGED
data/ext/emwin.h
CHANGED
data/ext/eventmachine.h
CHANGED
data/ext/extconf.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: extconf.rb
|
1
|
+
# $Id: extconf.rb 63 2006-05-17 06:03:18Z blackhedd $
|
2
2
|
#
|
3
3
|
#----------------------------------------------------------------------------
|
4
4
|
#
|
@@ -42,9 +42,10 @@ when 'mswin32', 'mingw32', 'bccwin32'
|
|
42
42
|
|
43
43
|
flags << "-D OS_WIN32"
|
44
44
|
flags << '-D BUILD_FOR_RUBY'
|
45
|
-
flags << "-
|
45
|
+
flags << "-EHs"
|
46
46
|
flags << "-GR"
|
47
47
|
|
48
|
+
dir_config('ssl')
|
48
49
|
if have_library('ssleay32') and
|
49
50
|
have_library('libeay32') and
|
50
51
|
have_header('openssl/ssl.h') and
|
@@ -54,7 +55,7 @@ when 'mswin32', 'mingw32', 'bccwin32'
|
|
54
55
|
flags << '-D WITHOUT_SSL'
|
55
56
|
end
|
56
57
|
|
57
|
-
when
|
58
|
+
when /solaris/
|
58
59
|
unless have_library('pthread') and
|
59
60
|
have_library('nsl') and
|
60
61
|
have_library('socket')
|
@@ -78,9 +79,9 @@ when 'solaris2.8'
|
|
78
79
|
# on Unix we need a g++ link, not gcc.
|
79
80
|
CONFIG['LDSHARED'] = "$(CXX) -shared"
|
80
81
|
|
81
|
-
when
|
82
|
-
flags << '-
|
83
|
-
flags << '-
|
82
|
+
when /darwin/
|
83
|
+
flags << '-DOS_UNIX'
|
84
|
+
flags << '-DBUILD_FOR_RUBY'
|
84
85
|
|
85
86
|
dir_config('ssl')
|
86
87
|
if have_library('ssl') and
|
@@ -88,38 +89,39 @@ when 'darwin8.0'
|
|
88
89
|
have_library('C') and
|
89
90
|
have_header('openssl/ssl.h') and
|
90
91
|
have_header('openssl/err.h')
|
91
|
-
flags << '-
|
92
|
+
flags << '-DWITH_SSL'
|
92
93
|
else
|
93
|
-
flags << '-
|
94
|
+
flags << '-DWITHOUT_SSL'
|
94
95
|
end
|
95
96
|
# on Unix we need a g++ link, not gcc.
|
96
|
-
|
97
|
+
# Ff line contributed by Daniel Harple.
|
98
|
+
CONFIG['LDSHARED'] = "$(CXX) " + CONFIG['LDSHARED'].split[1..-1].join(' ')
|
97
99
|
|
98
100
|
else
|
99
101
|
unless have_library('pthread')
|
100
102
|
exit
|
101
103
|
end
|
102
104
|
|
103
|
-
flags << '-
|
104
|
-
flags << '-
|
105
|
+
flags << '-DOS_UNIX'
|
106
|
+
flags << '-DBUILD_FOR_RUBY'
|
105
107
|
|
106
108
|
dir_config('ssl')
|
107
109
|
if have_library('ssl') and
|
108
110
|
have_library('crypto') and
|
109
111
|
have_header('openssl/ssl.h') and
|
110
112
|
have_header('openssl/err.h')
|
111
|
-
flags << '-
|
113
|
+
flags << '-DWITH_SSL'
|
112
114
|
else
|
113
|
-
flags << '-
|
115
|
+
flags << '-DWITHOUT_SSL'
|
114
116
|
end
|
115
117
|
# on Unix we need a g++ link, not gcc.
|
116
118
|
CONFIG['LDSHARED'] = "$(CXX) -shared"
|
117
119
|
end
|
118
120
|
|
119
121
|
if $CPPFLAGS
|
120
|
-
$CPPFLAGS += flags.join(' ')
|
122
|
+
$CPPFLAGS += ' ' + flags.join(' ')
|
121
123
|
else
|
122
|
-
$CFLAGS + flags.join(' ')
|
124
|
+
$CFLAGS += ' ' + flags.join(' ')
|
123
125
|
end
|
124
126
|
|
125
127
|
|
data/ext/mkmf.log
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
have_library: checking for main() in -lpthread... -------------------- yes
|
2
|
+
|
3
|
+
"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-linux -g -O2 conftest.c -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -lruby-static -lpthread -ldl -lcrypt -lm -lc"
|
4
|
+
checked program was:
|
5
|
+
/* begin */
|
6
|
+
|
7
|
+
/*top*/
|
8
|
+
int main() { return 0; }
|
9
|
+
int t() { main(); return 0; }
|
10
|
+
/* end */
|
11
|
+
|
12
|
+
--------------------
|
13
|
+
|
14
|
+
have_library: checking for main() in -lssl... -------------------- yes
|
15
|
+
|
16
|
+
"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-linux -g -O2 conftest.c -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -lpthread -lruby-static -lssl -lpthread -ldl -lcrypt -lm -lc"
|
17
|
+
checked program was:
|
18
|
+
/* begin */
|
19
|
+
|
20
|
+
/*top*/
|
21
|
+
int main() { return 0; }
|
22
|
+
int t() { main(); return 0; }
|
23
|
+
/* end */
|
24
|
+
|
25
|
+
--------------------
|
26
|
+
|
27
|
+
have_library: checking for main() in -lcrypto... -------------------- yes
|
28
|
+
|
29
|
+
"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-linux -g -O2 conftest.c -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -lssl -lpthread -lruby-static -lcrypto -lssl -lpthread -ldl -lcrypt -lm -lc"
|
30
|
+
checked program was:
|
31
|
+
/* begin */
|
32
|
+
|
33
|
+
/*top*/
|
34
|
+
int main() { return 0; }
|
35
|
+
int t() { main(); return 0; }
|
36
|
+
/* end */
|
37
|
+
|
38
|
+
--------------------
|
39
|
+
|
40
|
+
have_header: checking for openssl/ssl.h... -------------------- yes
|
41
|
+
|
42
|
+
"gcc -E -I. -I/usr/local/lib/ruby/1.8/i686-linux -g -O2 conftest.c -o conftest.i"
|
43
|
+
checked program was:
|
44
|
+
/* begin */
|
45
|
+
#include <openssl/ssl.h>
|
46
|
+
/* end */
|
47
|
+
|
48
|
+
--------------------
|
49
|
+
|
50
|
+
have_header: checking for openssl/err.h... -------------------- yes
|
51
|
+
|
52
|
+
"gcc -E -I. -I/usr/local/lib/ruby/1.8/i686-linux -g -O2 conftest.c -o conftest.i"
|
53
|
+
checked program was:
|
54
|
+
/* begin */
|
55
|
+
#include <openssl/err.h>
|
56
|
+
/* end */
|
57
|
+
|
58
|
+
--------------------
|
59
|
+
|
data/ext/page.cpp
CHANGED
data/ext/page.h
CHANGED
data/ext/project.h
CHANGED
data/ext/rubymain.cpp
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*****************************************************************************
|
2
2
|
|
3
|
-
$Id: rubymain.cpp
|
3
|
+
$Id: rubymain.cpp 50 2006-05-15 22:16:39Z blackhedd $
|
4
4
|
|
5
5
|
File: libmain.cpp
|
6
6
|
Date: 06Apr06
|
@@ -35,16 +35,6 @@ Statics
|
|
35
35
|
*******/
|
36
36
|
|
37
37
|
static VALUE EmModule;
|
38
|
-
static int SyncSockets [2];
|
39
|
-
static int Pipe1[2];
|
40
|
-
static int Pipe2[2];
|
41
|
-
static bool UseThreads;
|
42
|
-
|
43
|
-
static const char *A1;
|
44
|
-
static int A2;
|
45
|
-
static const char *A3;
|
46
|
-
static int A4;
|
47
|
-
|
48
38
|
|
49
39
|
|
50
40
|
/****************
|
@@ -53,48 +43,8 @@ t_event_callback
|
|
53
43
|
|
54
44
|
static void event_callback (const char *a1, int a2, const char *a3, int a4)
|
55
45
|
{
|
56
|
-
|
57
|
-
#ifdef OS_UNIX
|
58
|
-
A1 = a1; A2 = a2; A3 = a3; A4 = a4;
|
59
|
-
write (SyncSockets[1], "+", 1);
|
60
|
-
char g;
|
61
|
-
read (SyncSockets[1], &g, 1);
|
62
|
-
#endif
|
63
|
-
|
64
|
-
#ifdef OS_WIN32
|
65
|
-
A1 = a1; A2 = a2; A3 = a3; A4 = a4;
|
66
|
-
write (Pipe1[1], "+", 1);
|
67
|
-
char g;
|
68
|
-
read (Pipe2[0], &g, 1);
|
69
|
-
#endif
|
70
|
-
}
|
71
|
-
else {
|
72
|
-
rb_funcall (EmModule, rb_intern ("event_callback"), 3, rb_str_new2(a1), (a2 << 1) | 1, rb_str_new(a3,a4));
|
73
|
-
}
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
/********
|
78
|
-
TRunEvma
|
79
|
-
********/
|
80
|
-
|
81
|
-
#ifdef OS_UNIX
|
82
|
-
void *TRunEvma (void *v)
|
83
|
-
{
|
84
|
-
evma_run_machine();
|
85
|
-
write (SyncSockets[1], "$", 1);
|
86
|
-
return NULL;
|
87
|
-
}
|
88
|
-
#endif
|
89
|
-
|
90
|
-
#ifdef OS_WIN32
|
91
|
-
unsigned int __stdcall TRunEvma (void *v)
|
92
|
-
{
|
93
|
-
evma_run_machine();
|
94
|
-
write (Pipe1[1], "$", 1);
|
95
|
-
return NULL;
|
46
|
+
rb_funcall (EmModule, rb_intern ("event_callback"), 3, rb_str_new2(a1), (a2 << 1) | 1, rb_str_new(a3,a4));
|
96
47
|
}
|
97
|
-
#endif
|
98
48
|
|
99
49
|
|
100
50
|
|
@@ -116,122 +66,11 @@ t_run_machine_without_threads
|
|
116
66
|
|
117
67
|
static VALUE t_run_machine_without_threads (VALUE self)
|
118
68
|
{
|
119
|
-
UseThreads = false;
|
120
69
|
evma_run_machine();
|
121
70
|
return Qnil;
|
122
71
|
}
|
123
72
|
|
124
73
|
|
125
|
-
/*************
|
126
|
-
t_run_machine
|
127
|
-
*************/
|
128
|
-
|
129
|
-
static VALUE t_run_machine (VALUE self)
|
130
|
-
{
|
131
|
-
// This whole method and the whole UseThreads mechanism is
|
132
|
-
// tentatively OBSOLETE. If we replace calls to select with
|
133
|
-
// rb_thread_select, then we appear able to interoperate with
|
134
|
-
// Ruby threads.
|
135
|
-
|
136
|
-
#ifdef OS_UNIX
|
137
|
-
UseThreads = true;
|
138
|
-
|
139
|
-
int sp = socketpair (AF_UNIX, SOCK_STREAM, 0, SyncSockets);
|
140
|
-
if (sp)
|
141
|
-
throw std::runtime_error ("no socket pair");
|
142
|
-
|
143
|
-
char buf [100];
|
144
|
-
snprintf (buf, sizeof(buf), "@io________pipe = IO.new( %d, \"r\")", SyncSockets[0]);
|
145
|
-
rb_eval_string (buf);
|
146
|
-
|
147
|
-
pthread_t tid;
|
148
|
-
pthread_create (&tid, NULL, TRunEvma, NULL);
|
149
|
-
|
150
|
-
while (true) {
|
151
|
-
VALUE v = rb_eval_string ("\
|
152
|
-
if s=select([@io________pipe]) and s=s.shift and s=s.shift\n\
|
153
|
-
r = s.read(1)\n\
|
154
|
-
if r == '+'\n\
|
155
|
-
1\n\
|
156
|
-
elsif r == '$'\n\
|
157
|
-
2\n\
|
158
|
-
else\n\
|
159
|
-
0\n\
|
160
|
-
end\n\
|
161
|
-
else\n\
|
162
|
-
0\n\
|
163
|
-
end\n\
|
164
|
-
");
|
165
|
-
|
166
|
-
if (v == 3) {
|
167
|
-
rb_funcall (EmModule, rb_intern ("event_callback"), 3, rb_str_new2(A1), INT2NUM(A2), rb_str_new(A3,A4));
|
168
|
-
write (SyncSockets[0], "", 1);
|
169
|
-
}
|
170
|
-
else if (v == 5) {
|
171
|
-
break;
|
172
|
-
}
|
173
|
-
|
174
|
-
}
|
175
|
-
|
176
|
-
pthread_join (tid, NULL);
|
177
|
-
close (SyncSockets[0]);
|
178
|
-
close (SyncSockets[1]);
|
179
|
-
|
180
|
-
return Qnil;
|
181
|
-
#endif
|
182
|
-
|
183
|
-
#ifdef OS_WIN32
|
184
|
-
UseThreads = true;
|
185
|
-
|
186
|
-
int sp1 = _pipe (Pipe1, 4096, _O_BINARY);
|
187
|
-
int sp2 = _pipe (Pipe2, 4096, _O_BINARY);
|
188
|
-
if (sp1 || sp2)
|
189
|
-
throw std::runtime_error ("no socket pair");
|
190
|
-
|
191
|
-
char buf [100];
|
192
|
-
snprintf (buf, sizeof(buf), "@io________pipe = IO.new( %d, \"r\")", Pipe1[0]);
|
193
|
-
rb_eval_string (buf);
|
194
|
-
|
195
|
-
unsigned tid;
|
196
|
-
HANDLE h = (HANDLE) _beginthreadex (NULL, 0, TRunEvma, NULL, 0, &tid);
|
197
|
-
CloseHandle (h);
|
198
|
-
|
199
|
-
while (true) {
|
200
|
-
VALUE v = rb_eval_string ("\
|
201
|
-
if s=select([@io________pipe]) and s=s.shift and s=s.shift\n\
|
202
|
-
r = s.read(1)\n\
|
203
|
-
if r == '+'\n\
|
204
|
-
1\n\
|
205
|
-
elsif r == '$'\n\
|
206
|
-
2\n\
|
207
|
-
else\n\
|
208
|
-
0\n\
|
209
|
-
end\n\
|
210
|
-
else\n\
|
211
|
-
0\n\
|
212
|
-
end\n\
|
213
|
-
");
|
214
|
-
|
215
|
-
if (v == 3) {
|
216
|
-
rb_funcall (EmModule, rb_intern ("event_callback"), 3, rb_str_new2(A1), INT2NUM(A2), rb_str_new(A3,A4));
|
217
|
-
write (Pipe2[1], "", 1);
|
218
|
-
}
|
219
|
-
else if (v == 5) {
|
220
|
-
break;
|
221
|
-
}
|
222
|
-
|
223
|
-
}
|
224
|
-
|
225
|
-
close (Pipe1[0]);
|
226
|
-
close (Pipe1[1]);
|
227
|
-
close (Pipe2[0]);
|
228
|
-
close (Pipe2[1]);
|
229
|
-
|
230
|
-
return Qnil;
|
231
|
-
#endif
|
232
|
-
}
|
233
|
-
|
234
|
-
|
235
74
|
/*******************
|
236
75
|
t_add_oneshot_timer
|
237
76
|
*******************/
|
@@ -385,6 +224,5 @@ extern "C" void Init_rubyeventmachine()
|
|
385
224
|
rb_define_const (EmModule, "ConnectionData", (101 << 1) | 1);
|
386
225
|
rb_define_const (EmModule, "ConnectionUnbound", (102 << 1) | 1);
|
387
226
|
rb_define_const (EmModule, "ConnectionAccepted", (103 << 1) | 1);
|
388
|
-
|
389
227
|
}
|
390
228
|
|
data/ext/sigs.cpp
CHANGED
data/ext/sigs.h
CHANGED
data/ext/ssl.cpp
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*****************************************************************************
|
2
2
|
|
3
|
-
$Id: ssl.cpp
|
3
|
+
$Id: ssl.cpp 51 2006-05-16 00:56:51Z blackhedd $
|
4
4
|
|
5
5
|
File: ssl.cpp
|
6
6
|
Date: 30Apr06
|
@@ -89,7 +89,7 @@ static char PrivateMaterials[] = {
|
|
89
89
|
builtin_passwd_cb
|
90
90
|
*****************/
|
91
91
|
|
92
|
-
extern "C"
|
92
|
+
extern "C" int builtin_passwd_cb (char *buf, int bufsize, int rwflag, void *userdata)
|
93
93
|
{
|
94
94
|
strcpy (buf, "kittycat");
|
95
95
|
return 8;
|
data/ext/ssl.h
CHANGED
data/lib/eventmachine.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: eventmachine.rb
|
1
|
+
# $Id: eventmachine.rb 52 2006-05-16 01:01:46Z blackhedd $
|
2
2
|
#
|
3
3
|
# Author:: blackhedd (gmail address: garbagecat20).
|
4
4
|
# Date:: 8 Apr 2006
|
@@ -132,6 +132,7 @@ require 'rubyeventmachine'
|
|
132
132
|
#
|
133
133
|
module EventMachine
|
134
134
|
|
135
|
+
VERSION = "0.5.3"
|
135
136
|
|
136
137
|
# EventMachine::run initializes and runs an event loop.
|
137
138
|
# This method only returns if user-callback code calls stop_event_loop.
|
data/tests/testem.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: eventmachine
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2006-05-
|
6
|
+
version: 0.5.3
|
7
|
+
date: 2006-05-17 00:00:00 -04:00
|
8
8
|
summary: Ruby/EventMachine socket engine library
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- ext/cmain.cpp
|
36
36
|
- ext/sigs.cpp
|
37
37
|
- ext/rubymain.cpp
|
38
|
+
- ext/Makefile
|
38
39
|
- ext/sigs.h
|
39
40
|
- ext/ed.cpp
|
40
41
|
- ext/binder.h
|
@@ -48,6 +49,7 @@ files:
|
|
48
49
|
- ext/extconf.rb
|
49
50
|
- ext/emwin.cpp
|
50
51
|
- ext/page.cpp
|
52
|
+
- ext/mkmf.log
|
51
53
|
- ext/ssl.h
|
52
54
|
- README
|
53
55
|
- RELEASE_NOTES
|