@@ -1722,90 +1722,90 @@ channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset)
1722
1722
int len ;
1723
1723
1724
1724
/* 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
+ }
1744
1744
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
+ }
1761
1761
#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 );
1765
1765
#endif
1766
1766
#ifdef WIN32_FIXME /* TODO - Fix this - on windows we somehow end up with dlen = 0*/
1767
- if (dlen > 0 ) {
1767
+ if (dlen > 0 ) {
1768
1768
#endif
1769
1769
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
+ }
1788
1788
#ifndef WIN32_FIXME //R
1789
1789
#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
+ }
1803
1803
#endif
1804
1804
#endif
1805
- buffer_consume (& c -> output , len );
1806
- }
1805
+ buffer_consume (& c -> output , len );
1806
+ }
1807
1807
#ifdef WIN32_FIXME /* for if (dlen > 0) */
1808
- }
1808
+ }
1809
1809
#endif
1810
1810
out :
1811
1811
if (compat20 && olen > 0 )
@@ -2448,8 +2448,10 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
2448
2448
char * data ;
2449
2449
u_int data_len , tcode ;
2450
2450
Channel * c ;
2451
+ #ifndef WIN32_FIXME
2451
2452
char * respbuf = NULL ;
2452
2453
size_t resplen = 0 ;
2454
+ #endif
2453
2455
2454
2456
/* Get the channel number and verify it. */
2455
2457
id = packet_get_int ();
0 commit comments