rem: n = NsSSLRecv(sock->arg, bufs->buf, bufs->len);
add: n = NsSSLRecv(sock->arg, bufs->ns_buf, bufs->ns_len);
context: static Ns_DriverProc SSLProc;NS_EXPORT int Ns_ModuleVersion = 1;/* *---------------------------------------------------------------------- * * Ns_ModuleInit -- * *	Initialize the SSL driver. * * Results: *	NS_OK if initialized ok, NS_ERROR otherwise. * * Side effects: *	See Ns_DriverInit. * *---------------------------------------------------------------------- */NS_EXPORT intNs_ModuleInit(char *server, char *module){    char *cert, *key, *path;    void *dssl;    int n;    /*     * Initialize the global and per-driver SSL.     */    path = Ns_ConfigGetPath(server, module, NULL);    if (NsSSLInitialize(server, module) != NS_OK) {         Ns_Log(Error, "%s: failed to initialize ssl driver", module);        return NS_ERROR;     }     cert = Ns_ConfigGet(path, "certfile");     if (cert == NULL) {         Ns_Log(Warning, "%s: certfile not specified", module);         return NS_OK;     } #ifdef SSL_EXPORT     n = 40;#else    n = 128;#endif    Ns_Log(Notice, "%s: initialized with %d-bit encryption", module, n);#ifdef HAVE_SWIFT    Ns_Log(Notice, "%s: SUPPORTS RAINBOW CRYPTOSWIFT HARDWARE SSL ACCELERATOR",	   module);#endif    key = Ns_ConfigGet(path, "keyfile");     dssl = NsSSLCreateServer(cert, key);    if (dssl == NULL) {        return NS_ERROR;    }    /*     * Initialize the driver without the async option so all I/O     * happens in the connection thread, avoiding any possible     * blocking in the driver thread due to SSL overhead.  Set     * the SSL option to use the SSL port and protocol defaults.     */    return Ns_DriverInit(server, module, DRIVER_NAME,	SSLProc, dssl, NS_DRIVER_SSL);}/* *---------------------------------------------------------------------- * * SSLProc -- * *	SSL driver callback proc.  This driver performs the necessary *	handshake and encryption of SSL. * * Results: *	For close, always 0.  For keep, 0 if connection could be *	properly flushed, -1 otherwise.  For send and recv, # of bytes *	processed or -1 on error. * * Side effects: *	None. * *---------------------------------------------------------------------- */static intSSLProc(Ns_DriverCmd cmd, Ns_Sock *sock, Ns_Buf *bufs, int nbufs){    Ns_Driver *driver = sock->driver;    int n, total;    switch (cmd) {    case DriverRecv:    case DriverSend:	/*	 * On first I/O, initialize the connection context.	 */	if (sock->arg == NULL) { 	    n = driver->recvwait;	    if (n > driver->sendwait) {		n = driver->sendwait;	    }	    sock->arg = NsSSLCreateConn(sock->sock, n, driver->arg);	    if (sock->arg == NULL) { 		return -1;	    } 	}	/*	 * Process each buffer one at a time.	 */	total = 0;	do {	    if (cmd == DriverSend) {		n = NsSSLSend(sock->arg, bufs->buf, bufs->len);	    } else {		n = NsSSLRecv(sock->arg, bufs->buf, bufs->len);	    }	    if (n < 0 && total > 0) {		/* NB: Mask error if some bytes were read. */		n = 0;	    }	    ++bufs;	    total += n;	} while (n > 0 && --nbufs > 0);	n = total;	break;    case DriverKeep:	if (sock->arg != NULL && NsSSLFlush(sock->arg) == NS_OK) {	    n = 0;	} else {	    n = -1;	}	break;    case DriverClose:	if (sock->arg != NULL) { 	    (void) NsSSLFlush(sock->arg); 	    NsSSLDestroyConn(sock->arg); 	    sock->arg = NULL;	}	n = 0;	break;    default:	/* Unsupported command. */	n = -1;	break;    }    return n;}