err = (nsent < 0 ? WSAGetLastError() : 0);
err = (nsent < 0 ? p_WSAGetLastError() : 0);
void try_send(Actual_Socket s){    while (s->sending_oob || bufchain_size(&s->output_data) > 0) {	int nsent;	DWORD err;	void *data;	int len, urgentflag;	if (s->sending_oob) {	    urgentflag = MSG_OOB;	    len = s->sending_oob;	    data = &s->oobdata;	} else {	    urgentflag = 0;	    bufchain_prefix(&s->output_data, &data, &len);	}	nsent = send(s->s, data, len, urgentflag);	noise_ultralight(nsent);	if (nsent <= 0) {	    err = (nsent < 0 ? WSAGetLastError() : 0);	    if ((err < WSABASEERR && nsent < 0) || err == WSAEWOULDBLOCK) {		/*		 * Perfectly normal: we've sent all we can for the moment.		 * 		 * (Some WinSock send() implementations can return		 * <0 but leave no sensible error indication -		 * WSAGetLastError() is called but returns zero or		 * a small number - so we check that case and treat		 * it just like WSAEWOULDBLOCK.)		 */		s->writable = FALSE;		return;	    } else if (nsent == 0 ||		       err == WSAECONNABORTED || err == WSAECONNRESET) {		/*		 * If send() returns CONNABORTED or CONNRESET, we		 * unfortunately can't just call plug_closing(),		 * because it's quite likely that we're currently		 * _in_ a call from the code we'd be calling back		 * to, so we'd have to make half the SSH code		 * reentrant. Instead we flag a pending error on		 * the socket, to be dealt with (by calling		 * plug_closing()) at some suitable future moment.		 */		s->pending_error = err;		return;	    } else {		/* We're inside the Windows frontend here, so we know		 * that the frontend handle is unnecessary. */		logevent(NULL, winsock_error_string(err));		fatalbox("%s", winsock_error_string(err));	    }	} else {	    if (s->sending_oob) {		if (nsent < len) {		    memmove(s->oobdata, s->oobdata+nsent, len-nsent);		    s->sending_oob = len - nsent;		} else {		    s->sending_oob = 0;		}	    } else {		bufchain_consume(&s->output_data, nsent);	    }	}    }}