mirror of https://github.com/macssh/macssh.git
fix for large paste
This commit is contained in:
parent
50f1e1fd3d
commit
e8b2ccc45e
|
@ -178,8 +178,9 @@ Str32
|
|||
answerback; // Message to send when server sends TERMTYPE Telnet option
|
||||
|
||||
// The following are used during paste operations
|
||||
long
|
||||
outlen; // Length of text remaining to be pasted (can be > 32K)
|
||||
short
|
||||
outlen, // Length of text remaining to be pasted
|
||||
pastemethod, // 0 = All at once, 1 = in blocks of size pasteblock
|
||||
pastesize; // Size of paste "blocks"
|
||||
|
||||
|
|
|
@ -749,23 +749,24 @@ short ReallyClose( short scrn)
|
|||
short item;
|
||||
Str255 scratchPstring;
|
||||
|
||||
setLastCursor(theCursors[normcurs]);
|
||||
if (!gApplicationPrefs->dontWarnOnClose) {
|
||||
setLastCursor(theCursors[normcurs]);
|
||||
|
||||
GetWTitle(screens[scrn].wind, scratchPstring);
|
||||
ParamText(scratchPstring, NULL, NULL, NULL);
|
||||
|
||||
dtemp = GetNewMyDialog( CloseDLOG, NULL, kInFront, (void *)ThirdCenterDialog);
|
||||
GetWTitle(screens[scrn].wind, scratchPstring);
|
||||
ParamText(scratchPstring, NULL, NULL, NULL);
|
||||
|
||||
dtemp = GetNewMyDialog( CloseDLOG, NULL, kInFront, (void *)ThirdCenterDialog);
|
||||
|
||||
item = DLOGCancel +1;
|
||||
while (item> DLOGCancel)
|
||||
ModalDialog(DLOGwOK_CancelUPP, &item);
|
||||
item = DLOGCancel +1;
|
||||
while (item> DLOGCancel)
|
||||
ModalDialog(DLOGwOK_CancelUPP, &item);
|
||||
|
||||
DisposeDialog( dtemp);
|
||||
|
||||
updateCursor(1);
|
||||
|
||||
if (item == DLOGCancel) return(0);
|
||||
DisposeDialog( dtemp);
|
||||
|
||||
updateCursor(1);
|
||||
|
||||
if (item == DLOGCancel) return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
@ -1113,6 +1114,7 @@ Boolean HandleQuit(void)
|
|||
{
|
||||
short i;
|
||||
Boolean liveConnections = FALSE, die = TRUE;
|
||||
short kcount = 0;
|
||||
|
||||
if (TelInfo->numwindows>0)
|
||||
{
|
||||
|
@ -1128,6 +1130,8 @@ Boolean HandleQuit(void)
|
|||
{
|
||||
for (i = TelInfo->numwindows - 1; i >= 0; i--)
|
||||
{
|
||||
if (screens[i].authenticate)
|
||||
++kcount;
|
||||
netclose(screens[i].port);
|
||||
destroyport(i);
|
||||
}
|
||||
|
@ -1135,7 +1139,7 @@ Boolean HandleQuit(void)
|
|||
else
|
||||
return (TRUE);
|
||||
}
|
||||
if (gApplicationPrefs->destroyKTickets)
|
||||
if (gApplicationPrefs->destroyKTickets && kcount)
|
||||
DestroyTickets();
|
||||
quit();
|
||||
return (FALSE);
|
||||
|
|
|
@ -254,18 +254,19 @@ void pasteText(short scrn)
|
|||
return; /* BYU 2.4.16 */
|
||||
} /* BYU 2.4.16 */
|
||||
|
||||
if (!tw->pastemethod) { // Do this all at once?
|
||||
amount = netwrite(tw->port, tw->outptr,
|
||||
tw->outlen);
|
||||
}
|
||||
else { // Nope, do it in blocks
|
||||
if (tw->pastesize <= tw->outlen)
|
||||
// netwrite cannot send blocks larger than 32767...
|
||||
if ( !tw->pastemethod && tw->outlen < 32768 ) { // Do this all at once?
|
||||
amount = netwrite(tw->port, tw->outptr, tw->outlen);
|
||||
} else { // Nope, do it in blocks
|
||||
if ( tw->pastemethod && tw->outlen > tw->pastesize )
|
||||
amount = tw->pastesize;
|
||||
else if ( tw->outlen > 32767 )
|
||||
amount = 32767;
|
||||
else
|
||||
amount = tw->outlen;
|
||||
amount = netwrite(tw->port, tw->outptr, amount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (tw->echo)
|
||||
parse( tw,(unsigned char *) tw->outptr,amount);
|
||||
|
||||
|
|
|
@ -526,8 +526,8 @@ short netwrite(short pnum, void *buffer, short nsend)
|
|||
//TRACEN(DUMP("netwrite\n", buffer, nsend));
|
||||
nsend = 0;
|
||||
if (context) {
|
||||
while (n) {
|
||||
if ( context->_gConsoleInBufLen < context->_gConsoleInBufMax ) {
|
||||
while (n > 0) {
|
||||
if ( context->_gConsoleInBufMax - context->_gConsoleInBufLen > 0 ) {
|
||||
long len = n;
|
||||
if ( len > context->_gConsoleInBufMax - context->_gConsoleInBufLen )
|
||||
len = context->_gConsoleInBufMax - context->_gConsoleInBufLen;
|
||||
|
|
Loading…
Reference in New Issue