Skip to content

Commit 168afec

Browse files
committed
Reverting unwanted indentation changes
1 parent bbc576e commit 168afec

File tree

2 files changed

+77
-75
lines changed

2 files changed

+77
-75
lines changed

channels.c

Lines changed: 75 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,90 +1722,90 @@ channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset)
17221722
int len;
17231723

17241724
/* Send buffered output data to the socket. */
1725-
if (c->wfd != -1 &&
1726-
FD_ISSET(c->wfd, writeset) &&
1727-
buffer_len(&c->output) > 0) {
1728-
olen = buffer_len(&c->output);
1729-
if (c->output_filter != NULL) {
1730-
if ((buf = c->output_filter(c, &data, &dlen)) == NULL) {
1731-
debug2("channel %d: filter stops", c->self);
1732-
if (c->type != SSH_CHANNEL_OPEN)
1733-
chan_mark_dead(c);
1734-
else
1735-
chan_write_failed(c);
1736-
return -1;
1737-
}
1738-
} else if (c->datagram) {
1739-
buf = data = buffer_get_string(&c->output, &dlen);
1740-
} else {
1741-
buf = data = buffer_ptr(&c->output);
1742-
dlen = buffer_len(&c->output);
1743-
}
1725+
if (c->wfd != -1 &&
1726+
FD_ISSET(c->wfd, writeset) &&
1727+
buffer_len(&c->output) > 0) {
1728+
olen = buffer_len(&c->output);
1729+
if (c->output_filter != NULL) {
1730+
if ((buf = c->output_filter(c, &data, &dlen)) == NULL) {
1731+
debug2("channel %d: filter stops", c->self);
1732+
if (c->type != SSH_CHANNEL_OPEN)
1733+
chan_mark_dead(c);
1734+
else
1735+
chan_write_failed(c);
1736+
return -1;
1737+
}
1738+
} else if (c->datagram) {
1739+
buf = data = buffer_get_string(&c->output, &dlen);
1740+
} else {
1741+
buf = data = buffer_ptr(&c->output);
1742+
dlen = buffer_len(&c->output);
1743+
}
17441744

1745-
if (c->datagram) {
1746-
/* ignore truncated writes, datagrams might get lost */
1747-
len = write(c->wfd, buf, dlen);
1748-
free(data);
1749-
if (len < 0 && (errno == EINTR || errno == EAGAIN ||
1750-
errno == EWOULDBLOCK))
1751-
return 1;
1752-
if (len <= 0) {
1753-
if (c->type != SSH_CHANNEL_OPEN)
1754-
chan_mark_dead(c);
1755-
else
1756-
chan_write_failed(c);
1757-
return -1;
1758-
}
1759-
goto out;
1760-
}
1745+
if (c->datagram) {
1746+
/* ignore truncated writes, datagrams might get lost */
1747+
len = write(c->wfd, buf, dlen);
1748+
free(data);
1749+
if (len < 0 && (errno == EINTR || errno == EAGAIN ||
1750+
errno == EWOULDBLOCK))
1751+
return 1;
1752+
if (len <= 0) {
1753+
if (c->type != SSH_CHANNEL_OPEN)
1754+
chan_mark_dead(c);
1755+
else
1756+
chan_write_failed(c);
1757+
return -1;
1758+
}
1759+
goto out;
1760+
}
17611761
#ifdef _AIX
1762-
/* XXX: Later AIX versions can't push as much data to tty */
1763-
if (compat20 && c->wfd_isatty)
1764-
dlen = MIN(dlen, 8 * 1024);
1762+
/* XXX: Later AIX versions can't push as much data to tty */
1763+
if (compat20 && c->wfd_isatty)
1764+
dlen = MIN(dlen, 8*1024);
17651765
#endif
17661766
#ifdef WIN32_FIXME /* TODO - Fix this - on windows we somehow end up with dlen = 0*/
1767-
if (dlen > 0) {
1767+
if (dlen > 0) {
17681768
#endif
17691769

1770-
len = write(c->wfd, buf, dlen);
1771-
if (len < 0 &&
1772-
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK))
1773-
return 1;
1774-
if (len <= 0) {
1775-
if (c->type != SSH_CHANNEL_OPEN) {
1776-
debug2("channel %d: not open", c->self);
1777-
chan_mark_dead(c);
1778-
return -1;
1779-
} else if (compat13) {
1780-
buffer_clear(&c->output);
1781-
debug2("channel %d: input draining.", c->self);
1782-
c->type = SSH_CHANNEL_INPUT_DRAINING;
1783-
} else {
1784-
chan_write_failed(c);
1785-
}
1786-
return -1;
1787-
}
1770+
len = write(c->wfd, buf, dlen);
1771+
if (len < 0 &&
1772+
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK))
1773+
return 1;
1774+
if (len <= 0) {
1775+
if (c->type != SSH_CHANNEL_OPEN) {
1776+
debug2("channel %d: not open", c->self);
1777+
chan_mark_dead(c);
1778+
return -1;
1779+
} else if (compat13) {
1780+
buffer_clear(&c->output);
1781+
debug2("channel %d: input draining.", c->self);
1782+
c->type = SSH_CHANNEL_INPUT_DRAINING;
1783+
} else {
1784+
chan_write_failed(c);
1785+
}
1786+
return -1;
1787+
}
17881788
#ifndef WIN32_FIXME//R
17891789
#ifndef BROKEN_TCGETATTR_ICANON
1790-
if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
1791-
if (tcgetattr(c->wfd, &tio) == 0 &&
1792-
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
1793-
/*
1794-
* Simulate echo to reduce the impact of
1795-
* traffic analysis. We need to match the
1796-
* size of a SSH2_MSG_CHANNEL_DATA message
1797-
* (4 byte channel id + buf)
1798-
*/
1799-
packet_send_ignore(4 + len);
1800-
packet_send();
1801-
}
1802-
}
1790+
if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
1791+
if (tcgetattr(c->wfd, &tio) == 0 &&
1792+
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
1793+
/*
1794+
* Simulate echo to reduce the impact of
1795+
* traffic analysis. We need to match the
1796+
* size of a SSH2_MSG_CHANNEL_DATA message
1797+
* (4 byte channel id + buf)
1798+
*/
1799+
packet_send_ignore(4 + len);
1800+
packet_send();
1801+
}
1802+
}
18031803
#endif
18041804
#endif
1805-
buffer_consume(&c->output, len);
1806-
}
1805+
buffer_consume(&c->output, len);
1806+
}
18071807
#ifdef WIN32_FIXME /* for if (dlen > 0) */
1808-
}
1808+
}
18091809
#endif
18101810
out:
18111811
if (compat20 && olen > 0)
@@ -2448,8 +2448,10 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
24482448
char *data;
24492449
u_int data_len, tcode;
24502450
Channel *c;
2451+
#ifndef WIN32_FIXME
24512452
char *respbuf = NULL;
24522453
size_t resplen = 0;
2454+
#endif
24532455

24542456
/* Get the channel number and verify it. */
24552457
id = packet_get_int();

contrib/win32/win32compat/ssh-agent/authagent-request.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ InitLsaString(LSA_STRING *lsa_string, const char *str)
4545
if (str == NULL)
4646
memset(lsa_string, 0, sizeof(LSA_STRING));
4747
else {
48-
lsa_string->Buffer = (char *)str;
49-
lsa_string->Length = strlen(str);
48+
lsa_string->Buffer = (char *)str;
49+
lsa_string->Length = strlen(str);
5050
lsa_string->MaximumLength = lsa_string->Length + 1;
5151
}
5252
}

0 commit comments

Comments
 (0)