- fixed bug in Thumb sw breakpoint handling (thanks to Spen for this patch)
[openocd.git] / src / server / server.c
index a034da7928e73cafa9497be592eabe345a36eddb..628c4925a582b7d9ee8eaf5d2ff79d5e05b7d703 100644 (file)
@@ -86,19 +86,16 @@ int add_connection(service_t *service, command_context_t *cmd_ctx)
 
 int remove_connection(service_t *service, connection_t *connection)
 {
-       connection_t *c, *p = NULL;
-
+       connection_t *c = service->connections;
+       
        /* find connection */
-       for (c = service->connections; c; c = c->next)
+       while(c)
        {
+               connection_t *next = c->next;
+               
                if (c->fd == connection->fd)
-               {
-                       /* unlink connection */
-                       if (p)
-                               p->next = c->next;
-                       else
-                               service->connections = c->next;
-                       
+               {       
+                       service->connections = next;
                        service->connection_closed(c);
                        close(c->fd);
                        
@@ -112,7 +109,7 @@ int remove_connection(service_t *service, connection_t *connection)
                }
                
                /* remember the last connection for unlinking */
-               p = c;
+               c = next;
        }
        
        return ERROR_OK;
@@ -182,28 +179,27 @@ int add_service(char *name, enum connection_type type, unsigned short port, int
 
 int remove_service(unsigned short port)
 {
-       service_t *c, *p = NULL;
-
+       service_t *c = services;
+       
        /* find service */
-       for (c = services; c; c = c->next)
+       while(c)
        {
+               service_t *next = c->next;
+               
                if (c->port == port)
-               {
-                       /* unlink service */
-                       if (p)
-                               p->next = c->next;
-                       else
-                               services = c->next;
-                       
+               {       
                        if (c->name)
                                free(c->name);
                        
+                       if (c->priv)
+                               free(c->priv);
+                       
                        /* delete service */
                        free(c);
                }
                
                /* remember the last service for unlinking */
-               p = c;
+               c = next;
        }
        
        return ERROR_OK;

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)