Skip to content

Commit

Permalink
soccr: Log name of socket queue that failed to restore.
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Mirosław <[email protected]>
  • Loading branch information
osctobe authored and avagin committed Jul 7, 2023
1 parent 13c08b8 commit dc3f4b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions soccr/soccr.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ int libsoccr_restore(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsi
return 0;
}

static int __send_queue(struct libsoccr_sk *sk, int queue, char *buf, __u32 len)
static int __send_queue(struct libsoccr_sk *sk, const char *queue, char *buf, __u32 len)
{
int ret, err = -1, max_chunk;
int off;
Expand Down Expand Up @@ -816,7 +816,7 @@ static int __send_queue(struct libsoccr_sk *sk, int queue, char *buf, __u32 len)
continue;
}

logerr("Can't restore %d queue data (%d), want (%d-%d:%d:%d)", queue, ret, off, chunk, len, max_chunk);
logerr("Can't restore %s queue data (%d), want (%d-%d:%d:%d)", queue, ret, off, chunk, len, max_chunk);
goto err;
}
off += ret;
Expand All @@ -837,7 +837,7 @@ static int send_queue(struct libsoccr_sk *sk, int queue, char *buf, __u32 len)
return -1;
}

return __send_queue(sk, queue, buf, len);
return __send_queue(sk, queue == TCP_RECV_QUEUE ? "recv" : "send", buf, len);
}

static int libsoccr_restore_queue(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size, int queue,
Expand Down Expand Up @@ -876,7 +876,7 @@ static int libsoccr_restore_queue(struct libsoccr_sk *sk, struct libsoccr_sk_dat
* they can be restored without any tricks.
*/
tcp_repair_off(sk->fd);
if (__send_queue(sk, TCP_SEND_QUEUE, buf + len, ulen))
if (__send_queue(sk, "not-sent send", buf + len, ulen))
return -3;
if (tcp_repair_on(sk->fd))
return -4;
Expand Down

0 comments on commit dc3f4b5

Please sign in to comment.