Skip to content

Commit e917ab7

Browse files
committed
fix: callback parameters handling in worker extensions
1 parent 5514491 commit e917ab7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frankenphp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ func go_apache_request_headers(threadIndex C.uintptr_t) (*C.go_string, C.size_t)
382382
if fc.responseWriter == nil {
383383
// worker mode, not handling a request
384384

385-
logger.LogAttrs(context.Background(), slog.LevelDebug, "apache_request_headers() called in non-HTTP context", slog.String("worker", fc.scriptFilename))
385+
logger.LogAttrs(context.Background(), slog.LevelDebug, "apache_request_headers() called in non-HTTP context", slog.String("worker", fc.worker.name))
386386

387387
return nil, 0
388388
}

threadworker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func go_frankenphp_worker_handle_request_start(threadIndex C.uintptr_t) (C.bool,
228228
ptr = p
229229

230230
default:
231-
ptr = PHPValue(ptr)
231+
ptr = PHPValue(p)
232232
}
233233
handler.thread.Pin(ptr)
234234

@@ -252,9 +252,9 @@ func go_frankenphp_finish_worker_request(threadIndex C.uintptr_t, retval *C.zval
252252
thread.handler.(*workerThread).workerContext = nil
253253

254254
if fc.request == nil {
255-
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.scriptFilename), slog.Int("thread", thread.threadIndex))
255+
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.worker.name), slog.Int("thread", thread.threadIndex))
256256
} else {
257-
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.scriptFilename), slog.Int("thread", thread.threadIndex), slog.String("url", fc.request.RequestURI))
257+
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.worker.name), slog.Int("thread", thread.threadIndex), slog.String("url", fc.request.RequestURI))
258258
}
259259
}
260260

0 commit comments

Comments
 (0)