mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-01 11:14:57 +02:00
Reverting unwanted indentation changes
This commit is contained in:
parent
bbc576eeaf
commit
168afecec7
148
channels.c
148
channels.c
@ -1722,90 +1722,90 @@ channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset)
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
/* Send buffered output data to the socket. */
|
/* Send buffered output data to the socket. */
|
||||||
if (c->wfd != -1 &&
|
if (c->wfd != -1 &&
|
||||||
FD_ISSET(c->wfd, writeset) &&
|
FD_ISSET(c->wfd, writeset) &&
|
||||||
buffer_len(&c->output) > 0) {
|
buffer_len(&c->output) > 0) {
|
||||||
olen = buffer_len(&c->output);
|
olen = buffer_len(&c->output);
|
||||||
if (c->output_filter != NULL) {
|
if (c->output_filter != NULL) {
|
||||||
if ((buf = c->output_filter(c, &data, &dlen)) == NULL) {
|
if ((buf = c->output_filter(c, &data, &dlen)) == NULL) {
|
||||||
debug2("channel %d: filter stops", c->self);
|
debug2("channel %d: filter stops", c->self);
|
||||||
if (c->type != SSH_CHANNEL_OPEN)
|
if (c->type != SSH_CHANNEL_OPEN)
|
||||||
chan_mark_dead(c);
|
chan_mark_dead(c);
|
||||||
else
|
else
|
||||||
chan_write_failed(c);
|
chan_write_failed(c);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (c->datagram) {
|
} else if (c->datagram) {
|
||||||
buf = data = buffer_get_string(&c->output, &dlen);
|
buf = data = buffer_get_string(&c->output, &dlen);
|
||||||
} else {
|
} else {
|
||||||
buf = data = buffer_ptr(&c->output);
|
buf = data = buffer_ptr(&c->output);
|
||||||
dlen = buffer_len(&c->output);
|
dlen = buffer_len(&c->output);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->datagram) {
|
if (c->datagram) {
|
||||||
/* ignore truncated writes, datagrams might get lost */
|
/* ignore truncated writes, datagrams might get lost */
|
||||||
len = write(c->wfd, buf, dlen);
|
len = write(c->wfd, buf, dlen);
|
||||||
free(data);
|
free(data);
|
||||||
if (len < 0 && (errno == EINTR || errno == EAGAIN ||
|
if (len < 0 && (errno == EINTR || errno == EAGAIN ||
|
||||||
errno == EWOULDBLOCK))
|
errno == EWOULDBLOCK))
|
||||||
return 1;
|
return 1;
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
if (c->type != SSH_CHANNEL_OPEN)
|
if (c->type != SSH_CHANNEL_OPEN)
|
||||||
chan_mark_dead(c);
|
chan_mark_dead(c);
|
||||||
else
|
else
|
||||||
chan_write_failed(c);
|
chan_write_failed(c);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
/* XXX: Later AIX versions can't push as much data to tty */
|
/* XXX: Later AIX versions can't push as much data to tty */
|
||||||
if (compat20 && c->wfd_isatty)
|
if (compat20 && c->wfd_isatty)
|
||||||
dlen = MIN(dlen, 8 * 1024);
|
dlen = MIN(dlen, 8*1024);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32_FIXME /* TODO - Fix this - on windows we somehow end up with dlen = 0*/
|
#ifdef WIN32_FIXME /* TODO - Fix this - on windows we somehow end up with dlen = 0*/
|
||||||
if (dlen > 0) {
|
if (dlen > 0) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
len = write(c->wfd, buf, dlen);
|
len = write(c->wfd, buf, dlen);
|
||||||
if (len < 0 &&
|
if (len < 0 &&
|
||||||
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK))
|
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK))
|
||||||
return 1;
|
return 1;
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
if (c->type != SSH_CHANNEL_OPEN) {
|
if (c->type != SSH_CHANNEL_OPEN) {
|
||||||
debug2("channel %d: not open", c->self);
|
debug2("channel %d: not open", c->self);
|
||||||
chan_mark_dead(c);
|
chan_mark_dead(c);
|
||||||
return -1;
|
return -1;
|
||||||
} else if (compat13) {
|
} else if (compat13) {
|
||||||
buffer_clear(&c->output);
|
buffer_clear(&c->output);
|
||||||
debug2("channel %d: input draining.", c->self);
|
debug2("channel %d: input draining.", c->self);
|
||||||
c->type = SSH_CHANNEL_INPUT_DRAINING;
|
c->type = SSH_CHANNEL_INPUT_DRAINING;
|
||||||
} else {
|
} else {
|
||||||
chan_write_failed(c);
|
chan_write_failed(c);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32_FIXME//R
|
#ifndef WIN32_FIXME//R
|
||||||
#ifndef BROKEN_TCGETATTR_ICANON
|
#ifndef BROKEN_TCGETATTR_ICANON
|
||||||
if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
|
if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
|
||||||
if (tcgetattr(c->wfd, &tio) == 0 &&
|
if (tcgetattr(c->wfd, &tio) == 0 &&
|
||||||
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
|
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
|
||||||
/*
|
/*
|
||||||
* Simulate echo to reduce the impact of
|
* Simulate echo to reduce the impact of
|
||||||
* traffic analysis. We need to match the
|
* traffic analysis. We need to match the
|
||||||
* size of a SSH2_MSG_CHANNEL_DATA message
|
* size of a SSH2_MSG_CHANNEL_DATA message
|
||||||
* (4 byte channel id + buf)
|
* (4 byte channel id + buf)
|
||||||
*/
|
*/
|
||||||
packet_send_ignore(4 + len);
|
packet_send_ignore(4 + len);
|
||||||
packet_send();
|
packet_send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
buffer_consume(&c->output, len);
|
buffer_consume(&c->output, len);
|
||||||
}
|
}
|
||||||
#ifdef WIN32_FIXME /* for if (dlen > 0) */
|
#ifdef WIN32_FIXME /* for if (dlen > 0) */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
out:
|
out:
|
||||||
if (compat20 && olen > 0)
|
if (compat20 && olen > 0)
|
||||||
@ -2448,8 +2448,10 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
|
|||||||
char *data;
|
char *data;
|
||||||
u_int data_len, tcode;
|
u_int data_len, tcode;
|
||||||
Channel *c;
|
Channel *c;
|
||||||
|
#ifndef WIN32_FIXME
|
||||||
char *respbuf = NULL;
|
char *respbuf = NULL;
|
||||||
size_t resplen = 0;
|
size_t resplen = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Get the channel number and verify it. */
|
/* Get the channel number and verify it. */
|
||||||
id = packet_get_int();
|
id = packet_get_int();
|
||||||
|
@ -45,8 +45,8 @@ InitLsaString(LSA_STRING *lsa_string, const char *str)
|
|||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
memset(lsa_string, 0, sizeof(LSA_STRING));
|
memset(lsa_string, 0, sizeof(LSA_STRING));
|
||||||
else {
|
else {
|
||||||
lsa_string->Buffer = (char *)str;
|
lsa_string->Buffer = (char *)str;
|
||||||
lsa_string->Length = strlen(str);
|
lsa_string->Length = strlen(str);
|
||||||
lsa_string->MaximumLength = lsa_string->Length + 1;
|
lsa_string->MaximumLength = lsa_string->Length + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user