* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
(char *)&flag, /* the cast is historical cruft */
sizeof(int)); /* length of option value */
- LOG_INFO("accepting '%s' connection from %s", service->name, service->port);
+ LOG_INFO("accepting '%s' connection on tcp/%s", service->name, service->port);
retval = service->new_connection(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;
}
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;
}
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;
}
struct service *next = c->next;
if (c->name)
- free((void *)c->name);
+ free(c->name);
if (c->type == CONNECTION_PIPE) {
if (c->fd != -1)
close(c->fd);
}
if (c->port)
- free((void *)c->port);
+ free(c->port);
if (c->priv)
free(c->priv);
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);
return register_commands(cmd_ctx, NULL, server_command_handlers);
}
-SERVER_PORT_COMMAND()
+COMMAND_HELPER(server_port_command, unsigned short *out)
{
switch (CMD_ARGC) {
case 0:
return ERROR_OK;
}
-SERVER_PIPE_COMMAND()
+COMMAND_HELPER(server_pipe_command, char **out)
{
switch (CMD_ARGC) {
case 0:
LOG_WARNING("unable to change server port after init");
return ERROR_COMMAND_ARGUMENT_INVALID;
}
- const char *t = strdup(CMD_ARGV[0]);
- free((void *)*out);
- *out = t;
+ free(*out);
+ *out = strdup(CMD_ARGV[0]);
break;
}
default: