pipes have different fd's for in/out. This makes the
code more orthogonal and prepares for adding pipes.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
- if (connection->service->type == CONNECTION_PIPE)
+ if (connection->service->type != CONNECTION_TCP)
{
gdb_con->buf_cnt = read(connection->fd, gdb_con->buffer, GDB_BUFFER_SIZE);
}
{
gdb_con->buf_cnt = read(connection->fd, gdb_con->buffer, GDB_BUFFER_SIZE);
}
if (gdb_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
if (gdb_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
- if (connection->service->type == CONNECTION_PIPE)
+ if (write_socket(connection->fd_out, data, len) == len)
- /* write to stdout */
- if (write(STDOUT_FILENO, data, len) == len)
- {
- return ERROR_OK;
- }
- }
- else
- {
- if (write_socket(connection->fd, data, len) == len)
- {
- return ERROR_OK;
- }
}
gdb_con->closed = 1;
return ERROR_SERVER_REMOTE_CLOSED;
}
gdb_con->closed = 1;
return ERROR_SERVER_REMOTE_CLOSED;
c = malloc(sizeof(struct connection));
c->fd = -1;
c = malloc(sizeof(struct connection));
c->fd = -1;
memset(&c->sin, 0, sizeof(c->sin));
c->cmd_ctx = copy_command_context(cmd_ctx);
c->service = service;
memset(&c->sin, 0, sizeof(c->sin));
c->cmd_ctx = copy_command_context(cmd_ctx);
c->service = service;
address_size = sizeof(c->sin);
c->fd = accept(service->fd, (struct sockaddr *)&service->sin, &address_size);
address_size = sizeof(c->sin);
c->fd = accept(service->fd, (struct sockaddr *)&service->sin, &address_size);
/* This increases performance dramatically for e.g. GDB load which
* does not have a sliding window protocol. */
/* This increases performance dramatically for e.g. GDB load which
* does not have a sliding window protocol. */
else if (service->type == CONNECTION_PIPE)
{
c->fd = service->fd;
else if (service->type == CONNECTION_PIPE)
{
c->fd = service->fd;
+ c->fd_out = fileno(stdout);
+
+ /* do not check for new connections again on stdin */
+ service->fd = -1;
/* do not check for new connections again on stdin */
service->fd = -1;
/* do not check for new connections again on stdin */
service->fd = -1;
}
else if (type == CONNECTION_PIPE)
{
}
else if (type == CONNECTION_PIPE)
{
- /* use stdin */
- c->fd = STDIN_FILENO;
#ifdef _WIN32
/* for win32 set stdin/stdout to binary mode */
#ifdef _WIN32
/* for win32 set stdin/stdout to binary mode */
- if (service->type != CONNECTION_PIPE)
+ if (service->type == CONNECTION_TCP)
{
struct sockaddr_in sin;
socklen_t address_size = sizeof(sin);
{
struct sockaddr_in sin;
socklen_t address_size = sizeof(sin);
struct connection
{
int fd;
struct connection
{
int fd;
+ int fd_out; /* When using pipes we're writing to a different fd */
struct sockaddr_in sin;
struct command_context *cmd_ctx;
struct service *service;
struct sockaddr_in sin;
struct command_context *cmd_ctx;
struct service *service;
return ERROR_SERVER_REMOTE_CLOSED;
wlen = write_socket(connection->fd, data, len);
return ERROR_SERVER_REMOTE_CLOSED;
wlen = write_socket(connection->fd, data, len);
if (wlen == len)
return ERROR_OK;
if (wlen == len)
return ERROR_OK;
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * Copyright (C) 2007,2008 Øyvind Harboe *
+ * Copyright (C) 2007-2010 Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008 by Spencer Oliver *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008 by Spencer Oliver *
if (t_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
if (t_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
- if (write_socket(connection->fd, data, len) == len)
+ if (write_socket(connection->fd_out, data, len) == len)
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)