1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-10 21:24:49 +08:00

增加log

This commit is contained in:
fumiama
2021-05-04 16:02:56 +08:00
parent b9705588b5
commit b32882691e
2 changed files with 46 additions and 40 deletions

View File

@@ -37,7 +37,7 @@ void getMessage(void *p) {
}
}
off_t fileSize(const char* fname) {
off_t file_size_of(const char* fname) {
struct stat statbuf;
if(stat(fname, &statbuf)==0) return statbuf.st_size;
else return -1;
@@ -73,7 +73,7 @@ int main(int argc,char *argv[]) { //usage: ./client host port
fp = fopen(buf, "rb");
if(fp) {
off_t len = 0;
file_size = (uint32_t)fileSize(buf);
file_size = (uint32_t)file_size_of(buf);
#if __APPLE__
struct iovec headers;
headers.iov_base = &file_size;