Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
dlna_http_requests [2014/08/16 04:09] – beandog | dlna_http_requests [2014/08/16 04:11] – beandog | ||
---|---|---|---|
Line 17: | Line 17: | ||
< | < | ||
dos2unix log.firstrun-60s | dos2unix log.firstrun-60s | ||
+ | </ | ||
+ | |||
+ | Some PHP code to help me examine the content closely (which I'm not going to apologize for the quality, since I'm debugging). Requires the PECL http extension. | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | $str = file_get_contents(" | ||
+ | $contents = explode(" | ||
+ | |||
+ | $count = 0; | ||
+ | $key = 0; | ||
+ | $headers = array(); | ||
+ | |||
+ | foreach($contents as $str) { | ||
+ | |||
+ | if(strpos($str, | ||
+ | $key++; | ||
+ | $arr = explode(":", | ||
+ | array_shift($arr); | ||
+ | $str = implode(":", | ||
+ | } | ||
+ | |||
+ | $arr_content_headers[$key][] = $str; | ||
+ | |||
+ | } | ||
+ | |||
+ | foreach($arr_content_headers as $arr) { | ||
+ | $headers[] = implode(" | ||
+ | } | ||
+ | |||
+ | foreach($headers as $key => $http_headers) { | ||
+ | |||
+ | $arr_headers = http_parse_headers($http_headers); | ||
+ | |||
+ | if($arr_headers === false) { | ||
+ | $count++; | ||
+ | } else { | ||
+ | print_r($arr_headers); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | if($count) | ||
+ | echo " | ||
</ | </ |