Skip to content

Commit

Permalink
handle main requests properly
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Jul 24, 2024
1 parent 5b4d431 commit 3a558f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frankenphp.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,9 @@ func updateServerContext(request *http.Request, create bool, mrh C.uintptr_t) (*
cRequestUri := C.CString(request.URL.RequestURI())

var rh Handle
var h Handle
if fc.responseWriter == nil {
h := mainRequests.NewHandle(request)
h = mainRequests.NewHandle(request)
mrh = C.uintptr_t(h)
} else {
rh = requestHandles.NewHandle(request)
Expand All @@ -433,6 +434,10 @@ func updateServerContext(request *http.Request, create bool, mrh C.uintptr_t) (*
C.int(request.ProtoMajor*1000+request.ProtoMinor),
)

if rh == 0 {
rh = h
}

if ret > 0 {
return &rh, RequestContextCreationError
}
Expand Down

0 comments on commit 3a558f6

Please sign in to comment.