Don't need that
This commit is contained in:
parent
cf827d8028
commit
3c947568ff
2 changed files with 0 additions and 58 deletions
29
src/link.c
29
src/link.c
|
@ -134,35 +134,6 @@ error_toobig:
|
|||
return -1;
|
||||
}
|
||||
|
||||
int skipstone_link_send_message(skipstone_link *link,
|
||||
skipstone_message *message, uint16_t id) {
|
||||
void *buf;
|
||||
uint16_t size = skipstone_message_size(message);
|
||||
|
||||
if ((buf = malloc(size)) == NULL) {
|
||||
goto error_malloc_size;
|
||||
}
|
||||
|
||||
if (skipstone_message_pack(message, buf) < 0) {
|
||||
goto error_message_pack;
|
||||
}
|
||||
|
||||
if (skipstone_link_send(link, buf, size, id) < 0) {
|
||||
goto error_link_send;
|
||||
}
|
||||
|
||||
free(buf);
|
||||
|
||||
return 0;
|
||||
|
||||
error_link_send:
|
||||
error_message_pack:
|
||||
free(buf);
|
||||
|
||||
error_malloc_size:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int skipstone_link_recv(skipstone_link *link, void *buf, uint16_t *size, uint16_t *id) {
|
||||
skipstone_message_header header;
|
||||
|
||||
|
|
29
src/link.c-e
29
src/link.c-e
|
@ -134,35 +134,6 @@ error_toobig:
|
|||
return -1;
|
||||
}
|
||||
|
||||
int skipstone_link_send_message(skipstone_link *link,
|
||||
skipstone_message *message, uint16_t id) {
|
||||
void *buf;
|
||||
uint16_t size = skipstone_message_size(message);
|
||||
|
||||
if ((buf = malloc(size)) == NULL) {
|
||||
goto error_malloc_size;
|
||||
}
|
||||
|
||||
if (skipstone_message_pack(message, buf) < 0) {
|
||||
goto error_message_pack;
|
||||
}
|
||||
|
||||
if (skipstone_link_send(link, buf, size, id) < 0) {
|
||||
goto error_link_send;
|
||||
}
|
||||
|
||||
free(buf);
|
||||
|
||||
return 0;
|
||||
|
||||
error_link_send:
|
||||
error_message_pack:
|
||||
free(buf);
|
||||
|
||||
error_malloc_size:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int skipstone_link_recv(skipstone_link *link, void *buf, uint16_t *size, uint16_t *id) {
|
||||
skipstone_message_header header;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue