mirror of https://github.com/yandex/odyssey.git
soprano: remake fe ready reader to parse header
This commit is contained in:
parent
2ef1bed4ad
commit
eb8a2bb1f3
|
@ -14,12 +14,18 @@
|
||||||
#include <so_macro.h>
|
#include <so_macro.h>
|
||||||
#include <so_stream.h>
|
#include <so_stream.h>
|
||||||
#include <so_header.h>
|
#include <so_header.h>
|
||||||
|
#include <so_read.h>
|
||||||
#include <so_feread.h>
|
#include <so_feread.h>
|
||||||
|
|
||||||
int so_feread_ready(uint8_t *data, uint32_t size, int *status)
|
int so_feread_ready(uint8_t *data, uint32_t size, int *status)
|
||||||
{
|
{
|
||||||
if (so_unlikely(size != 1))
|
soheader_t *header = (soheader_t*)data;
|
||||||
|
uint32_t len;
|
||||||
|
int rc = so_read(&len, &data, &size);
|
||||||
|
if (rc != 0)
|
||||||
return -1;
|
return -1;
|
||||||
*status = data[0];
|
if (len != 1)
|
||||||
|
return -1;
|
||||||
|
*status = header->data[0];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue