Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[debug] httpTools: debug logs if HTTP_DEBUG for compression

  • Loading branch information...
commit e236c2c6bffc25c7b883619d1620ab6728101ad3 1 parent 63dafc4
@Aqua-Ye Aqua-Ye authored
Showing with 21 additions and 17 deletions.
  1. +21 −17 libnet/httpTools.ml
View
38 libnet/httpTools.ml
@@ -592,23 +592,27 @@ let upto_mark_lws_ci = upto_mark_lws_ (fun str n -> Char.lowercase (ug str n))
(* Had to move this in here because of dependencies. *)
let content_compress sched gzip deflate compression_level cache_response content content_len cont =
- match content with
- | Rcontent.ContentString str ->
- Compression.compress_content sched gzip deflate compression_level cache_response str content_len
- (function (compressed, str) -> cont (compressed, Rcontent.ContentString str))
- | Rcontent.ContentBuffer buf ->
- Compression.compress_content sched gzip deflate compression_level cache_response
- (Buffer.contents buf) content_len
- (function (compressed, str) -> cont (compressed, Rcontent.ContentString str))
- | Rcontent.ContentFBuffer buf ->
- Compression.compress_content sched gzip deflate compression_level cache_response
- (FBuffer.contents buf) content_len
- (function compressed, str -> cont (compressed, Rcontent.ContentString str))
- | Rcontent.ContentFile (file,ic_opt,oc_opt,fstat_opt,unlinkable) ->
- Compression.compress_file sched gzip deflate compression_level cache_response file fstat_opt content_len
- (function compressed, file, fstat_opt -> cont (compressed, Rcontent.ContentFile (file,ic_opt,oc_opt,fstat_opt,unlinkable)))
- | Rcontent.ContentNone ->
- cont (false, Rcontent.ContentNone)
+ #<If>Logger.debug "HttpTools.compress_content: compressing..."#<End>;
+ let cont x =
+ #<If>Logger.debug "HttpTools.compress_content: compressed"#<End>;
+ cont x in
+ match content with
+ | Rcontent.ContentString str ->
+ Compression.compress_content sched gzip deflate compression_level cache_response str content_len
+ (function (compressed, str) -> cont (compressed, Rcontent.ContentString str))
+ | Rcontent.ContentBuffer buf ->
+ Compression.compress_content sched gzip deflate compression_level cache_response
+ (Buffer.contents buf) content_len
+ (function (compressed, str) -> cont (compressed, Rcontent.ContentString str))
+ | Rcontent.ContentFBuffer buf ->
+ Compression.compress_content sched gzip deflate compression_level cache_response
+ (FBuffer.contents buf) content_len
+ (function compressed, str -> cont (compressed, Rcontent.ContentString str))
+ | Rcontent.ContentFile (file,ic_opt,oc_opt,fstat_opt,unlinkable) ->
+ Compression.compress_file sched gzip deflate compression_level cache_response file fstat_opt content_len
+ (function compressed, file, fstat_opt -> cont (compressed, Rcontent.ContentFile (file,ic_opt,oc_opt,fstat_opt,unlinkable)))
+ | Rcontent.ContentNone ->
+ cont (false, Rcontent.ContentNone)
let make_ssl_cert ssl_cert ssl_key ssl_pass =
if ssl_cert <> "" then
Please sign in to comment.
Something went wrong with that request. Please try again.