mirror of
https://github.com/schoebel/mars
synced 2025-03-11 07:47:41 +00:00
infra: also send prot level over dents
This commit is contained in:
parent
e02bd88349
commit
3afad273fd
@ -89,6 +89,7 @@ extern char *my_id(void);
|
||||
int d_version; /* dynamic programming per call of mars_ent_work() */ \
|
||||
int d_child_count; \
|
||||
int d_hash; \
|
||||
int d_proto; \
|
||||
char d_once_error; \
|
||||
bool d_killme; \
|
||||
bool d_use_channel; \
|
||||
|
@ -98,6 +98,7 @@ const struct meta mars_dent_meta[] = {
|
||||
META_INI(d_serial, struct mars_dent, FIELD_INT),
|
||||
META_INI(d_corr_A, struct mars_dent, FIELD_INT),
|
||||
META_INI(d_corr_B, struct mars_dent, FIELD_INT),
|
||||
META_INI(d_proto, struct mars_dent, FIELD_INT),
|
||||
META_INI_SUB(new_stat,struct mars_dent, mars_kstat_meta),
|
||||
META_INI_SUB(old_stat,struct mars_dent, mars_kstat_meta),
|
||||
META_INI(new_link, struct mars_dent, FIELD_STRING),
|
||||
|
@ -71,8 +71,10 @@ int mars_send_dent_list(struct mars_socket *sock, struct list_head *anchor)
|
||||
struct list_head *tmp;
|
||||
struct mars_dent *dent;
|
||||
int status = 0;
|
||||
|
||||
for (tmp = anchor->next; tmp != anchor; tmp = tmp->next) {
|
||||
dent = container_of(tmp, struct mars_dent, dent_link);
|
||||
dent->d_proto = MARS_PROTO_LEVEL;
|
||||
status = mars_send_struct(sock, dent, mars_dent_meta, true);
|
||||
if (status < 0)
|
||||
break;
|
||||
@ -104,6 +106,10 @@ int mars_recv_dent_list(struct mars_socket *sock, struct list_head *anchor)
|
||||
mars_free_dent(NULL, dent);
|
||||
goto done;
|
||||
}
|
||||
if (dent->d_proto >= 2) {
|
||||
sock->s_remote_proto_level = dent->d_proto;
|
||||
sock->s_common_proto_level = min(dent->d_proto, MARS_PROTO_LEVEL);
|
||||
}
|
||||
list_add_tail(&dent->dent_link, anchor);
|
||||
}
|
||||
done:
|
||||
|
Loading…
Reference in New Issue
Block a user