This is called from the GCodes task to store a response, which is picked up by the Network task static*/
| 1523 | |
| 1524 | // This is called from the GCodes task to store a response, which is picked up by the Network task |
| 1525 | /*static*/ void HttpResponder::HandleGCodeReply(const char *_ecv_array reply) noexcept |
| 1526 | { |
| 1527 | if (numSessions > 0) |
| 1528 | { |
| 1529 | MutexLocker lock(gcodeReplyMutex); |
| 1530 | |
| 1531 | OutputBuffer *_ecv_null buffer = gcodeReply.GetLastItem(); |
| 1532 | if (buffer == nullptr || buffer->IsReferenced()) |
| 1533 | { |
| 1534 | if (!OutputBuffer::Allocate(buffer, false)) |
| 1535 | { |
| 1536 | // No more space available, stop here |
| 1537 | return; |
| 1538 | } |
| 1539 | if (!gcodeReply.Push(buffer)) |
| 1540 | { |
| 1541 | // Can't push, so buffer was discarded. Don't append to it. |
| 1542 | return; |
| 1543 | } |
| 1544 | } |
| 1545 | |
| 1546 | buffer->cat(reply); |
| 1547 | clientsServed = 0; |
| 1548 | seq++; |
| 1549 | } |
| 1550 | } |
| 1551 | |
| 1552 | /*static*/ void HttpResponder::HandleGCodeReply(OutputBuffer *_ecv_null reply) noexcept |
| 1553 | { |
nothing calls this directly
no test coverage detected