Partially initialized the helper

This commit is contained in:
Pierre Pronchery 2012-10-18 01:51:06 +00:00
parent 440f65ec5c
commit a6da501b9d

View File

@ -37,6 +37,7 @@ static int _udp(char const * name)
{ {
char * cwd; char * cwd;
Plugin * plugin; Plugin * plugin;
AppTransportPluginHelper helper;
AppTransportPluginDefinition * plugind; AppTransportPluginDefinition * plugind;
AppTransportPlugin * server; AppTransportPlugin * server;
AppTransportPlugin * client; AppTransportPlugin * client;
@ -54,9 +55,13 @@ static int _udp(char const * name)
plugin_delete(plugin); plugin_delete(plugin);
return error_print("udp"); return error_print("udp");
} }
/* initialize the helper */
memset(&helper, 0, sizeof(helper));
helper.event = event_new(); /* XXX check errors */
/* FIXME really implement */
/* create a server and a client */ /* create a server and a client */
server = plugind->init(NULL, ATM_SERVER, name); server = plugind->init(&helper, ATM_SERVER, name);
client = plugind->init(NULL, ATM_CLIENT, name); client = plugind->init(&helper, ATM_CLIENT, name);
if(server == NULL || client == NULL) if(server == NULL || client == NULL)
{ {
if(client != NULL) if(client != NULL)
@ -67,6 +72,9 @@ static int _udp(char const * name)
return error_print("udp"); return error_print("udp");
} }
/* FIXME really implement */ /* FIXME really implement */
plugind->destroy(client);
plugind->destroy(server);
event_delete(helper.event);
plugin_delete(plugin); plugin_delete(plugin);
return 0; return 0;
} }