Use this function to send the contents of an entire file to the client.
int filebuf_buf2sd(filebuf *buf, SYS_NETFD sd);
The number of bytes sent to the socket if successful, or the constant IO_ERROR if the file buffer cannot be sent.
filebuf *buf is the file buffer that must already have been opened.
SYS_NETFD sd is the platform-independent socket descriptor. Normally this parameter is obtained from the csd, client socket descriptor field of the sn or the session structure.
if (filebuf_buf2sd(buf, sn->csd) == IO_ERROR) return(REQ_EXIT);