MCPcopy Create free account
hub / github.com/couchbase/cbft / relevantCaller

Function relevantCaller

cmd/cbft/timeout_handler.go:179–194  ·  view source on GitHub ↗

relevantCaller searches the call stack for the first function outside of net/http. The purpose of this function is to provide more helpful error messages.

()

Source from the content-addressed store, hash-verified

177// relevantCaller searches the call stack for the first function outside of net/http.
178// The purpose of this function is to provide more helpful error messages.
179func relevantCaller() runtime.Frame {
180 pc := make([]uintptr, 16)
181 n := runtime.Callers(1, pc)
182 frames := runtime.CallersFrames(pc[:n])
183 var frame runtime.Frame
184 for {
185 frame, more := frames.Next()
186 if !strings.HasPrefix(frame.Function, "net/http.") {
187 return frame
188 }
189 if !more {
190 break
191 }
192 }
193 return frame
194}
195
196// logf prints to the ErrorLog of the *Server associated with request r
197// via ServerContextKey. If there's no associated server, or if ErrorLog

Callers 1

writeHeaderLockedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected