server: revert commit 7e6556b3ca
With the removal of old tpiu code, commit 7e6556b3ca
("server:
permit the add_service function to return the created service")
http://openocd.zylin.com/5717/ can be reverted.
Fix also the new calls to add_service().
Change-Id: Ib7f2dfc6a9e829239e20313e0f121911085fdc00
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6031
Tested-by: jenkins
Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
This commit is contained in:
parent
dc7b32ea4a
commit
cb8e3fb2d9
|
@ -3509,7 +3509,7 @@ static int gdb_target_start(struct target *target, const char *port)
|
||||||
|
|
||||||
ret = add_service("gdb",
|
ret = add_service("gdb",
|
||||||
port, target->gdb_max_connections, &gdb_new_connection, &gdb_input,
|
port, target->gdb_max_connections, &gdb_new_connection, &gdb_input,
|
||||||
&gdb_connection_closed, gdb_service, NULL);
|
&gdb_connection_closed, gdb_service);
|
||||||
/* initialize all targets gdb service with the same pointer */
|
/* initialize all targets gdb service with the same pointer */
|
||||||
{
|
{
|
||||||
struct target_list *head;
|
struct target_list *head;
|
||||||
|
|
|
@ -126,7 +126,7 @@ COMMAND_HANDLER(handle_rtt_start_command)
|
||||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], service->channel);
|
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], service->channel);
|
||||||
|
|
||||||
ret = add_service("rtt", CMD_ARGV[0], CONNECTION_LIMIT_UNLIMITED,
|
ret = add_service("rtt", CMD_ARGV[0], CONNECTION_LIMIT_UNLIMITED,
|
||||||
rtt_new_connection, rtt_input, rtt_connection_closed, service, NULL);
|
rtt_new_connection, rtt_input, rtt_connection_closed, service);
|
||||||
|
|
||||||
if (ret != ERROR_OK) {
|
if (ret != ERROR_OK) {
|
||||||
free(service);
|
free(service);
|
||||||
|
|
|
@ -210,8 +210,7 @@ int add_service(char *name,
|
||||||
new_connection_handler_t new_connection_handler,
|
new_connection_handler_t new_connection_handler,
|
||||||
input_handler_t input_handler,
|
input_handler_t input_handler,
|
||||||
connection_closed_handler_t connection_closed_handler,
|
connection_closed_handler_t connection_closed_handler,
|
||||||
void *priv,
|
void *priv)
|
||||||
struct service **new_service)
|
|
||||||
{
|
{
|
||||||
struct service *c, **p;
|
struct service *c, **p;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
|
@ -347,10 +346,6 @@ int add_service(char *name,
|
||||||
;
|
;
|
||||||
*p = c;
|
*p = c;
|
||||||
|
|
||||||
/* if new_service is not NULL, return the created service into it */
|
|
||||||
if (new_service)
|
|
||||||
*new_service = c;
|
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ struct service {
|
||||||
int add_service(char *name, const char *port,
|
int add_service(char *name, const char *port,
|
||||||
int max_connections, new_connection_handler_t new_connection_handler,
|
int max_connections, new_connection_handler_t new_connection_handler,
|
||||||
input_handler_t in_handler, connection_closed_handler_t close_handler,
|
input_handler_t in_handler, connection_closed_handler_t close_handler,
|
||||||
void *priv, struct service **new_service);
|
void *priv);
|
||||||
int remove_service(const char *name, const char *port);
|
int remove_service(const char *name, const char *port);
|
||||||
|
|
||||||
int server_host_os_entry(void);
|
int server_host_os_entry(void);
|
||||||
|
|
|
@ -285,7 +285,7 @@ int tcl_init(void)
|
||||||
|
|
||||||
return add_service("tcl", tcl_port, CONNECTION_LIMIT_UNLIMITED,
|
return add_service("tcl", tcl_port, CONNECTION_LIMIT_UNLIMITED,
|
||||||
&tcl_new_connection, &tcl_input,
|
&tcl_new_connection, &tcl_input,
|
||||||
&tcl_closed, NULL, NULL);
|
&tcl_closed, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
COMMAND_HANDLER(handle_tcl_port_command)
|
COMMAND_HANDLER(handle_tcl_port_command)
|
||||||
|
|
|
@ -694,7 +694,7 @@ int telnet_init(char *banner)
|
||||||
|
|
||||||
int ret = add_service("telnet", telnet_port, CONNECTION_LIMIT_UNLIMITED,
|
int ret = add_service("telnet", telnet_port, CONNECTION_LIMIT_UNLIMITED,
|
||||||
telnet_new_connection, telnet_input, telnet_connection_closed,
|
telnet_new_connection, telnet_input, telnet_connection_closed,
|
||||||
telnet_service, NULL);
|
telnet_service);
|
||||||
|
|
||||||
if (ret != ERROR_OK) {
|
if (ret != ERROR_OK) {
|
||||||
free(telnet_service);
|
free(telnet_service);
|
||||||
|
|
|
@ -697,7 +697,7 @@ static int jim_arm_tpiu_swo_enable(Jim_Interp *interp, int argc, Jim_Obj *const
|
||||||
retval = add_service("tpiu_swo_trace", &obj->out_filename[1],
|
retval = add_service("tpiu_swo_trace", &obj->out_filename[1],
|
||||||
CONNECTION_LIMIT_UNLIMITED, arm_tpiu_swo_service_new_connection,
|
CONNECTION_LIMIT_UNLIMITED, arm_tpiu_swo_service_new_connection,
|
||||||
arm_tpiu_swo_service_input, arm_tpiu_swo_service_connection_closed,
|
arm_tpiu_swo_service_input, arm_tpiu_swo_service_connection_closed,
|
||||||
priv, NULL);
|
priv);
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Can't configure trace TCP port %s", &obj->out_filename[1]);
|
LOG_ERROR("Can't configure trace TCP port %s", &obj->out_filename[1]);
|
||||||
return JIM_ERR;
|
return JIM_ERR;
|
||||||
|
|
|
@ -207,8 +207,7 @@ int jsp_init(struct or1k_jtag *jtag_info, char *banner)
|
||||||
jsp_new_connection,
|
jsp_new_connection,
|
||||||
jsp_input,
|
jsp_input,
|
||||||
jsp_connection_closed,
|
jsp_connection_closed,
|
||||||
jsp_service,
|
jsp_service);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COMMAND_HANDLER(handle_jsp_port_command)
|
COMMAND_HANDLER(handle_jsp_port_command)
|
||||||
|
|
Loading…
Reference in New Issue