OSDN Git Service

b3869155cb80447a27a12170be0cb72344c3377d
[ultramonkey-l7/sslproxy.git] / src / http_request.cpp
1 /*
2  * @file  http_request.cpp
3  * @brief module of HTTP Request
4  * @brief HTTP Request parser
5  *
6  * Copyright (C) 2009  NTT COMWARE Corporation.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  **********************************************************************/
24
25 #include "http_request.h"
26
27 /*!
28  * HTTP Request constructor.
29  */
30 http_request::http_request()
31 {
32     /*-------- DEBUG LOG --------*/
33     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
34         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 20,
35         "in/out_function : Constructor http_request::http_request(void)");
36     }
37     /*------ DEBUG LOG END ------*/
38 }
39
40 /*!
41  * HTTP Request constructor.
42  * Parse HTTP request header.
43  *
44  * @param[in]   header  full http request header string
45  */
46 http_request::http_request(std::string header)
47 {
48     /*-------- DEBUG LOG --------*/
49     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
50         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 21,
51         "in/out_function : Constructor http_request::http_request(std::string header) : "
52         "header(%s)", header.c_str());
53     }
54     /*------ DEBUG LOG END ------*/
55     this->parse(header);
56 }
57
58 /*!
59  * HTTP Request destructor.
60  */
61 http_request::~http_request()
62 {
63     /*-------- DEBUG LOG --------*/
64     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
65         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 22,
66         "in/out_function : Destructor http_request::~http_request(void)");
67     }
68     /*------ DEBUG LOG END ------*/
69 }
70
71 /*!
72  * Get method function.
73  *
74  * @return    method
75  */
76 std::string http_request::method() const
77 {
78     /*-------- DEBUG LOG --------*/
79     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
80         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 23,
81         "in_function : std::string http_request::method(void)");
82         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 24,
83         "out_function : std::string http_request::method(void) : "
84         "return(%s)", this->_method.c_str());
85     }
86     /*------ DEBUG LOG END ------*/
87
88     return this->_method;
89 }
90
91 /*!
92  * Set method function.
93  * Set new method and return old method.
94  *
95  * @param[in]   method  new method
96  * @return  old method
97  */
98 std::string http_request::method(std::string _method)
99 {
100     /*-------- DEBUG LOG --------*/
101     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
102         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 25,
103         "in_function : std::string http_request::method(std::string _method) : "
104         "_method(%s)", _method.c_str());
105     }
106     /*------ DEBUG LOG END ------*/
107
108     std::string ret = this->_method;
109     this->_method = _method;
110     this->_modified = true;
111
112     /*-------- DEBUG LOG --------*/
113     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
114         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 26,
115         "out_function : std::string http_request::method(std::string _method) : "
116         "return(%s)", ret.c_str());
117     }
118     /*------ DEBUG LOG END ------*/
119
120     return ret;
121 }
122
123 /*!
124  * Get request URI function.
125  *
126  * @return    request URI
127  */
128 std::string http_request::request_uri() const
129 {
130     /*-------- DEBUG LOG --------*/
131     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
132         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 27,
133         "in_function : std::string http_request::request_uri(void)");
134         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 28,
135         "out_function : std::string http_request::request_uri(void) : "
136         "return(%s)", this->_request_uri.c_str());
137     }
138     /*------ DEBUG LOG END ------*/
139
140     return this->_request_uri;
141 }
142
143 /*!
144  * Set request URI function.
145  * Set new request URI and return old request URI.
146  *
147  * @param[in]   _request_uri    new request URI
148  * @return  old request URI
149  */
150 std::string http_request::request_uri(std::string _request_uri)
151 {
152     /*-------- DEBUG LOG --------*/
153     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
154         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 29,
155         "in_function : std::string http_request::request_uri(std::string _request_uri) : "
156         "_request_uri(%s)", _request_uri.c_str());
157     }
158     /*------ DEBUG LOG END ------*/
159
160     std::string ret = this->_request_uri;
161     this->_request_uri = _request_uri;
162     this->_modified = true;
163
164     /*-------- DEBUG LOG --------*/
165     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
166         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 30,
167         "out_function : std::string http_request::_request_uri(std::string _request_uri) : "
168         "return(%s)", ret.c_str());
169     }
170     /*------ DEBUG LOG END ------*/
171
172     return ret;
173 }
174
175 /*!
176  * Get HTTP version function.
177  *
178  * @return    HTTP version
179  */
180 std::string http_request::http_version() const
181 {
182     /*-------- DEBUG LOG --------*/
183     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
184         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 31,
185         "in_function : std::string http_request::http_version(void)");
186         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 32,
187         "out_function : std::string http_request::http_version(void) : "
188         "return(%s)", this->_http_version.c_str());
189     }
190     /*------ DEBUG LOG END ------*/
191
192     return this->_http_version;
193 }
194
195 /*!
196  * Set HTTP version function.
197  * Set new HTTP version and return old HTTP version.
198  *
199  * @param[in]   _http_version   new HTTP version
200  * @return  old HTTP version
201  */
202 std::string http_request::http_version(std::string _http_version)
203 {
204     /*-------- DEBUG LOG --------*/
205     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
206         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 33,
207         "in_function : std::string http_request::http_version(std::string _http_version) : "
208         "_http_version(%s)", _http_version.c_str());
209     }
210     /*------ DEBUG LOG END ------*/
211
212     std::string ret = this->_http_version;
213     this->_http_version = _http_version;
214     this->_modified = true;
215
216     /*-------- DEBUG LOG --------*/
217     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
218         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 34,
219         "out_function : std::string http_request::http_version(std::string _http_version) : "
220         "return(%s)", ret.c_str());
221     }
222     /*------ DEBUG LOG END ------*/
223
224     return ret;
225 }
226
227 /*!
228  * Get request line function.
229  *
230  * @return    request line
231  */
232 std::string http_request::request_line() const
233 {
234     /*-------- DEBUG LOG --------*/
235     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
236         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 35,
237         "in_function : std::string http_request::request_line(void)");
238     }
239     /*------ DEBUG LOG END ------*/
240
241     std::string ret = this->method() + " " + this->request_uri() + " " + this->http_version() + "\r\n";
242
243     /*-------- DEBUG LOG --------*/
244     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
245         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 36,
246         "out_function : std::string http_request::request_line(void) : "
247         "return(%s)", ret.c_str());
248     }
249     /*------ DEBUG LOG END ------*/
250
251     return ret;
252 }
253
254 /*!
255  * Get full HTTP request function.
256  *
257  * @return    HTTP request
258  */
259 std::string http_request::as_string()
260 {
261     /*-------- DEBUG LOG --------*/
262     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
263         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 37,
264         "in_function : std::string http_request::as_string(void)");
265     }
266     /*------ DEBUG LOG END ------*/
267
268     if (this->_modified)
269         this->rebuild();
270
271     /*-------- DEBUG LOG --------*/
272     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
273         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 38,
274         "out_function : std::string http_request::as_string(void) : "
275         "return(%s)", this->raw_message.c_str());
276     }
277     /*------ DEBUG LOG END ------*/
278
279     return this->raw_message;
280 }
281
282 /*!
283  * Parse HTTP request header function.
284  *
285  * @param[in]   request     full HTTP request header
286  */
287 void http_request::parse(std::string request)
288 {
289     /*-------- DEBUG LOG --------*/
290     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
291         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 39,
292         "in_function : void http_request::parse(std::string request) : "
293         "request(%s)", request.c_str());
294     }
295     /*------ DEBUG LOG END ------*/
296
297     // save raw request
298     this->raw_message = request;
299
300     // parse request
301     HTTP_REQUEST_POSITION pos = REQUEST_METHOD;
302
303     /*
304      * RFC2616
305      *  OCTET       : 8bit data
306      *  CHAR        : US-ASCII(0-127)
307      *  UPALPHA     : A-Z
308      *  LOALPHA     : a-z
309      *  ALPHA       : UPALPHA | LOALPHA
310      *  DIGIT       : 0-9
311      *  HEXDIG      : A-F | a-f | DIGIT
312      *  SP          : SPace(32)
313      *  HT          : Horizontal Tab(9)
314      *  CR          : Carriage Return(13)
315      *  LF          : Line Feed(10)
316      *  CTL         : ConTLol char(0-31,127)
317      *  LWS         : [CRLF] 1*(SP|HT)
318      *  separators  : ()<>@,;:\"/[]?={} and SP, HT
319      *  token       : 1*(CHAR not CTL, separators)
320      *                DIGIT, ALPHA and !#$%&'*+-.^_`|~
321      */
322     std::string::iterator ptr = request.begin();
323     std::string::iterator end = request.end();
324     std::string::iterator start = ptr;
325     std::pair<std::string, std::string> field_pair;
326     try {
327         while (ptr != end) {
328             switch(pos) {
329             /*
330              * REQUEST-LINE :
331              *      METHOD SP REQUEST-URI SP HTTP-VERSION CRLF
332              */
333             /*
334              * METHOD : token
335              */
336             case REQUEST_METHOD:
337                 if (*ptr == ' ') { // METHOD end with SP
338                     this->_method.assign(start, ptr);
339                     pos = REQUEST_METHOD_SP;
340                 } else if (!isalpha(*ptr) && !isdigit(*ptr) &&
341                     *ptr != '!' && *ptr != '#' && *ptr != '$' && *ptr != '%' &&
342                     *ptr != '&' && *ptr != '\'' && *ptr != '*' && *ptr != '+' &&
343                     *ptr != '-' && *ptr != '.' && *ptr != '^' && *ptr != '_' &&
344                     *ptr != '`' && *ptr != '|' && *ptr != '~') {
345                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 1,
346                     "Parse error: Invalid request method.(%c)", *ptr);
347                     throw -1;
348                 }
349                 break;
350             /*
351              * REQUEST-URI : * | absolute-URI | path-absolute | authority
352              *
353              * RFC3986
354              *  absolute-URI    : scheme ":" hier-part [ "?" query ]
355              *  path-absolute   : "/" [ segment-nz *( "/" segment ) ]
356              *  authority       : [ userinfo "@" ] host [ ":" port ]
357              *  scheme          : ALPHA *( ALPHA | DIGIT | "+" | "-" | "." )
358              *  hier-part       : "//" authority path-abempty
359              *                  / path-absolute
360              *                  / path-rootless
361              *                  / path-empty
362              *  query           : *( pchar | "/" | "?" )
363              *  path-abempty    : *( "/" segment )
364              *  path-rootless   : segment-nz *( "/" segment )
365              *  path-empty      : no char
366              *  segment-nz      : 1*pchar
367              *  segment         : *pchar
368              *  userinfo        : *( unreserved | pct-encoded | sub-delims | ":" )
369              *  host            : IP-literal | IPv4address | reg-name
370              *  port            : *DIGIT
371              *  unreserved      : ALPHA | DIGIT | "-" | "." | "_" | "~"
372              *  pct-encoded     : "%" HEXDIG HEXDIG
373              *  sub-delims      : !$&'()*+,;=
374              *  pchar           : unreserved | pct-encoded | subdelims | ":" | "@"
375              *  IP-literal      : "[" ( IPv6address | IPvFuture ) "]"
376              *  IPvFuture       : "v" 1*HEXDIG "." 1*( unreserved | sub-delims | ":" )
377              *  IPv6address     :                            6( h16 ":" ) ls32
378              *                  /                       "::" 5( h16 ":" ) ls32
379              *                  / [               h16 ] "::" 4( h16 ":" ) ls32
380              *                  / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
381              *                  / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
382              *                  / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
383              *                  / [ *4( h16 ":" ) h16 ] "::"              ls32
384              *                  / [ *5( h16 ":" ) h16 ] "::"              h16
385              *                  / [ *6( h16 ":" ) h16 ] "::"
386              *  h16             : 1*4HEXDIG
387              *  ls32            : ( h16 ":" h16 ) | IPv4address
388              *  IPv4address     : dec-octet "." dec-octet "." dec-octet "." dec-octet
389              *  dec-octet       : 0-255
390              *  reg-name        : *( unreserved | pct-encoded | sub-delims )
391              */
392             case REQUEST_METHOD_SP:
393                 // Request-URI start
394                 // XXX not enough?
395                 if (*ptr == '/' || isalpha(*ptr) || isdigit(*ptr) || *ptr == '-' ||
396                     *ptr == '.' || *ptr == '_' || *ptr == '~' || *ptr == ':' || 
397                     *ptr == '@' || *ptr == '!' || *ptr == '$' || *ptr == '&' ||
398                     *ptr == '(' || *ptr == ')' || *ptr == '*' || *ptr == '+' ||
399                     *ptr == ',' || *ptr == ';' || *ptr == '=' || *ptr == '%') {
400                     pos = REQUEST_REQUEST_URI;
401                     start = ptr;
402                 } else {
403                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 2,
404                     "Parse error: Invalid request-uri.(%c)", *ptr);
405                     throw -1;
406                 }
407                 break;
408     
409             case REQUEST_REQUEST_URI:
410                 if (*ptr == ' ') { // Request-URI end with SP
411                     this->_request_uri.assign(start, ptr);
412                     pos = REQUEST_REQUEST_URI_SP;
413                 } else if (!isalpha(*ptr) && !isdigit(*ptr) && *ptr != '/' && // XXX not enough?
414                     *ptr != '.' && *ptr != '=' && *ptr != '%' && *ptr != '?' &&
415                     *ptr != '&' && *ptr != '+' && *ptr != '~' && *ptr != ',' && 
416                     *ptr != '@' && *ptr != '!' && *ptr != '$' && *ptr != '-' &&
417                     *ptr != '(' && *ptr != ')' && *ptr != '*' && *ptr != '_' &&
418                     *ptr != ':' && *ptr != ';') {
419                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 3,
420                     "Parse error: Invalid request-uri.(%c)", *ptr);
421                     throw -1;
422                 }
423                 break;
424     
425             /*
426              * HTTP-VERSION     : "HTTP" "/" 1*DIGIT "." 1*DIGIT
427              */
428             case REQUEST_REQUEST_URI_SP:
429                 // HTTP-VERSION start
430                 if (*ptr == 'H') {
431                     pos = REQUEST_HTTP_VERSION_H;
432                     start = ptr;
433                 } else {
434                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 4,
435                     "Parse error: Invalid http-version.(%c)", *ptr);
436                     throw -1;
437                 }
438                 break;
439     
440             case REQUEST_HTTP_VERSION_H:
441                 // HTTP-VERSION next
442                 if (*ptr == 'T') {
443                     pos = REQUEST_HTTP_VERSION_T1;
444                 } else {
445                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 5,
446                     "Parse error: Invalid http-version.(%c)", *ptr);
447                     throw -1;
448                 }
449                 break;
450     
451             case REQUEST_HTTP_VERSION_T1:
452                 // HTTP-VERSION next
453                 if (*ptr == 'T') {
454                     pos = REQUEST_HTTP_VERSION_T2;
455                 } else {
456                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 6,
457                     "Parse error: Invalid http-version.(%c)", *ptr);
458                     throw -1;
459                 }
460                 break;
461     
462             case REQUEST_HTTP_VERSION_T2:
463                 // HTTP-VERSION next
464                 if (*ptr == 'P') {
465                     pos = REQUEST_HTTP_VERSION_P;
466                 } else {
467                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 7,
468                     "Parse error: Invalid http-version.(%c)", *ptr);
469                     throw -1;
470                 }
471                 break;
472     
473             case REQUEST_HTTP_VERSION_P:
474                 // HTTP-VERSION next
475                 if (*ptr == '/') {
476                     pos = REQUEST_HTTP_VERSION_SLASH;
477                 } else {
478                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 8,
479                     "Parse error: Invalid http-version.(%c)", *ptr);
480                     throw -1;
481                 }
482                 break;
483     
484             case REQUEST_HTTP_VERSION_SLASH:
485                 // HTTP-VERSION Mejor number
486                 if (isdigit(*ptr)) {
487                     pos = REQUEST_HTTP_VERSION_MAJOR;
488                 } else {
489                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 9,
490                     "Parse error: Invalid http-version.(%c)", *ptr);
491                     throw -1;
492                 }
493                 break;
494     
495             case REQUEST_HTTP_VERSION_MAJOR:
496                 // HTTP-VERSION next dot
497                 if (*ptr == '.') {
498                     pos = REQUEST_HTTP_VERSION_DOT;
499                 } else if (!isdigit(*ptr)) {
500                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 10,
501                     "Parse error: Invalid http-version.(%c)", *ptr);
502                     throw -1;
503                 }
504                 break;
505     
506             case REQUEST_HTTP_VERSION_DOT:
507                 // HTTP-VERSION Minor number
508                 if (isdigit(*ptr)) {
509                     pos = REQUEST_HTTP_VERSION_MINOR;
510                 } else {
511                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 11,
512                     "Parse error: Invalid http-version.(%c)", *ptr);
513                     throw -1;
514                 }
515                 break;
516     
517             case REQUEST_HTTP_VERSION_MINOR:
518                 // HTTP-VERSION end with CR
519                 if (*ptr == '\r') {
520                     pos = REQUEST_CR;
521                     this->_http_version.assign(start, ptr);
522                 } else if (!isdigit(*ptr)) {
523                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 12,
524                     "Parse error: Invalid http-version.(%c)", *ptr);
525                     throw -1;
526                 }
527                 break;
528     
529             case REQUEST_CR:
530                 // LF only
531                 if (*ptr == '\n') {
532                     pos = REQUEST_LF;
533                     http_message::parse(std::string(ptr + 1, end));
534                 } else {
535                     LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 13,
536                     "Parse error: No LF.(%c)", *ptr);
537                     throw -1;
538                 }
539                 break;
540             }
541             if (pos == REQUEST_LF)
542                 break;
543             ptr++;
544         }
545     }
546     catch (...) {
547         LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 14,
548         "Exception occured by parsing HTTP request.");
549     }
550
551     /*-------- DEBUG LOG --------*/
552     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
553         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 40,
554         "out_function : void http_request::parse(std::string request)");
555     }
556     /*------ DEBUG LOG END ------*/
557 }
558
559 /*!
560  * Rebuild HTTP request header function.
561  */
562 void http_request::rebuild()
563 {
564     /*-------- DEBUG LOG --------*/
565     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
566         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 41,
567         "in_function : void http_request::rebuild()");
568     }
569     /*------ DEBUG LOG END ------*/
570
571     this->raw_message = this->request_line();
572     http_message::rebuild();
573
574     /*-------- DEBUG LOG --------*/
575     if (LOG_LV_DEBUG == logger_get_log_level(LOG_CAT_PACKET_EDIT_HTTP)) {
576         LOGGER_PUT_LOG_DEBUG(LOG_CAT_PACKET_EDIT_HTTP, 42,
577         "out_function : void http_request::rebuild()");
578     }
579     /*------ DEBUG LOG END ------*/
580 }