1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-05 00:10:29 +08:00

client可选择大小端

This commit is contained in:
fumiama
2021-05-07 21:03:00 +08:00
parent 3292bfbd9d
commit c9bdb2e5a3

View File

@@ -43,7 +43,7 @@ off_t size_of_file(const char* fname) {
else return -1;
}
int main(int argc,char *argv[]) { //usage: ./client host port
int main(int argc,char *argv[]) { //usage: ./client host port [-l]
ssize_t numbytes;
puts("break!");
while((sockfd = socket(AF_INET,SOCK_STREAM,0)) == -1);
@@ -74,6 +74,7 @@ int main(int argc,char *argv[]) { //usage: ./client host port
if(fp) {
off_t len = 0;
file_size = (uint32_t)size_of_file(buf);
if(argc == 4) file_size = htonl(file_size);
#if __APPLE__
struct iovec headers;
headers.iov_base = &file_size;