add: if (nsend == 0) { Ns_WriteConn(conn, NULL, 0); }
context: ConnSend(Ns_Conn *conn, int nsend, Tcl_Channel chan, FILE *fp, int fd){    int             toread, nread, status;    char            buf[IOBUFSZ];    status = NS_OK;    while (status == NS_OK && nsend > 0) {        toread = nsend;        if (toread > sizeof(buf)) {            toread = sizeof(buf);        }	if (chan != NULL) {	    nread = Tcl_Read(chan, buf, toread);	} else if (fp != NULL) {            nread = fread(buf, 1, (size_t)toread, fp);            if (ferror(fp)) {	    	nread = -1;	    }    	} else {	    nread = read(fd, buf, (size_t)toread);    	}	if (nread == -1) {	    status = NS_ERROR;	} else if (nread == 0) {             nsend = 0;	/* NB: Silently ignore a truncated file. */	} else if ((status = Ns_WriteConn(conn, buf, nread)) == NS_OK) {            nsend -= nread;	}    }    return status;}