@@ -534,9 +534,16 @@ channel_new(struct ssh *ssh, char *ctype, int type, int rfd, int wfd, int efd,
534
534
(c -> output = sshbuf_new ()) == NULL ||
535
535
(c -> extended = sshbuf_new ()) == NULL )
536
536
fatal_f ("sshbuf_new failed" );
537
+
538
+ /* these buffers are important in terms of tracking channel
539
+ * buffer usage so label and type them with descriptive names */
537
540
sshbuf_relabel (c -> input , "channel input" );
541
+ sshbuf_type (c -> input , BUF_CHANNEL_INPUT );
538
542
sshbuf_relabel (c -> output , "channel output" );
543
+ sshbuf_type (c -> output , BUF_CHANNEL_OUTPUT );
539
544
sshbuf_relabel (c -> extended , "channel extended" );
545
+ sshbuf_type (c -> extended , BUF_CHANNEL_EXTENDED );
546
+
540
547
if ((r = sshbuf_set_max_size (c -> input , CHAN_INPUT_MAX )) != 0 )
541
548
fatal_fr (r , "sshbuf_set_max_size" );
542
549
c -> ostate = CHAN_OUTPUT_OPEN ;
@@ -2401,40 +2408,20 @@ channel_check_window(struct ssh *ssh, Channel *c)
2401
2408
{
2402
2409
int r ;
2403
2410
2404
- /* going back to a set denominator of 2. Prior versions had a
2405
- * dynamic denominator based on the size of the buffer. This may
2406
- * have been helpful in some situations but it isn't helping in
2407
- * the general case -cjr 6/30/23 */
2408
2411
if (c -> type == SSH_CHANNEL_OPEN &&
2409
2412
!(c -> flags & (CHAN_CLOSE_SENT |CHAN_CLOSE_RCVD )) &&
2410
2413
((c -> local_window_max - c -> local_window > c -> local_maxpacket * 3 ) ||
2411
2414
c -> local_window < c -> local_window_max /2 ) &&
2412
2415
c -> local_consumed > 0 ) {
2413
- u_int addition = 0 ;
2416
+ int addition = 0 ;
2414
2417
u_int32_t tcpwinsz = channel_tcpwinsz (ssh );
2415
2418
/* adjust max window size if we are in a dynamic environment
2416
2419
* and the tcp receive buffer is larger than the ssh window */
2417
2420
if (c -> dynamic_window && (tcpwinsz > c -> local_window_max )) {
2418
- if (c -> hpn_buffer_limit ) {
2419
- /* limit window growth to prevent buffer issues
2420
- * still not sure what is causing the buffer issues
2421
- * but it may be an issue with c->local_consumed not being
2422
- * handled properly in the cases of bottenecked IO to the
2423
- * wfd endpoint. This does have an impact on throughput
2424
- * as we're essentially maxing out local_window_max to
2425
- * half of the window size */
2426
- addition = (tcpwinsz /2 - c -> local_window_max );
2427
- }
2428
- else {
2429
- /* aggressively grow the window */
2430
- addition = tcpwinsz - c -> local_window_max ;
2431
- }
2421
+ /* aggressively grow the window */
2422
+ addition = tcpwinsz - c -> local_window_max ;
2432
2423
c -> local_window_max += addition ;
2433
- /* doesn't look like we need these
2434
- * sshbuf_set_window_max(c->output, c->local_window_max);
2435
- * sshbuf_set_window_max(c->input, c->local_window_max);
2436
- */
2437
- debug ("Channel %d: Window growth to %d by %d bytes" ,c -> self ,
2424
+ debug_f ("Channel %d: Window growth to %d by %d bytes" ,c -> self ,
2438
2425
c -> local_window_max , addition );
2439
2426
}
2440
2427
if (!c -> have_remote_id )
0 commit comments