|
|
| version 1.93, 2020/10/14 11:24:46 | version 1.95, 2020/10/14 21:20:15 |
|---|---|
| Line 59 bool HTTP_Headers::add_header(const char | Line 59 bool HTTP_Headers::add_header(const char |
| content_type=header.value; | content_type=header.value; |
| if(header.name == String::Body("CONTENT-LENGTH") && content_length==0) | if(header.name == String::Body("CONTENT-LENGTH") && content_length==0) |
| content_length=pa_atoul(header.value.cstr(), 10); | ALTER_EXCEPTION_COMMENT(content_length=pa_atoul(header.value.cstr()), " for content-length"); |
| headers+=header; | headers+=header; |
| Line 153 public: | Line 153 public: |
| return status_line; | return status_line; |
| const char *result_str=pa_strdup(status_start, status_end-status_start); | const char *result_str=pa_strdup(status_start, status_end-status_start); |
| result=pa_atoui(result_str, 10); | ALTER_EXCEPTION_COMMENT(result=pa_atoui(result_str), " for HTTP status"); |
| return result_str; | return result_str; |
| } | } |
| Line 867 File_read_http_result pa_internal_file_r | Line 867 File_read_http_result pa_internal_file_r |
| HTTP_response response(connect_string); | HTTP_response response(connect_string); |
| // sending request | // sending request |
| int status_code=http_request(response, idna_host, port, request, request_size, timeout_secs, fail_on_status_ne_200); | int status_code; |
| ALTER_EXCEPTION_SOURCE(status_code=http_request(response, idna_host, port, request, request_size, timeout_secs, fail_on_status_ne_200), &connect_string); | |
| // processing results | // processing results |
| char* raw_body=response.buf + response.body_offset; | char* raw_body=response.buf + response.body_offset; |
| Line 1110 int HTTPD_Server::bind(const char *host_ | Line 1111 int HTTPD_Server::bind(const char *host_ |
| port = host_port; | port = host_port; |
| } | } |
| if(!set_addr(&me, host, pa_atoui(port, 10))){ | if(!set_addr(&me, host, pa_atoui(port))){ |
| if (host) | if (host) |
| throw Exception("httpd.bind", 0, "can not resolve hostname \"%s\"", host); | throw Exception("httpd.bind", 0, "can not resolve hostname \"%s\"", host); |
| me.sin_addr.s_addr=INADDR_ANY; | me.sin_addr.s_addr=INADDR_ANY; |