462 views
1 votes
1 votes
Q 69. Which data structure is used to implement a request handler in a web server?

(A) Stack

(B) Queue

(C) Arrays

(D) All of the above

(E) None of the above

1 Answer

2 votes
2 votes

(e) Correct Ans is Structure

The central data structure that represents an HTTP request is the request_rec. It is created when Apache accepts the request, and is provided to all request processing functions. The request_rec is a large struct containing, directly or indirectly, all the data fields a handler needs to process the request. Any metadata handler works by accessing and updating fields in the request_rec, content generator or filter may do so but additionally processes I/O, and a logger gets its information from the request_rec. The request_rec data structure stores all the data pertaining to a particular request made to the server.

The request_rec structure is defined as follows:

struct request_rec {

  pool *pool;

  conn_rec *connection;

  server_rec *server;

  request_rec *next;                             

  request_rec *prev;

  request_rec *main;             

  char *the_request;  

  int assbackwards; 

  int proxyreq; 

  int header_only

  char *protocol;   

  char *status_line;

  int status;                

  char *method;          

  int method_number;

  int sent_bodyct;  

  table *headers_in;

  table *headers_out;

  table *err_headers_out;

  table *subprocess_env;

  table *notes;

  char *content_type;            

  char *handler;     

  char *content_encoding;

  char *content_language;

  int no_cache;

  char *uri;  

  char *filename;

  char *path_info;

  char *args;                          

  struct stat finfo;   

  void *per_dir_config;         

  void *request_config;         

  const struct htaccess_result *htaccess;

};

Reference link 1

Related questions

0 votes
0 votes
2 answers
1
Ritwik asked May 18, 2017
309 views
Qn. 68 Which of the data structure is suitable for implementing a buffer to file?(A) File(B) Linked List(C) Array(D) All of the above(E) None of the above
0 votes
0 votes
1 answer
2
Ritwik asked May 18, 2017
274 views
Qn 70. Which of the data structure is not suitable for building a cache?(A) File(B) Linked List(C) Arrays(D) All of the above(E) None of the above
1 votes
1 votes
0 answers
3
Gunjack asked Oct 5, 2018
350 views
As a Mechanical Engineering graduate I decided to pursue M.Tech in Computer Science.Can I apply for PSU after completing M.Tech in Computer Science branch?I have heard so...
0 votes
0 votes
1 answer
4
Beyonder asked Mar 6, 2017
1,015 views
The main reason for preferring servlet for web application developmentis :(A) Increased performance of web application(B) Easy to develop an application(C) Platform indep...