libcli/smb/smb_direct.c needed? post individual items
authorStefan Metzmacher <metze@samba.org>
Fri, 30 Sep 2016 00:56:56 +0000 (02:56 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2018 12:35:09 +0000 (14:35 +0200)
libcli/smb/smb_direct.c

index f4b2d36d2c1fe86edefd8124a140b046cd815a89..b54044b0e570d1fdff0cfbba93d7a6cac5cc5547 100644 (file)
@@ -589,18 +589,14 @@ DEBUG(0,("%s:%s: TODO: REMOVE me ...here...\n", __location__, __func__));
                } else {
                        io->send_wr.next = NULL;
                }
+                       io->send_wr.next = NULL;
                DLIST_REMOVE(c->s2r.ready, io);
                DLIST_ADD_END(posted, io);
                DEBUG(0,("%s:%s: POST SEND[%p] data_length[%u] remaining_length[%u]\n",
                        __location__, __FUNCTION__, io,
                        (unsigned)io->data_length, (unsigned)io->remaining_length));
-       }
-
-       last = DLIST_TAIL(posted);
-       last->send_wr.next = NULL;
-
        errno = 0;
-       ret = ibv_post_send(c->ibv.qp, &posted->send_wr, &bad_send_wr);
+       ret = ibv_post_send(c->ibv.qp, &io->send_wr, &bad_send_wr);
        if (ret != 0) {
                NTSTATUS status;
        //      DLIST_CONCATENATE(c->s2r.ready, posted); // TODO: check bad_send_wr
@@ -609,6 +605,21 @@ DEBUG(0,("%s:%s: TODO: REMOVE me ...here...\n", __location__, __func__));
                        __location__, __FUNCTION__, ret, errno, nt_errstr(status)));
                return ret;
        }
+       }
+
+       last = DLIST_TAIL(posted);
+       last->send_wr.next = NULL;
+
+       //errno = 0;
+       //ret = ibv_post_send(c->ibv.qp, &posted->send_wr, &bad_send_wr);
+       //if (ret != 0) {
+       //      NTSTATUS status;
+       ////    DLIST_CONCATENATE(c->s2r.ready, posted); // TODO: check bad_send_wr
+       //      status = map_nt_error_from_unix_common(errno);
+       //      DEBUG(0,("%s:%s: ret[%d] errno[%d] status[%s]\n",
+       //              __location__, __FUNCTION__, ret, errno, nt_errstr(status)));
+       //      return ret;
+       //}
 
        DLIST_CONCATENATE(c->s2r.posted, posted);