Cygwin: drop wincap::cons_need_small_input_record_buf

Only required for Windows 7.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-11-15 17:43:15 +01:00
parent 434f2e3f83
commit a11eb81c4b
3 changed files with 9 additions and 34 deletions

View File

@ -302,9 +302,6 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
return;
}
DWORD inrec_size1 =
wincap.cons_need_small_input_record_buf () ? INREC_SIZE : inrec_size;
struct m
{
inline static size_t bytes (size_t n)
@ -354,11 +351,7 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
if (new_input_tmp)
input_tmp = new_input_tmp;
if (new_input_rec && new_input_tmp)
{
inrec_size = new_inrec_size;
if (!wincap.cons_need_small_input_record_buf ())
inrec_size1 = inrec_size;
}
inrec_size = new_inrec_size;
}
WaitForSingleObject (p->input_mutex, mutex_timeout);
@ -373,7 +366,7 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
{
DWORD len;
ReadConsoleInputW (p->input_handle, input_rec + total_read,
min (inrec_size - total_read, inrec_size1),
min (inrec_size - total_read, inrec_size),
&len);
total_read += len;
}
@ -471,7 +464,7 @@ remove_record:
{
DWORD len;
WriteConsoleInputW (p->input_handle, input_rec + n,
min (total_read - n, inrec_size1), &len);
min (total_read - n, inrec_size), &len);
n += len;
}
release_attach_mutex ();
@ -491,22 +484,18 @@ remove_record:
if (new_input_tmp)
input_tmp = new_input_tmp;
if (new_input_rec && new_input_tmp)
{
inrec_size = new_inrec_size;
if (!wincap.cons_need_small_input_record_buf ())
inrec_size1 = inrec_size;
}
inrec_size = new_inrec_size;
}
/* Check if writeback was successfull. */
acquire_attach_mutex (mutex_timeout);
PeekConsoleInputW (p->input_handle, input_tmp, inrec_size1, &n);
PeekConsoleInputW (p->input_handle, input_tmp, inrec_size, &n);
release_attach_mutex ();
if (n < min (total_read, inrec_size1))
if (n < min (total_read, inrec_size))
break; /* Someone has read input without acquiring
input_mutex. ConEmu cygwin-connector? */
if (inrec_eq (input_rec, input_tmp,
min (total_read, inrec_size1)))
min (total_read, inrec_size)))
break; /* OK */
/* Try to fix */
acquire_attach_mutex (mutex_timeout);
@ -516,7 +505,7 @@ remove_record:
{
DWORD len;
ReadConsoleInputW (p->input_handle, input_tmp + n,
min (inrec_size - n, inrec_size1), &len);
min (inrec_size - n, inrec_size), &len);
n += len;
}
release_attach_mutex ();
@ -549,7 +538,7 @@ remove_record:
DWORD len;
WriteConsoleInputW (p->input_handle,
input_tmp + l,
min (n - l, inrec_size1),
min (n - l, inrec_size),
&len);
l += len;
}

View File

@ -33,7 +33,6 @@ struct wincaps
unsigned has_linux_tcp_keepalive_sockopts : 1;
unsigned has_tcp_maxrtms : 1;
unsigned has_con_broken_tabs : 1;
unsigned cons_need_small_input_record_buf : 1;
};
};
@ -86,7 +85,6 @@ public:
bool IMPLEMENT (has_linux_tcp_keepalive_sockopts)
bool IMPLEMENT (has_tcp_maxrtms)
bool IMPLEMENT (has_con_broken_tabs)
bool IMPLEMENT (cons_need_small_input_record_buf)
void disable_case_sensitive_dirs ()
{

View File

@ -40,7 +40,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:false,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:true,
},
};
@ -65,7 +64,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:false,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:false,
},
};
@ -90,7 +88,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:false,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:false,
},
};
@ -115,7 +112,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared))
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:false,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:false,
},
};
@ -140,7 +136,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared))
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:true,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:false,
},
};
@ -165,7 +160,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:false,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -190,7 +184,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -215,7 +208,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -240,7 +232,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -265,7 +256,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -290,7 +280,6 @@ wincaps wincap_10_2004 __attribute__((section (".cygwin_dll_common"), shared)) =
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:true,
cons_need_small_input_record_buf:false,
},
};
@ -315,7 +304,6 @@ wincaps wincap_11 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_linux_tcp_keepalive_sockopts:true,
has_tcp_maxrtms:true,
has_con_broken_tabs:false,
cons_need_small_input_record_buf:false,
},
};