X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fserver%2Fserver.c;h=8da82ec88969ba038434763008be7e1bf339804e;hp=96f06b3feff65095bde1d1697a1c85b8ca806b55;hb=0466ee7e4a54d1415dea9a8fbe9b361b04895db5;hpb=210ff6028480df93f483131d6c6ca1f7f372aa2a diff --git a/src/server/server.c b/src/server/server.c index 96f06b3fef..8da82ec889 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -85,6 +85,7 @@ static int add_connection(struct service *service, struct command_context *cmd_c if (retval != ERROR_OK) { close_socket(c->fd); LOG_ERROR("attempted '%s' connection rejected", service->name); + command_done(c->cmd_ctx); free(c); return retval; } @@ -104,6 +105,7 @@ static int add_connection(struct service *service, struct command_context *cmd_c retval = service->new_connection(c); if (retval != ERROR_OK) { LOG_ERROR("attempted '%s' connection rejected", service->name); + command_done(c->cmd_ctx); free(c); return retval; } @@ -124,6 +126,7 @@ static int add_connection(struct service *service, struct command_context *cmd_c retval = service->new_connection(c); if (retval != ERROR_OK) { LOG_ERROR("attempted '%s' connection rejected", service->name); + command_done(c->cmd_ctx); free(c); return retval; } @@ -462,9 +465,10 @@ int server_loop(struct command_context *command_context) retval = service->input(c); if (retval != ERROR_OK) { struct connection *next = c->next; - if (service->type == CONNECTION_PIPE) { + if (service->type == CONNECTION_PIPE || + service->type == CONNECTION_STDINOUT) { /* if connection uses a pipe then - *shutdown openocd on error */ + * shutdown openocd on error */ shutdown_openocd = 1; } remove_connection(service, c);