Skip to content

Commit

Permalink
Use newer curl socket constants
Browse files Browse the repository at this point in the history
These are the same values as the old CURL_POLL defines, but make it more
comfortable/convincing to write this as simple bit operations to
calculate the right action passed to curl_multi_socket_action.
  • Loading branch information
falconindy committed Aug 17, 2024
1 parent f336d0f commit f37305b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/aur/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,12 @@ int ClientImpl::OnCurlIO(sd_event_source*, int fd, uint32_t revents,
void* userdata) {
auto* aur = static_cast<ClientImpl*>(userdata);

int action;
if ((revents & (EPOLLIN | EPOLLOUT)) == (EPOLLIN | EPOLLOUT)) {
action = CURL_POLL_INOUT;
} else if (revents & EPOLLIN) {
action = CURL_POLL_IN;
} else if (revents & EPOLLOUT) {
action = CURL_POLL_OUT;
} else {
action = 0;
int action = 0;
if (revents & EPOLLIN) {
action |= CURL_CSELECT_IN;
}
if (revents & EPOLLOUT) {
action |= CURL_CSELECT_OUT;
}

int unused;
Expand Down

0 comments on commit f37305b

Please sign in to comment.