diff --git a/proto/protocol.xml b/proto/protocol.xml
index 1c01c90..f18d8e8 100644
--- a/proto/protocol.xml
+++ b/proto/protocol.xml
@@ -337,6 +337,17 @@
+
+
+
+ Notification that an object ID used in a prior request was
+ invalid and does not exist.
+
+ This event is sent by the EIS implementation when an object that
+ does not exist as seen by the EIS implementation.
+
+
+
diff --git a/src/brei-shared.c b/src/brei-shared.c
index 10aad0c..e0bb8e2 100644
--- a/src/brei-shared.c
+++ b/src/brei-shared.c
@@ -291,6 +291,10 @@ brei_dispatch(struct brei_context *brei,
/* Find the object, it is stored in the ei/eis context */
struct brei_object *object = NULL;
rc = lookup_object(object_id, &object, user_data);
+ if (rc == -ENOENT) {
+ iobuf_pop(buf, msglen);
+ continue;
+ }
if (rc < 0)
goto error;
diff --git a/src/libei.c b/src/libei.c
index a83b5c8..aced119 100644
--- a/src/libei.c
+++ b/src/libei.c
@@ -647,7 +647,8 @@ ei_connected(struct ei *ei)
}
}
-static int handle_msg_disconnected(struct ei_connection *connection, uint32_t reason, const char *explanation)
+static int
+handle_msg_disconnected(struct ei_connection *connection, uint32_t reason, const char *explanation)
{
struct ei *ei = ei_connection_get_context(connection);
@@ -659,6 +660,16 @@ static int handle_msg_disconnected(struct ei_connection *connection, uint32_t re
return -ECANCELED;
}
+static int
+handle_msg_invalid_object(struct ei_connection *connection, uint32_t object)
+{
+ struct ei *ei = ei_connection_get_context(connection);
+
+ log_bug(ei, "Invalid object %#x, I don't yet know how to handle that", object);
+
+ return 0;
+}
+
#define DISCONNECT_IF_SENDER_CONTEXT(ei_) do {\
if (ei_->is_sender) { \
log_bug_client(ei_, "Invalid event from receiver EIS context. Disconnecting"); \
@@ -669,6 +680,7 @@ static int handle_msg_disconnected(struct ei_connection *connection, uint32_t re
static const struct ei_connection_interface interface = {
.disconnected = handle_msg_disconnected,
.seat = handle_msg_seat,
+ .invalid_object = handle_msg_invalid_object,
};
const struct ei_connection_interface *
diff --git a/src/libeis-client.c b/src/libeis-client.c
index 20f3322..3633610 100644
--- a/src/libeis-client.c
+++ b/src/libeis-client.c
@@ -321,6 +321,8 @@ lookup_object(uint32_t object_id, struct brei_object **object, void *userdata)
}
log_debug(eis_client_get_context(client), "Failed to find object %#x", object_id);
+ if (client->connection)
+ eis_connection_event_invalid_object(client->connection, object_id);
return -ENOENT;
}