server: revert commit 7e6556b3cad8 31/6031/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Fri, 13 Nov 2020 22:39:26 +0000 (23:39 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Wed, 10 Mar 2021 21:34:13 +0000 (21:34 +0000)
With the removal of old tpiu code, commit 7e6556b3cad8 ("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>
src/server/gdb_server.c
src/server/rtt_server.c
src/server/server.c
src/server/server.h
src/server/tcl_server.c
src/server/telnet_server.c
src/target/arm_tpiu_swo.c
src/target/openrisc/jsp_server.c

index 9e44287fd768be72b1c6a710bd120af75ea9b255..fc58971a7abb1c92a65a11a9a0e10d7d409889a9 100644 (file)
@@ -3509,7 +3509,7 @@ static int gdb_target_start(struct target *target, const char *port)
 
        ret = add_service("gdb",
                        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 */
        {
                struct target_list *head;
index 3c885cce09af512ce7dee5ed33d6b7c1ec9dfeca..d49e4d00071672a753d7c781a9a1dfbc47adaa00 100644 (file)
@@ -126,7 +126,7 @@ COMMAND_HANDLER(handle_rtt_start_command)
        COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], service->channel);
 
        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) {
                free(service);
index 114af763244067561875201ef69f93a231ac0b71..e53f37d0b8ee05c341730be64ce6becf84eeed76 100644 (file)
@@ -210,8 +210,7 @@ int add_service(char *name,
        new_connection_handler_t new_connection_handler,
        input_handler_t input_handler,
        connection_closed_handler_t connection_closed_handler,
-       void *priv,
-       struct service **new_service)
+       void *priv)
 {
        struct service *c, **p;
        struct hostent *hp;
@@ -347,10 +346,6 @@ int add_service(char *name,
                ;
        *p = c;
 
-       /* if new_service is not NULL, return the created service into it */
-       if (new_service)
-               *new_service = c;
-
        return ERROR_OK;
 }
 
index 99f5fe2eddd2e9c1ee99df32d1ff3830755df944..ff2ada9cbe68ff53c3d36e291275152667c47f24 100644 (file)
@@ -77,7 +77,7 @@ struct service {
 int add_service(char *name, const char *port,
                int max_connections, new_connection_handler_t new_connection_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 server_host_os_entry(void);
index 07213ae79978ea6041cc2e78f626ab2675b13aca..1ecb827a1ab007325d9ec5fa4c41c5b6f20eadbc 100644 (file)
@@ -285,7 +285,7 @@ int tcl_init(void)
 
        return add_service("tcl", tcl_port, CONNECTION_LIMIT_UNLIMITED,
                &tcl_new_connection, &tcl_input,
-               &tcl_closed, NULL, NULL);
+               &tcl_closed, NULL);
 }
 
 COMMAND_HANDLER(handle_tcl_port_command)
index 4f88d3a542bb6ca83423aed8e4144bee667c06c2..407ab68aefcd74d41d31f205e6e16fb3828cbef2 100644 (file)
@@ -694,7 +694,7 @@ int telnet_init(char *banner)
 
        int ret = add_service("telnet", telnet_port, CONNECTION_LIMIT_UNLIMITED,
                telnet_new_connection, telnet_input, telnet_connection_closed,
-               telnet_service, NULL);
+               telnet_service);
 
        if (ret != ERROR_OK) {
                free(telnet_service);
index b492438d48b862f77738e4aa49f8bcc45efe4d98..2da52e89260d8fcd6a6b97e6ea5ca071e3bafb1e 100644 (file)
@@ -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],
                                CONNECTION_LIMIT_UNLIMITED, arm_tpiu_swo_service_new_connection,
                                arm_tpiu_swo_service_input, arm_tpiu_swo_service_connection_closed,
-                               priv, NULL);
+                               priv);
                        if (retval != ERROR_OK) {
                                LOG_ERROR("Can't configure trace TCP port %s", &obj->out_filename[1]);
                                return JIM_ERR;
index b4b25665dae598269323ea3f26e88b553e6e1c63..4dbe63527da639d6aa1819e8df13cfbc7883fcdb 100644 (file)
@@ -207,8 +207,7 @@ int jsp_init(struct or1k_jtag *jtag_info, char *banner)
                jsp_new_connection,
                jsp_input,
                jsp_connection_closed,
-               jsp_service,
-               NULL);
+               jsp_service);
 }
 
 COMMAND_HANDLER(handle_jsp_port_command)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)