Skip to content

Commit dde05f4

Browse files
committed
libs/resea: Fix for error messages
1 parent a3d8b0c commit dde05f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libs/resea/ipc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ static void *bulk_ptr = NULL;
99
static const size_t bulk_len = CONFIG_BULK_BUFFER_LEN;
1010

1111
static unsigned pre_send(struct message *m) {
12-
if (m->type & MSG_STR) {
13-
m->bulk_len = strlen(m->bulk_ptr) + 1;
14-
}
15-
1612
unsigned flags = 0;
17-
if (m->type & MSG_BULK) {
13+
if (!IS_ERROR(m->type) && m->type & MSG_BULK) {
1814
flags |= IPC_BULK;
15+
16+
if (m->type & MSG_STR) {
17+
m->bulk_len = strlen(m->bulk_ptr) + 1;
18+
}
1919
}
2020

2121
return flags;
2222
}
2323

2424
static error_t post_recv(error_t err, struct message *m) {
25-
if (m->type & MSG_BULK) {
25+
if (!IS_ERROR(m->type) && m->type & MSG_BULK) {
2626
// Received a bulk payload. We've consumed `bulk_ptr` so set NULL to it
2727
// and reallocate the receiver buffer later.
2828
bulk_ptr = NULL;

0 commit comments

Comments
 (0)