odissey: set client readahead

This commit is contained in:
Dmitry Simonenko 2017-05-30 14:17:35 +03:00
parent c13c4d0e11
commit cf823e87ee
2 changed files with 9 additions and 1 deletions

View File

@ -84,11 +84,13 @@ int od_cancel(od_instance_t *instance,
machine_io_free(io);
return -1;
}
#if 0
rc = machine_set_readahead(io, instance->scheme.readahead);
if (rc == -1) {
od_error(&instance->log, NULL, "(cancel) failed to set readahead");
return -1;
}
#endif
so_stream_t stream;
so_stream_init(&stream);

View File

@ -363,6 +363,13 @@ void od_frontend(void *arg)
od_client_free(client);
return;
}
rc = machine_set_readahead(client->io, instance->scheme.readahead);
if (rc == -1) {
od_error(&instance->log, client->io, "failed to set client readahead");
machine_close(client->io);
od_client_free(client);
return;
}
/* client startup */
rc = od_frontend_startup(client);
@ -380,7 +387,6 @@ void od_frontend(void *arg)
od_frontend_close(client);
od_cancel(relay, &key);
#endif
od_frontend_close(client);
return;
}