summaryrefslogtreecommitdiff
path: root/accel-pptpd/triton/md.c
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-08-31 18:21:14 +0400
committerKozlov Dmitry <dima@server>2010-08-31 18:21:14 +0400
commit5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee (patch)
tree14d1d6178e14e096dd7341eb33c3e73b02f0fd0c /accel-pptpd/triton/md.c
parent55ebaec066819d068bf13a42998ebc3f31377990 (diff)
downloadaccel-ppp-xebd-5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee.tar.gz
accel-ppp-xebd-5bac5a2edb7bc7639c853fd0f7109dcddb7c4cee.zip
rewriting triton library...
Diffstat (limited to 'accel-pptpd/triton/md.c')
-rw-r--r--accel-pptpd/triton/md.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/accel-pptpd/triton/md.c b/accel-pptpd/triton/md.c
index 05af432..3080c5a 100644
--- a/accel-pptpd/triton/md.c
+++ b/accel-pptpd/triton/md.c
@@ -6,7 +6,7 @@
#include "triton_p.h"
-int max_events=128;
+extern int max_events;
static int epoll_fd;
static struct epoll_event *epoll_events;
@@ -16,29 +16,20 @@ static void* md_thread(void *arg)
int md_init()
{
- epoll_fd=epoll_create(0);
+ epoll_fd=epoll_create(1);
if (epoll_fd<0)
{
perror("epoll_create");
return -1;
}
- epoll_events=malloc(MAX_EVENTS * sizeof(struct epoll_event));
+ epoll_events=malloc(max_events * sizeof(struct epoll_event));
if (!epoll_events)
{
fprintf(stderr,"cann't allocate memory\n");
return -1;
}
- default_ctx=malloc(sizeof(*default_ctx));
- if (!default_ctx)
- {
- fprintf(stderr,"cann't allocate memory\n");
- return -1;
- }
-
- triton_register_ctx(default_ctx);
-
return 0;
}
void md_run()
@@ -53,11 +44,8 @@ void md_terminate()
static void* md_thread(void *arg)
{
- int max_fd=0,t,r;
+ int i,n,r;
struct triton_md_handler_t *h;
- struct timeval tv1,tv2,twait0;
- struct list_head *p1,*p2;
- int timeout,i,n;
n=epoll_wait(epoll_fd,epoll_events,MAX_EVENTS,-1);
if (n<0)