Skip to content

Commit 804c0ba

Browse files
osctobeavagin
authored andcommitted
soccr: Log name of socket queue that failed to restore.
Signed-off-by: Michał Mirosław <[email protected]>
1 parent 4018b78 commit 804c0ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

soccr/soccr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ int libsoccr_restore(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsi
781781
return 0;
782782
}
783783

784-
static int __send_queue(struct libsoccr_sk *sk, int queue, char *buf, __u32 len)
784+
static int __send_queue(struct libsoccr_sk *sk, const char *queue, char *buf, __u32 len)
785785
{
786786
int ret, err = -1, max_chunk;
787787
int off;
@@ -816,7 +816,7 @@ static int __send_queue(struct libsoccr_sk *sk, int queue, char *buf, __u32 len)
816816
continue;
817817
}
818818

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

840-
return __send_queue(sk, queue, buf, len);
840+
return __send_queue(sk, queue == TCP_RECV_QUEUE ? "recv" : "send", buf, len);
841841
}
842842

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

0 commit comments

Comments
 (0)