Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main/SAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct {

char *path_translated;
char *request_uri;
char *path_info;

/* Do not use request_body directly, but the php://input stream wrapper instead */
struct _php_stream *request_body;
Expand Down
1 change: 1 addition & 0 deletions sapi/fpm/fpm/fpm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ static void init_request_info(void)
/* initialize the defaults */
SG(request_info).path_translated = NULL;
SG(request_info).request_method = FCGI_GETENV(request, "REQUEST_METHOD");
SG(request_info).path_info = FCGI_GETENV(request, "PATH_INFO");
SG(request_info).proto_num = 1000;
SG(request_info).query_string = NULL;
SG(request_info).request_uri = NULL;
Expand Down
40 changes: 40 additions & 0 deletions sapi/fpm/fpm/fpm_php_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,42 @@
#endif


static int dump_request_additional_info(FILE *slowlog){
char buffer[1024];
long addr;

if (0 > fpm_trace_get_long((long) &SG(request_info).request_method, &addr)) {
return -1;
}

if (0 > fpm_trace_get_strz(buffer, sizeof(buffer), addr)) {
return -1;
}
fprintf(slowlog, "request_method = %s\n", buffer);

if (0 > fpm_trace_get_long((long) &SG(request_info).path_info, &addr)) {

return -1;
}

if (0 > fpm_trace_get_strz(buffer, sizeof(buffer), addr)) {
return -1;
}
fprintf(slowlog, "request_path_info = %s\n", buffer);


if (0 > fpm_trace_get_long((long) &SG(request_info).query_string, &addr)) {
return -1;
}

if (0 > fpm_trace_get_strz(buffer, sizeof(buffer), addr)) {
return -1;
}
fprintf(slowlog, "request_query_string = %s\n", buffer);

return 0;
}

static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ */
{
int callers_limit = child->wp->config->request_slowlog_trace_depth;
Expand Down Expand Up @@ -62,6 +98,10 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ *

fprintf(slowlog, "script_filename = %s\n", buf);

if(dump_request_additional_info(slowlog) == -1){
return -1;
}

if (0 > fpm_trace_get_long((long) &EG(current_execute_data), &l)) {
return -1;
}
Expand Down