Fixed bug in tcl-server

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
__archive__
Matthias Bode 2010-05-03 22:35:38 +02:00 committed by Øyvind Harboe
parent 91b9f3de0b
commit 31b050108a
3 changed files with 5 additions and 5 deletions

View File

@ -513,7 +513,7 @@ int server_preinit(void)
int server_init(struct command_context *cmd_ctx) int server_init(struct command_context *cmd_ctx)
{ {
int ret = tcl_init(cmd_ctx); int ret = tcl_init();
if (ERROR_OK != ret) if (ERROR_OK != ret)
return ret; return ret;

View File

@ -81,7 +81,7 @@ static int tcl_new_connection(struct connection *connection)
static int tcl_input(struct connection *connection) 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 retval;
int i; int i;
ssize_t rlen; ssize_t rlen;
@ -157,7 +157,7 @@ static int tcl_closed(struct connection *connection)
return ERROR_OK; return ERROR_OK;
} }
int tcl_init(struct command_context *cmd_ctx) int tcl_init(void)
{ {
int retval; int retval;
@ -169,7 +169,7 @@ int tcl_init(struct command_context *cmd_ctx)
retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1, retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1,
&tcl_new_connection, &tcl_input, &tcl_new_connection, &tcl_input,
&tcl_closed, cmd_ctx->interp); &tcl_closed, NULL);
return retval; return retval;
} }

View File

@ -22,7 +22,7 @@
#include <server/server.h> #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); int tcl_register_commands(struct command_context *cmd_ctx);
#endif /* _TCL_SERVER_H_ */ #endif /* _TCL_SERVER_H_ */