export go_sapi_flush
(threadIndex C.uintptr_t)
| 603 | |
| 604 | //export go_sapi_flush |
| 605 | func go_sapi_flush(threadIndex C.uintptr_t) bool { |
| 606 | thread := phpThreads[threadIndex] |
| 607 | fc := thread.frankenPHPContext() |
| 608 | if fc == nil { |
| 609 | return false |
| 610 | } |
| 611 | |
| 612 | if fc.responseWriter == nil { |
| 613 | return false |
| 614 | } |
| 615 | |
| 616 | if fc.clientHasClosed() && !fc.isDone { |
| 617 | return true |
| 618 | } |
| 619 | |
| 620 | if fc.responseController == nil { |
| 621 | fc.responseController = http.NewResponseController(fc.responseWriter) |
| 622 | } |
| 623 | if err := fc.responseController.Flush(); err != nil { |
| 624 | ctx := thread.context() |
| 625 | |
| 626 | if globalLogger.Enabled(ctx, slog.LevelWarn) { |
| 627 | globalLogger.LogAttrs(ctx, slog.LevelWarn, "the current responseWriter is not a flusher, if you are not using a custom build, please report this issue", slog.Any("error", err)) |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | return false |
| 632 | } |
| 633 | |
| 634 | //export go_read_post |
| 635 | func go_read_post(threadIndex C.uintptr_t, cBuf *C.char, countBytes C.size_t) (readBytes C.size_t) { |
nothing calls this directly
no test coverage detected