mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 05:37:57 +00:00
Don't attempt to read unless the descriptor is ready
This commit is contained in:
parent
ceb3c17b70
commit
96f6453a43
@ -1482,12 +1482,16 @@ void rhizome_fetch_poll(struct sched_ent *alarm)
|
||||
{
|
||||
struct rhizome_fetch_slot *slot = (struct rhizome_fetch_slot *) alarm;
|
||||
|
||||
if (alarm->poll.revents & (POLLIN | POLLOUT)) {
|
||||
if (alarm->poll.revents & POLLOUT) {
|
||||
switch (slot->state) {
|
||||
case RHIZOME_FETCH_CONNECTING:
|
||||
case RHIZOME_FETCH_SENDINGHTTPREQUEST:
|
||||
rhizome_fetch_write(slot);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (alarm->poll.revents & POLLIN) {
|
||||
switch (slot->state) {
|
||||
case RHIZOME_FETCH_RXFILE: {
|
||||
/* Keep reading until we have the promised amount of data */
|
||||
char buffer[8192];
|
||||
|
Loading…
Reference in New Issue
Block a user