* GNU General Public License for more details. *
* *
* 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., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
return ERROR_SERVER_REMOTE_CLOSED;
}
-int jsp_poll_read(void *priv)
+static int jsp_poll_read(void *priv)
{
struct jsp_service *jsp_service = (struct jsp_service *)priv;
unsigned char out_buffer[10];
telnet_connection->closed = 0;
telnet_connection->line_size = 0;
telnet_connection->line_cursor = 0;
- telnet_connection->option_size = 0;
telnet_connection->state = TELNET_STATE_DATA;
/* negotiate telnet options */
jsp_service->connection = connection;
- int retval = target_register_timer_callback(&jsp_poll_read, 1, 1, jsp_service);
+ int retval = target_register_timer_callback(&jsp_poll_read, 1,
+ TARGET_TIMER_TYPE_PERIODIC, jsp_service);
if (ERROR_OK != retval)
return retval;
static int jsp_connection_closed(struct connection *connection)
{
- struct telnet_connection *t_con = connection->priv;
struct jsp_service *jsp_service = connection->service->priv;
- if (t_con->prompt) {
- free(t_con->prompt);
- t_con->prompt = NULL;
- }
-
int retval = target_unregister_timer_callback(&jsp_poll_read, jsp_service);
if (ERROR_OK != retval)
return retval;
- if (connection->priv) {
- free(connection->priv);
- connection->priv = NULL;
- } else
- LOG_ERROR("BUG: connection->priv == NULL");
-
+ free(connection->priv);
+ connection->priv = NULL;
return ERROR_OK;
}
jsp_new_connection,
jsp_input,
jsp_connection_closed,
- jsp_service);
+ jsp_service,
+ NULL);
}
COMMAND_HANDLER(handle_jsp_port_command)
return register_commands(cmd_ctx, NULL, jsp_command_handlers);
}
+void jsp_service_free(void)
+{
+ free(jsp_port);
+}