문제

I am writing a fastCGI application using the fastCGI development kit on Linux (Ubuntu), using Apache 2.2 + mod_fcgid.

According to the document, the correct code structure for an fastCGI app is:

  • Initialization section, which is executed only once.
  • Response loop section, which gets executed every time the FastCGI script gets called.

This seems to be wrong to me, surely, if there is an initialization section, then there must be a 'Cleanup' section?

If so, where would the cleanup section be, and how can I be sure that the cleanup section ever gets called - I mean is there something in the fastCGI protocol that tells the app to terminate?

Common sense tells me to place the cleanup section after the response loop - BUT is this the correct way to clean up?

도움이 되었습니까?

해결책

This question looks related, and might help you.

다른 팁

Normally when you are in the loop you will call "FCGX_Accept" function. If parent (apache) wishes to terminate FCGI child it will probably return "failure" for the accept function, in which case you should probably break the loop and cleanup on the way to exit.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top