Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit be7654b

Browse files
committed
remove the unused struct hyper_event_ops::len_offset
Signed-off-by: Lai Jiangshan <[email protected]>
1 parent 1cf932a commit be7654b

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/event.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ struct hyper_event_ops {
1212
void (*hup)(struct hyper_event *e, int efd);
1313
int rbuf_size;
1414
int wbuf_size;
15-
int len_offset;
1615
};
1716

1817
struct hyper_buf {

src/init.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,17 +1037,6 @@ static int hyper_ttyfd_handle(struct hyper_event *de, uint32_t len)
10371037
return 0;
10381038
}
10391039

1040-
static int hyper_getmsg_len(struct hyper_event *he, uint32_t *len)
1041-
{
1042-
struct hyper_buf *buf = &he->rbuf;
1043-
1044-
if (buf->get < he->ops->len_offset + 4)
1045-
return -1;
1046-
1047-
*len = hyper_get_be32(buf->data + he->ops->len_offset);
1048-
return 0;
1049-
}
1050-
10511040
static int hyper_ttyfd_read(struct hyper_event *he, int efd)
10521041
{
10531042
struct hyper_buf *buf = &he->rbuf;
@@ -1235,15 +1224,13 @@ static int hyper_channel_read(struct hyper_event *he, int efd)
12351224
static struct hyper_event_ops hyper_channel_ops = {
12361225
.read = hyper_channel_read,
12371226
.rbuf_size = 10240,
1238-
.len_offset = 4,
12391227
};
12401228

12411229
static struct hyper_event_ops hyper_ttyfd_ops = {
12421230
.read = hyper_ttyfd_read,
12431231
.write = hyper_event_write,
12441232
.rbuf_size = 4096,
12451233
.wbuf_size = 10240,
1246-
.len_offset = 8,
12471234
};
12481235

12491236
static int hyper_loop(void)

0 commit comments

Comments
 (0)