Browse Source

fix wrong operator to check for set bit in events

personal/stbuehler/wip
Stefan Bühler 8 years ago
parent
commit
21e18176f2
  1. 4
      src/common/angel_connection.c
  2. 4
      src/common/memcached.c

4
src/common/angel_connection.c

@ -291,7 +291,7 @@ static gboolean angel_connection_read(liAngelConnection *acon, GError **err) {
static void angel_connection_io_cb(liEventBase *watcher, int events) {
liAngelConnection *acon = LI_CONTAINER_OF(li_event_io_from(watcher), liAngelConnection, fd_watcher);
if (events | LI_EV_WRITE) {
if (events & LI_EV_WRITE) {
GString *out_str;
int i;
ssize_t written, len;
@ -368,7 +368,7 @@ write_eagain:
if (out_queue_empty) li_event_io_rem_events(&acon->fd_watcher, LI_EV_WRITE);
}
if (events | LI_EV_READ) {
if (events & LI_EV_READ) {
GError *err = NULL;
if (!angel_connection_read(acon, &err)) {
li_event_clear(&acon->out_notify_watcher);

4
src/common/memcached.c

@ -737,7 +737,7 @@ static void memcached_io_cb(liEventBase *watcher, int events) {
li_memcached_con_acquire(con); /* make sure con isn't freed in the middle of something */
if (events | LI_EV_WRITE) {
if (events & LI_EV_WRITE) {
int i;
ssize_t written, len;
gchar *data;
@ -781,7 +781,7 @@ write_eagain:
send_queue_clean(&con->out);
}
if (events | LI_EV_READ) {
if (events & LI_EV_READ) {
do {
handle_read(con);
} while (con->remaining && con->remaining->used > 0);

Loading…
Cancel
Save