Called to process a FileInfo request, which may take several calls Return true if complete
| 733 | // Called to process a FileInfo request, which may take several calls |
| 734 | // Return true if complete |
| 735 | bool HttpResponder::SendFileInfo(bool quitEarly) noexcept |
| 736 | { |
| 737 | OutputBuffer *_ecv_null jsonResponse = nullptr; |
| 738 | bool gotFileInfo = (reprap.GetFileInfoResponse(nullptr, filenameBeingProcessed.c_str(), jsonResponse, quitEarly) != GCodeResult::notFinished); |
| 739 | if (gotFileInfo) |
| 740 | { |
| 741 | // Got it - send the response now |
| 742 | outBuf->copy( "HTTP/1.1 200 OK\r\n" |
| 743 | "Cache-Control: no-cache, no-store, must-revalidate\r\n" |
| 744 | "Pragma: no-cache\r\n" |
| 745 | "Expires: 0\r\n" |
| 746 | "Content-Type: application/json\r\n" |
| 747 | ); |
| 748 | outBuf->catf("Content-Length: %u\r\n", (jsonResponse != nullptr) ? jsonResponse->Length() : 0); |
| 749 | AddCorsHeader(); |
| 750 | outBuf->cat("Connection: close\r\n\r\n"); |
| 751 | outBuf->Append(jsonResponse); |
| 752 | if (outBuf->HadOverflow()) |
| 753 | { |
| 754 | OutputBuffer::ReleaseAll(outBuf); |
| 755 | ReportOutputBufferExhaustion(__FILE__, __LINE__); |
| 756 | gotFileInfo = false; |
| 757 | } |
| 758 | else |
| 759 | { |
| 760 | filenameBeingProcessed.Clear(); |
| 761 | Commit(); |
| 762 | } |
| 763 | } |
| 764 | return gotFileInfo; |
| 765 | } |
| 766 | |
| 767 | // Authenticate the client and return true on success including a new session key if supported |
| 768 | bool HttpResponder::Authenticate(bool withSessionKey, HttpSessionKey &sessionKey) noexcept |
nothing calls this directly
no test coverage detected