Create a message descriptor type.
This replaces the sentinel at the end of the pb_field_t array for each message type. git-svn-id: https://svn.kapsi.fi/jpa/nanopb-dev@1007 e3a754e5-d11d-0410-8d38-ebb782a927b9
This commit is contained in:
committed by
Petteri Aimonen
parent
dcf43a6416
commit
43b8e20744
@@ -53,7 +53,7 @@ void handle_connection(int connfd)
|
||||
pb_ostream_t output = pb_ostream_from_socket(connfd);
|
||||
DIR *directory;
|
||||
|
||||
if (!pb_decode(&input, ListFilesRequest_fields, &request))
|
||||
if (!pb_decode(&input, ListFilesRequest_msg, &request))
|
||||
{
|
||||
printf("Decoding failed.\n");
|
||||
return;
|
||||
@@ -78,7 +78,7 @@ void handle_connection(int connfd)
|
||||
response.file.arg = directory;
|
||||
}
|
||||
|
||||
if (!pb_encode(&output, ListFilesResponse_fields, &response))
|
||||
if (!pb_encode(&output, ListFilesResponse_msg, &response))
|
||||
{
|
||||
printf("Encoding failed.\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user