add reading and writing into netstat

This commit is contained in:
Cloud Wu
2020-10-16 13:06:01 +08:00
parent bae00163b2
commit 1dfddc0d84
3 changed files with 8 additions and 0 deletions

View File

@@ -18,6 +18,8 @@ struct socket_info {
uint64_t rtime;
uint64_t wtime;
int64_t wbuffer;
uint8_t reading;
uint8_t writing;
char name[128];
struct socket_info *next;
};

View File

@@ -2185,6 +2185,8 @@ query_info(struct socket *s, struct socket_info *si) {
si->rtime = s->stat.rtime;
si->wtime = s->stat.wtime;
si->wbuffer = s->wb_size;
si->reading = s->reading;
si->writing = s->writing;
return 1;
}