introduced NETWORK_BUFFER_MAX_SIZE to replace BUFSIZ as this might change depending on the arch/libc used

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2020-08-04 17:29:31 +02:00
parent 823b95828c
commit 8a6021268e
4 changed files with 22 additions and 19 deletions

View File

@@ -16,7 +16,7 @@ int main(void)
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in remote_addr = {};
socklen_t remote_addrlen = sizeof(remote_addr);
uint8_t buf[BUFSIZ];
uint8_t buf[NETWORK_BUFFER_MAX_SIZE];
//size_t buf_used = 0;
//unsigned long long int buf_wanted = 0;
@@ -45,7 +45,7 @@ int main(void)
break;
}
printf("RECV[%zd]: '%.*s'\n", bytes_read, (int) bytes_read, buf);
printf("RECV[%zd]: '%.*s'\n\n", bytes_read, (int) bytes_read, buf);
}
return 0;