<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 9/3/12 4:17 AM, ext Rémi
      Denis-Courmont wrote:<br>
    </div>
    <blockquote cite="mid:201209031217.50714@leon.remlab.net"
      type="cite">
      <pre wrap="">Le jeudi 30 août 2012 06:08:42, Ron Crocker a écrit :
</pre>
      <blockquote type="cite">
        <pre wrap="">Still new, but the last bit of advice was helpful so I thought I'd try
again for a little more. I've made it to the point where I'm trying to
load that JSON file I mentioned before. I've modified the HLS code to
ask for this file prior to loading any of the media, since that's pretty
close to what I want in the end. I'm asking for the file using
stream_UrlNew(), and I'm struggling with it a bit.
</pre>
      </blockquote>
      <pre wrap="">
It's not entirely obvious what's going on from your log. I'm afraid you'll 
need to debug this yourself. Maybe the size is not known yet immediately after 
stream_UrlNew() returns, but that would be odd.

You should perhaps not rely on the size anyway. In HTTP it is not always 
known, depending how the server generates the resource.

</pre>
    </blockquote>
    That's good advice, so I decided to try something a little
    different: instead of asking for the size prior to reading, I just
    read what's there. That seems quite reliable, actually - the code
    became simpler and is working well.<br>
    <br>
    This is what the code looks like now:<br>
    <blockquote>
      <pre>    char buf[4096];

    msg_Info(s,"Loading JSON file from URL: %s",p_sys->abc_url);

    stream_t *p_ts = stream_UrlNew(s,p_sys->abc_url);

    if (!p_ts) {
        return VLC_EGENERIC;
    }

    int64_t bytes = stream_Read(p_ts, buf, sizeof(buf));
    stream_Delete(p_ts);
</pre>
    </blockquote>
    With the corresponding log:<br>
    <blockquote>
      <pre>stream_filter_abc: Loading JSON file from URL: <a class="moz-txt-link-freetext" href="http://localhost:80/~qa1007/cgi-bin/abc.cgi">http://localhost:80/~qa1007/cgi-bin/abc.cgi</a>
main debug: creating access 'http' location='localhost:80/~qa1007/cgi-bin/abc.cgi', path='(null)'
main debug: looking for access module: 2 candidates
access_http debug: http: server='localhost' port=80 file='/~qa1007/cgi-bin/abc.cgi'
main debug: net: connecting to localhost port 80
main debug: connection succeeded (socket = 18)
access_http debug: protocol 'HTTP' answer code 200
access_http debug: Server: Apache/2.2.22 (Unix) DAV/2 mod_ssl/2.2.22 OpenSSL/0.9.8r
access_http debug: Connection: close
access_http debug: Transfer-Encoding: chunked
access_http debug: Content-Type: application/json
main debug: using access module "access_http"
main debug: Using stream method for AStream*
main debug: starting pre-buffering
main debug: received first data after 0 ms
main debug: pre-buffering done 218 bytes in 0s - 834 KiB/s
main debug: removing module "access_http"
stream_filter_abc: Processing server response:'{"abc":{...}}'
</pre>
    </blockquote>
    I fully expect that this JSON file will not exceed my buffer
    dimension, but it's possible that it could. I don't have code that
    handles that case, but it's pretty straightforward and as I'm the
    source of both the JSON file and this extension to VLC I'm not too
    concerned about it becoming an issue.<br>
    <br>
  </body>
</html>