| 1278 | } |
| 1279 | |
| 1280 | void OnReceiveMessage() { |
| 1281 | DBGOUT("OnReceiveMessage()"); |
| 1282 | const TBaseHeader& hdr = Msg_.BaseHeader(); |
| 1283 | |
| 1284 | if (hdr.Type == TBaseHeader::Request) { |
| 1285 | TRequest* reqPtr = new TRequest(TConnectionRef(this), Msg_.Header(), Msg_.Content()); |
| 1286 | IRequestRef req(reqPtr); |
| 1287 | ReqsState_[reqPtr->RequestHeader().Id] = reqPtr->State; |
| 1288 | OnRequest(req); |
| 1289 | } else if (hdr.Type == TBaseHeader::Cancel) { |
| 1290 | OnCancelRequest(hdr.Id); |
| 1291 | } else { |
| 1292 | throw yexception() << "unsupported message type: " << (ui32)hdr.Type; |
| 1293 | } |
| 1294 | Msg_.Clear(); |
| 1295 | { |
| 1296 | TRequestId reqId; |
| 1297 | while (FinReqs_.Dequeue(&reqId)) { |
| 1298 | ReqsState_.erase(reqId); |
| 1299 | } |
| 1300 | } |
| 1301 | } |
| 1302 | |
| 1303 | void OnRequest(IRequestRef& r) { |
| 1304 | DBGOUT("OnRequest()"); |
nothing calls this directly
no test coverage detected