summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2006-04-19 16:53:10 +0000
committerfcolin2006-04-19 16:53:10 +0000
commit97ba3631720cd0393b547894b7d2fafc5e361a5e (patch)
treec6a20c267c103f0a944b17eec0518f838f08e076
parent5165be98a850bad1c2371f8ae8fa1e4cc8b76a15 (diff)
downloadivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.zip
ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.gz
ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.bz2
ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.xz
correction Filtred Binding + test avec ivyperf
-rw-r--r--src/ivy.c2
-rwxr-xr-xsrc/ivyperf.c21
2 files changed, 21 insertions, 2 deletions
diff --git a/src/ivy.c b/src/ivy.c
index 6414f72..12b6ae3 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -402,7 +402,7 @@ static void Receive( Client client, void *data, char *line )
#endif //DEBUG
if ( application_bind_callback )
{
- (*application_bind_callback)( clnt, application_bind_data, id, snd->str_regexp, IvyFilterBind );
+ (*application_bind_callback)( clnt, application_bind_data, id, arg, IvyFilterBind );
}
return;
}
diff --git a/src/ivyperf.c b/src/ivyperf.c
index 999fb69..283771c 100755
--- a/src/ivyperf.c
+++ b/src/ivyperf.c
@@ -39,6 +39,8 @@ extern int optind;
#include "ivyloop.h"
#define MILLISEC 1000.0
+char *mymessages[] = { "ping", "pong" };
+
static double currentTime()
{
double current;
@@ -73,7 +75,23 @@ void TimerCall(TimerId id, void *user_data, unsigned long delta)
if ( count == 0 ) fprintf(stderr, "." );
}
+void binCB( IvyClientPtr app, void *user_data, int id, char* regexp, IvyBindEvent event )
+{
+ char *app_name = IvyGetApplicationName( app );
+ switch ( event )
+ {
+ case IvyAddBind:
+ printf("Application:%s bind '%s' ADDED\n", app_name, regexp );
+ break;
+ case IvyRemoveBind:
+ printf("Application:%s bind '%s' REMOVED\n", app_name, regexp );
+ break;
+ case IvyFilterBind:
+ printf("Application:%s bind '%s' FILTRED\n", app_name, regexp );
+ break;
+ }
+}
int main(int argc, char *argv[])
{
long time=200;
@@ -82,7 +100,8 @@ int main(int argc, char *argv[])
if ( argc > 1 ) time = atol( argv[1] );
IvyInit ("IvyPerf", "IvyPerf ready", NULL,NULL,NULL,NULL);
-
+ IvyClasses( sizeof( mymessages )/ sizeof( char *),mymessages );
+ IvySetBindCallback( binCB, 0 ),
IvyBindMsg (Reply, NULL, "^ping ts=(.*)");
IvyBindMsg (Pong, NULL, "^pong ts=(.*) tr=(.*)");