883 |
|
|
884 |
const char * content_type = get_content_type(filesystem_path); |
const char * content_type = get_content_type(filesystem_path); |
885 |
HTTPExchange_set_response_header(exchange, HTTP_CONTENT_TYPE, content_type); |
HTTPExchange_set_response_header(exchange, HTTP_CONTENT_TYPE, content_type); |
886 |
const char * request_uri = HTTPExchange_get_request_uri(exchange); |
if (strcmp(content_type, "text/javascript") == 0 && ! is_no_instrument(abs_path)) { |
|
if (strcmp(content_type, "text/javascript") == 0 && ! is_no_instrument(request_uri)) { |
|
887 |
Stream * input_stream = Stream_new(0); |
Stream * input_stream = Stream_new(0); |
888 |
Stream * output_stream = Stream_new(0); |
Stream * output_stream = Stream_new(0); |
889 |
|
|
890 |
Stream_write_file_contents(input_stream, f); |
Stream_write_file_contents(input_stream, f); |
891 |
|
|
892 |
instrument_js(request_uri, input_stream, output_stream); |
instrument_js(abs_path, input_stream, output_stream); |
893 |
|
|
894 |
if (HTTPExchange_write_response(exchange, output_stream->data, output_stream->length) != 0) { |
if (HTTPExchange_write_response(exchange, output_stream->data, output_stream->length) != 0) { |
895 |
HTTPServer_log_err("Warning: error writing to client\n"); |
HTTPServer_log_err("Warning: error writing to client\n"); |
1041 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
1042 |
WSADATA data; |
WSADATA data; |
1043 |
if (WSAStartup(MAKEWORD(1, 1), &data) != 0) { |
if (WSAStartup(MAKEWORD(1, 1), &data) != 0) { |
1044 |
fatal("Could not start Winsock"); |
fatal("could not start Winsock"); |
1045 |
} |
} |
1046 |
#endif |
#endif |
1047 |
|
|