Skip to content

Commit

Permalink
Removes panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
a.stecher committed Oct 8, 2024
1 parent 98c3bb8 commit 483d509
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions php_thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ func initializePHPThreads(numThreads int) {
}

func getPHPThread(threadIndex int) *phpThread {
if threadIndex >= 0 && threadIndex < len(phpThreads) {
return phpThreads[threadIndex]
}
panic("no such thread")
return phpThreads[threadIndex]
}

func (thread *phpThread) setMainRequest(request *http.Request) {
Expand All @@ -38,18 +35,12 @@ func (thread *phpThread) setWorkerRequest(request *http.Request) {
}

func (thread *phpThread) getMainRequest() *http.Request {
if thread.mainRequest != nil {
return thread.mainRequest
}
panic("no worker request")
return thread.mainRequest
}

func (thread *phpThread) getActiveRequest() *http.Request {
if thread.workerRequest != nil {
return thread.workerRequest
}
if thread.mainRequest != nil {
return thread.mainRequest
}
panic("no active request")
return thread.mainRequest
}

0 comments on commit 483d509

Please sign in to comment.