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


##########
c/src/proactor/epoll_raw_connection.c:
##########
@@ -442,24 +458,31 @@ void pni_raw_connection_done(praw_connection_t *rc) {
   // The task may be in the ready state even if we've got no raw connection
   // wakes outstanding because we dealt with it already in pni_raw_batch_next()
   notify = (pni_task_wake_pending(&rc->task) || have_event) && 
schedule(&rc->task);
-  ready = rc->task.ready;
+  ready = rc->task.ready;  // No need to poll.  Already scheduled.
   unlock(&rc->task.mutex);
 
-  pn_raw_connection_t *raw = &rc->raw_connection;
-  int fd = rc->psocket.epoll_io.fd;
-  pni_raw_process_shutdown(raw, fd, shutr, shutw);
-  int wanted =
-    (pni_raw_can_read(raw)  ? EPOLLIN : 0) |
-    (pni_raw_can_write(raw) ? EPOLLOUT : 0);
-  if (wanted) {
-    rc->psocket.epoll_io.wanted = wanted;
-    rearm_polling(&rc->psocket.epoll_io, p->epollfd);  // TODO: check for error
+  bool finished_disconnect = raw->state==conn_fini && !ready && 
!raw->disconnectpending;
+  if (finished_disconnect) {
+    // If we're closed and we've sent the disconnect then close
+    pni_raw_finalize(raw);
+    praw_connection_cleanup(rc);
+  } else if (ready) {
+    // Already scheduled to run.  Skip poll.  Remember if we want a read.
+    rc->read_check = pni_raw_can_read(raw);
+  } else if (!rc->connected) {
+    // Connect logic has already armed the socket.
   } else {
-    bool finished_disconnect = raw->state==conn_fini && !ready && 
!raw->disconnectpending;
-    if (finished_disconnect) {
-      // If we're closed and we've sent the disconnect then close
-      pni_raw_finalize(raw);
-      praw_connection_cleanup(rc);
+    // Must poll for iO.

Review Comment:
   fixed



-- 
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