Diff

Differences From Artifact [1a86234107]:

To Artifact [e74ea6fee8]:


515
516
517
518
519
520
521



















522
523
524
525
526
527
528
#ifdef MSCRYPTOAPI
	crypto_wrapup();
#endif
    }

    return msg.wParam;
}




















/*
 * Actually do the job requested by a WM_NETEVENT
 */
static void enact_pending_netevent(void) {
    int i;
    static int reentering = 0;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
#ifdef MSCRYPTOAPI
	crypto_wrapup();
#endif
    }

    return msg.wParam;
}

/*
 * Print a message box and close the connection.
 */
void connection_fatal(char *fmt, ...) {
    va_list ap;
    char stuff[200];

    va_start(ap, fmt);
    vsprintf(stuff, fmt, ap);
    va_end(ap);
    MessageBox(hwnd, stuff, "PuTTY Fatal Error", MB_ICONERROR | MB_OK);
    if (cfg.close_on_exit)
        PostQuitMessage(1);
    else {
        session_closed = TRUE;
        SetWindowText (hwnd, "PuTTY (inactive)");
    }
}

/*
 * Actually do the job requested by a WM_NETEVENT
 */
static void enact_pending_netevent(void) {
    int i;
    static int reentering = 0;
542
543
544
545
546
547
548
549
550
551

552
553
554
555
556
557
558
559
	  case WSAECONNRESET:
	    sprintf(buf, "Connection reset by peer");
	    break;
	  default:
	    sprintf(buf, "Unexpected network error %d", -i);
	    break;
	}
	MessageBox(hwnd, buf, "PuTTY Fatal Error",
		   MB_ICONERROR | MB_OK);
	PostQuitMessage(1);

    } else if (i == 0) {
	if (cfg.close_on_exit)
	    PostQuitMessage(0);
	else {
	    session_closed = TRUE;
	    MessageBox(hwnd, "Connection closed by remote host",
		       "PuTTY", MB_OK | MB_ICONINFORMATION);
	    SetWindowText (hwnd, "PuTTY (inactive)");







|
<
<
>
|







561
562
563
564
565
566
567
568


569
570
571
572
573
574
575
576
577
	  case WSAECONNRESET:
	    sprintf(buf, "Connection reset by peer");
	    break;
	  default:
	    sprintf(buf, "Unexpected network error %d", -i);
	    break;
	}
        connection_fatal(buf);


    }
    if (i <= 0) {
	if (cfg.close_on_exit)
	    PostQuitMessage(0);
	else {
	    session_closed = TRUE;
	    MessageBox(hwnd, "Connection closed by remote host",
		       "PuTTY", MB_OK | MB_ICONINFORMATION);
	    SetWindowText (hwnd, "PuTTY (inactive)");