#if 0
unsigned int filesize = 0;
struct stat statbuff;
stat(file_name, &statbuff);
filesize = statbuff.st_size;
sendfile( socket_id, myfp, NULL, filesize);
#else
fseek(myfp, 0, SEEK_END);// 指定到文件尾
unsigned int filesize = ftell(myfp);//获取文件长度
fseek(myfp, 0, SEEK_SET);//指定到文件头
#endif
unsigned int filesize = 0;
struct stat statbuff;
stat(file_name, &statbuff);
filesize = statbuff.st_size;
sendfile( socket_id, myfp, NULL, filesize);
#else
fseek(myfp, 0, SEEK_END);// 指定到文件尾
unsigned int filesize = ftell(myfp);//获取文件长度
fseek(myfp, 0, SEEK_SET);//指定到文件头
#endif