No segmentationfault when sending commands to tcl-server.
modified: src/server/server.c
modified: src/server/tcl_server.c
modified: src/server/tcl_server.h
int server_init(struct command_context *cmd_ctx)
{
- int ret = tcl_init(cmd_ctx);
+ int ret = tcl_init();
if (ERROR_OK != ret)
return ret;
static int tcl_input(struct connection *connection)
{
- Jim_Interp *interp = (Jim_Interp *)connection->priv;
+ Jim_Interp *interp = (Jim_Interp *)connection->cmd_ctx->interp;
int retval;
int i;
ssize_t rlen;
return ERROR_OK;
}
-int tcl_init(struct command_context *cmd_ctx)
+int tcl_init(void)
{
int retval;
retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1,
&tcl_new_connection, &tcl_input,
- &tcl_closed, cmd_ctx->interp);
+ &tcl_closed, NULL);
return retval;
}
#include <server/server.h>
-int tcl_init(struct command_context *cmd_ctx);
+int tcl_init(void);
int tcl_register_commands(struct command_context *cmd_ctx);
#endif /* _TCL_SERVER_H_ */