ZERO_STRUCTP(raddr);
}
- if (tevent_req_is_nterror(req, &status)) {
- DEBUG(0,("%s:%s: here...[%s]\n", __location__, __func__, nt_errstr(status)));
- tevent_req_received(req);
- return status;
- }
+ if (tevent_req_is_in_progress(req)) {
+ /*
+ * We don't call tevent_req_received()
+ * because the caller can leave this alive
+ * in order to consume more connections
+ */
+ if (l->ready == NULL) {
+ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+ return NT_STATUS_NO_MORE_ENTRIES;
+ }
- /*
- * We don't call tevent_req_received()
- * because the caller can leave this alive
- * in order to consume more connections
- */
- if (l->ready == NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
- return NT_STATUS_NO_MORE_ENTRIES;
- }
+ c = l->ready;
+ DLIST_REMOVE(l->ready, c);
+ c->l = NULL;
- c = l->ready;
- DLIST_REMOVE(l->ready, c);
- c->l = NULL;
+ if (l->ready != NULL) {
+ tevent_req_defer_callback(req, state->ev);
+ tevent_req_notify_callback(req);
+ }
- if (l->ready != NULL) {
- tevent_req_defer_callback(req, state->ev);
- tevent_req_notify_callback(req);
+ *fd = c->sock.tmp_fd;
+ c->sock.tmp_fd = -1;
+ if (laddr != NULL) {
+ ZERO_STRUCTP(laddr);
+ }
+ if (raddr != NULL) {
+ ZERO_STRUCTP(raddr);
+ }
+ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+ *_c = talloc_move(mem_ctx, &c);
+ return NT_STATUS_OK;
}
- *fd = c->sock.tmp_fd;
- c->sock.tmp_fd = -1;
- if (laddr != NULL) {
- ZERO_STRUCTP(laddr);
- }
- if (raddr != NULL) {
- ZERO_STRUCTP(raddr);
+ if (tevent_req_is_nterror(req, &status)) {
+ DEBUG(0,("%s:%s: here...[%s] %s\n", __location__, __func__, nt_errstr(status),
+ tevent_req_print(req, req)));
+ tevent_req_received(req);
+ return status;
}
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
- *_c = talloc_move(mem_ctx, &c);
- return NT_STATUS_OK;
+ /* should never be reached */
+ DEBUG(0,("%s:%s: here...[%s] %s\n", __location__, __func__, nt_errstr(status),
+ tevent_req_print(req, req)));
+ tevent_req_received(req);
+ return NT_STATUS_INTERNAL_ERROR;
}
#endif /* SMB_TRANSPORT_ENABLE_RDMA */