MCPcopy Index your code
hub / github.com/php/frankenphp / go_sapi_flush

Function go_sapi_flush

frankenphp.go:605–632  ·  view source on GitHub ↗

export go_sapi_flush

(threadIndex C.uintptr_t)

Source from the content-addressed store, hash-verified

603
604//export go_sapi_flush
605func 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
635func go_read_post(threadIndex C.uintptr_t, cBuf *C.char, countBytes C.size_t) (readBytes C.size_t) {

Callers

nothing calls this directly

Calls 4

clientHasClosedMethod · 0.80
FlushMethod · 0.80
frankenPHPContextMethod · 0.65
contextMethod · 0.65

Tested by

no test coverage detected