Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dlna_http_requests [2014/08/16 04:08] – created beandog | dlna_http_requests [2014/08/16 04:12] (current) – beandog | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== DLNA HTTP Requests ====== | ====== DLNA HTTP Requests ====== | ||
+ | |||
+ | * [[DLNA]] | ||
+ | * [[DLNA HTTP]] | ||
I'm examining the HTTP traffic sent back-and-forth between the DLNA server (minidlna in my case) and the DLNA client (Sony Blu-ray player). | I'm examining the HTTP traffic sent back-and-forth between the DLNA server (minidlna in my case) and the DLNA client (Sony Blu-ray player). | ||
Line 10: | Line 13: | ||
< | < | ||
- | sudo tcpflow -p -c port 8200 > log.firstrun | + | sudo tcpflow -p -c port 8200 > log.firstrun-60s |
+ | </ | ||
+ | |||
+ | Clean up the data: | ||
+ | |||
+ | < | ||
+ | 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 " | ||
+ | </ | ||
+ | |||
+ | And the first two HTTP requests: | ||
+ | |||
+ | < | ||
+ | Array | ||
+ | ( | ||
+ | [Request Method] => HEAD | ||
+ | [Request Url] => / | ||
+ | [User-Agent] => UPnP/1.0 DLNADOC/ | ||
+ | [Host] => 10.10.10.103: | ||
+ | [Accept] => */* | ||
+ | [X-Av-Physical-Unit-Info] => pa=" | ||
+ | [X-Av-Client-Info] => av=5.0; cn=" | ||
+ | [Getcontentfeatures.Dlna.Org] => 1 | ||
+ | ) | ||
+ | Array | ||
+ | ( | ||
+ | [Response Code] => 200 | ||
+ | [Response Status] => OK | ||
+ | [Content-Type] => video/ | ||
+ | [Content-Length] => 445063149 | ||
+ | [Transfermode.Dlna.Org] => Streaming | ||
+ | [Accept-Ranges] => bytes | ||
+ | [Connection] => close | ||
+ | [Date] => Sat, 16 Aug 2014 02:15:10 GMT | ||
+ | [Ext] => | ||
+ | [Realtimeinfo.Dlna.Org] => DLNA.ORG_TLAG=* | ||
+ | [Contentfeatures.Dlna.Org] => DLNA.ORG_OP=01; | ||
+ | [Server] => 3.12.5-ck DLNADOC/ | ||
+ | ) | ||
</ | </ |