Skip to content
This repository
Browse code

Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
	bufferevent_openssl.c
  • Loading branch information...
commit cda69d0df00b8ee28755731b225123d10a999acc 2 parents f2050e7 + 1ff2c24
Nick Mathewson authored

Showing 2 changed files with 12 additions and 4 deletions. Show diff stats Hide diff stats

  1. +6 4 bufferevent_openssl.c
  2. +6 0 bufferevent_sock.c
10 bufferevent_openssl.c
@@ -934,11 +934,12 @@ be_openssl_readeventcb(evutil_socket_t fd, short what, void *ptr)
934 934 {
935 935 struct bufferevent_openssl *bev_ssl = ptr;
936 936 bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
937   - if (what & EV_TIMEOUT) {
  937 + if (what == EV_TIMEOUT) {
938 938 bufferevent_run_eventcb_(&bev_ssl->bev.bev,
939 939 BEV_EVENT_TIMEOUT|BEV_EVENT_READING);
940   - } else
  940 + } else {
941 941 consider_reading(bev_ssl);
  942 + }
942 943 bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
943 944 }
944 945
@@ -947,11 +948,12 @@ be_openssl_writeeventcb(evutil_socket_t fd, short what, void *ptr)
947 948 {
948 949 struct bufferevent_openssl *bev_ssl = ptr;
949 950 bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
950   - if (what & EV_TIMEOUT) {
  951 + if (what == EV_TIMEOUT) {
951 952 bufferevent_run_eventcb_(&bev_ssl->bev.bev,
952 953 BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING);
  954 + } else {
  955 + consider_writing(bev_ssl);
953 956 }
954   - consider_writing(bev_ssl);
955 957 bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
956 958 }
957 959
6 bufferevent_sock.c
@@ -134,6 +134,9 @@ bufferevent_readcb(evutil_socket_t fd, short event, void *arg)
134 134 bufferevent_incref_and_lock_(bufev);
135 135
136 136 if (event == EV_TIMEOUT) {
  137 + /* Note that we only check for event==EV_TIMEOUT. If
  138 + * event==EV_TIMEOUT|EV_READ, we can safely ignore the
  139 + * timeout, since a read has occurred */
137 140 what |= BEV_EVENT_TIMEOUT;
138 141 goto error;
139 142 }
@@ -210,6 +213,9 @@ bufferevent_writecb(evutil_socket_t fd, short event, void *arg)
210 213 bufferevent_incref_and_lock_(bufev);
211 214
212 215 if (event == EV_TIMEOUT) {
  216 + /* Note that we only check for event==EV_TIMEOUT. If
  217 + * event==EV_TIMEOUT|EV_WRITE, we can safely ignore the
  218 + * timeout, since a read has occurred */
213 219 what |= BEV_EVENT_TIMEOUT;
214 220 goto error;
215 221 }

0 comments on commit cda69d0

Please sign in to comment.
Something went wrong with that request. Please try again.