- ofpbuf_prealloc_tailroom(&conn->in, 128);
- error = read_fully(conn->fd, ofpbuf_tail(&conn->in),
- ofpbuf_tailroom(&conn->in), &bytes_read);
- conn->in.size += bytes_read;
- if (conn->in.size > 65536) {
- VLOG_WARN_RL(&rl, "excess command length, killing connection");
- return EPROTO;
- }
- if (error) {
- if (error == EAGAIN || error == EWOULDBLOCK) {
- if (!bytes_read) {
- return EAGAIN;
- }
- } else {
- if (error != EOF || conn->in.size != 0) {
- VLOG_WARN_RL(&rl, "read failed: %s",
- (error == EOF
- ? "connection dropped mid-command"
- : strerror(error)));
- }
- return error;
- }
+ if (!error) {
+ command->cb(conn, argv.n, (const char **) argv.names,
+ command->aux);