MCPcopy Create free account
hub / github.com/apache/httpd / send_req

Function send_req

modules/generators/mod_cgid.c:578–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578static apr_status_t send_req(int fd, apr_file_t *errpipe, request_rec *r,
579 const char *argv0, char **env, int req_type)
580{
581 int i;
582 cgid_req_t req = {0};
583 apr_status_t stat;
584 ap_unix_identity_t * ugid = ap_run_get_suexec_identity(r);
585 core_dir_config *core_conf = ap_get_core_module_config(r->per_dir_config);
586 int errfd;
587
588
589 if (ugid == NULL) {
590 req.ugid = empty_ugid;
591 } else {
592 memcpy(&req.ugid, ugid, sizeof(ap_unix_identity_t));
593 }
594
595 req.req_type = req_type;
596 req.ppid = parent_pid;
597 req.conn_id = r->connection->id;
598 for (req.env_count = 0; env[req.env_count]; req.env_count++) {
599 continue;
600 }
601 req.filename_len = strlen(r->filename);
602 req.argv0_len = strlen(argv0);
603 req.uri_len = strlen(r->uri);
604 req.args_len = r->args ? strlen(r->args) : 0;
605 req.loglevel = r->server->log.level;
606
607 if (errpipe)
608 apr_os_file_get(&errfd, errpipe);
609 else
610 errfd = 0;
611
612 /* Write the request header */
613 if (req.args_len) {
614 stat = sock_writev(fd, errfd, r, 5,
615 &req, sizeof(req),
616 r->filename, req.filename_len,
617 argv0, req.argv0_len,
618 r->uri, req.uri_len,
619 r->args, req.args_len);
620 } else {
621 stat = sock_writev(fd, errfd, r, 4,
622 &req, sizeof(req),
623 r->filename, req.filename_len,
624 argv0, req.argv0_len,
625 r->uri, req.uri_len);
626 }
627
628 if (stat != APR_SUCCESS) {
629 return stat;
630 }
631
632 /* write the environment variables */
633 for (i = 0; i < req.env_count; i++) {
634 apr_size_t curlen = strlen(env[i]);
635

Callers 2

cgid_handlerFunction · 0.85
include_cmdFunction · 0.85

Calls 3

sock_writevFunction · 0.85
sock_writeFunction · 0.85

Tested by

no test coverage detected