zhangmeng
2021-12-21 e9984ced808cdd0be956630e25a431853c91e478
src/req_rep.cpp
@@ -85,10 +85,11 @@
    string msg{(const char*)nng_msg_body(om), nng_msg_len(om)};
    nng_msg_free(om);
    auto t = (*rep)();
    lock_guard<mutex> l{rep->mtx_msg_};
    rep->works_.emplace(rep->work_index_, w);
    rep->msg_.emplace(rep->work_index_, move(msg));
    rep->work_index_++;
    rep->works_.emplace(get<0>(t), w);
    get<1>(t).emplace(get<0>(t), move(msg));
    get<0>(t)++;
    rep->cv_msg_.notify_all();
}
@@ -124,7 +125,7 @@
        return rv;
    }
    work** works = (work**)malloc(sizeof(work*) * count);
    work** works = (work**)malloc(sizeof(void*) * count);
    for (int i = 0; i < count; i++) {
        works[i] = alloc_work(*sock, rep);
    }