Internally, several bytes will be read at once and the notification
should be detected earlier. This fixes a regression introduced in
5aeda65433fd41b7bb67f908d8c4741f045ce508 because we relied on datagram
boundary semantics. This was not important when pulling information
but we still used this semantic when pushing information. Closes: #43.
int
lldpctl_watch(lldpctl_conn_t *conn)
{
- int rc;
- size_t much;
+ int rc = 0;
RESET_ERROR(conn);
return SET_ERROR(conn, LLDPCTL_ERR_INVALID_STATE);
conn->watch_triggered = 0;
- much = 512;
while (!conn->watch_triggered) {
- rc = _lldpctl_needs(conn, much);
- much += 512;
+ rc = _lldpctl_needs(conn, 1);
if (rc < 0)
return SET_ERROR(conn, rc);
}
return nb;
}
-/* Statiscally receive data from remote end. */
+/* Statically receive data from remote end. */
static ssize_t
sync_recv(lldpctl_conn_t *lldpctl,
const uint8_t *data, size_t length, void *user_data)