| 7619 | void *payload = malloc(bytes); |
| 7620 | if (!payload) { |
| 7621 | dist_discard_bytes(upstream->fd, bytes); |
| 7622 | return dist_worker_upstream_send_work_error(upstream, 0, "out of memory reading distributed WORK frame"); |
| 7623 | } |
| 7624 | int rc = dist_read_full(upstream->fd, payload, bytes); |
| 7625 | if (rc <= 0) { |
| 7626 | free(payload); |
| 7627 | return rc == 0 ? 0 : -1; |
| 7628 | } |
| 7629 | rc = dist_worker_process_work_payload(state, upstream, payload, bytes); |
| 7630 | free(payload); |
| 7631 | return rc; |
| 7632 | } |
| 7633 | |
| 7634 | /* ========================================================================= |
| 7635 | * Worker Prefetch Queue |
no test coverage detected