Skip to content

sapi/apache2: apache env with walk_to_top going to the parent request. #14953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

devnexen
Copy link
Member

up to now, we walked down the oldest request we can find, now if the current request is a subrequest, we just reach to its parent directly.
Previous workflow for setting env affects a possible non main request within those internal redirections.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right but I'm not entirely sure, I'm not really an Apache expert.

if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if the ZPP changes are committed in a separate commit than the rest.

devnexen added 2 commits July 14, 2024 22:09
up to now, we walked down the oldest request we can find, now
if the current request is a subrequest, we just reach to its parent
directly.
Previous workflow for setting env affects a possible non main request
within those internal redirections.
@devnexen
Copy link
Member Author

@cmb69 do you know apache well enough ?

@cmb69
Copy link
Member

cmb69 commented Jul 19, 2024

@cmb69 do you know apache well enough ?

Not really. Maybe @Jan-E has something to say about this PR?

@devnexen devnexen requested a review from bukka August 6, 2024 17:27
@bukka
Copy link
Member

bukka commented Aug 10, 2024

I have been looking through the Apache source and not sure if this is not going to result in some behaviour change. What is being done currently is to iterate through r->prev which is to get to original request through all internal redirects (for example coming rewrites and other parts). This is triggered from ap_internal_redirect and main logic is in internal_internal_redirect. I can see that r->main is also set in internal_internal_redirect but it is set also during ap_set_sub_req_protocol so it would be good to check if subrequest would behave the same.

Btw. I could see that the r->prev loop pattern happens in other places in Apache code base so it is not something PHP specific. I will try to look even more next week and see if I can understand it better. I have got just very basic Apache internals (mainly related to proxy and trying to understand how its fcgi proxy behaves) knowledge so need to do more research in it as well.

What is actually the issue that you are trying to fix. Is there some specific problem that you are aware of?

I would like to also try to do some integration using my new tool for FPM testing which is quite generic and I could potentially use it for this. It's getting to the working state so once I have few FPM tests working I could try to look on setting that up for mod_php. Then I should be able to test this properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants