mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-10 21:24:49 +08:00
增加log
This commit is contained in:
4
client.c
4
client.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user