@@ -2133,56 +2133,13 @@ ssh_session2_setup(struct ssh *ssh, int id, int success, void *arg)
21332133 NULL , fileno (stdin ), command , environ );
21342134}
21352135
2136+ /* this used to do a lot more but now it just checks to see
2137+ * if we are disabling hpn */
21362138static void
21372139hpn_options_init (struct ssh * ssh )
21382140{
2139- /*
2140- * We need to check to see if what they want to do about buffer
2141- * sizes here. In a hpn to nonhpn connection we want to limit
2142- * the window size to something reasonable in case the far side
2143- * has the large window bug. In hpn to hpn connection we want to
2144- * use the max window size but allow the user to override it
2145- * lastly if they disabled hpn then use the ssh std window size.
2146- *
2147- * So why don't we just do a getsockopt() here and set the
2148- * ssh window to that? In the case of a autotuning receive
2149- * window the window would get stuck at the initial buffer
2150- * size generally less than 96k. Therefore we need to set the
2151- * maximum ssh window size to the maximum hpn buffer size
2152- * unless the user has specifically set the tcprcvbufpoll
2153- * to no. In which case we *can* just set the window to the
2154- * minimum of the hpn buffer size and tcp receive buffer size.
2155- */
2156-
2157- if (tty_flag )
2158- options .hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT ;
2159- else
2160- options .hpn_buffer_size = (2 * 1024 * 1024 );
2161-
2162- if (ssh -> compat & SSH_BUG_LARGEWINDOW ) {
2163- debug ("HPN to Non-HPN connection" );
2164- } else {
2165- debug ("HPN to HPN connection" );
2166- if (ssh -> compat & SSH_HPNSSH ) {
2167- debug ("Using 'hpn' prefixed binaries" );
2168- }
2169- int sock , socksize ;
2170- socklen_t socksizelen ;
2171- if (options .tcp_rcv_buf_poll <= 0 ) {
2172- sock = socket (AF_INET , SOCK_STREAM , 0 );
2173- socksizelen = sizeof (socksize );
2174- getsockopt (sock , SOL_SOCKET , SO_RCVBUF ,
2175- & socksize , & socksizelen );
2176- close (sock );
2177- debug ("socksize %d" , socksize );
2178- options .hpn_buffer_size = socksize ;
2179- debug ("HPNBufferSize set to TCP RWIN: %d" , options .hpn_buffer_size );
2180- }
2181- }
2182-
2183- debug ("Final hpn_buffer_size = %d" , options .hpn_buffer_size );
2184-
2185- channel_set_hpn (options .hpn_disabled , options .hpn_buffer_size );
2141+ channel_set_hpn_disabled (options .hpn_disabled );
2142+ debug_f ("HPN disabled: %d" , options .hpn_disabled );
21862143}
21872144
21882145/* open new channel for a session */
@@ -2203,7 +2160,7 @@ ssh_session2_open(struct ssh *ssh)
22032160 if (in == -1 || out == -1 || err == -1 )
22042161 fatal ("dup() in/out/err failed" );
22052162
2206- window = options . hpn_buffer_size ;
2163+ window = CHAN_SES_WINDOW_DEFAULT ;
22072164 packetmax = CHAN_SES_PACKET_DEFAULT ;
22082165 if (tty_flag ) {
22092166 window = CHAN_SES_WINDOW_DEFAULT ;
0 commit comments