cliffjansen commented on code in PR #402:
URL: https://github.com/apache/qpid-proton/pull/402#discussion_r1320280088


##########
c/src/proactor/epoll_raw_connection.c:
##########
@@ -408,32 +415,41 @@ pn_event_batch_t *pni_raw_connection_process(task_t *t, 
uint32_t io_events, bool
   }
   unlock(&rc->task.mutex);
 
-  if (events & EPOLLIN) pni_raw_read(&rc->raw_connection, fd, rcv, set_error);
-  if (events & EPOLLOUT) pni_raw_write(&rc->raw_connection, fd, snd, 
set_error);
-  rc->batch_empty = false;
+  if (rc->connected) {

Review Comment:
   done



##########
c/src/proactor/epoll_raw_connection.c:
##########
@@ -408,32 +415,41 @@ pn_event_batch_t *pni_raw_connection_process(task_t *t, 
uint32_t io_events, bool
   }
   unlock(&rc->task.mutex);
 
-  if (events & EPOLLIN) pni_raw_read(&rc->raw_connection, fd, rcv, set_error);
-  if (events & EPOLLOUT) pni_raw_write(&rc->raw_connection, fd, snd, 
set_error);
-  rc->batch_empty = false;
+  if (rc->connected) {
+    if (events & EPOLLERR) {
+      // Read and write sides closed via RST.  Tear down immediately.
+      int soerr;
+      socklen_t soerrlen = sizeof(soerr);
+      int ec = getsockopt(fd, SOL_SOCKET, SO_ERROR, &soerr, &soerrlen);
+      if (ec == 0 && soerr) {
+        psocket_error(rc, soerr, "async disconnect");
+      }
+      pni_raw_async_disconnect(&rc->raw_connection);
+    } else if (events & EPOLLHUP) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to