Make rtmpdump handle full RTMP URLs with "-i"
Make rtmpgw handle full RTMP URLs with "-i"

or --url. Just as rtmpdump and librtmp already can.
Fix bogus optarg refs in prev commit
Fix rare infinite loop on EOF

reported by Matt Robison <rtmpdump@nerdoftheherd.com>
Fix compat with PolarSSL >= 1.1.0
Fix socks support for SetupURL

SetupURL assigns sockshost but never parses the data. This patch factors
the code out from SetupStream into a common function and adds it to
SetupURL.
Handle AMF_ECMA_ARRAY and AMF_STRICT_ARRAY objects
Cleanup prev commit
Allocate the RTMP struct dynamically

This struct is over 1 MB in size, and doesn't fit on the stack
on OS X.
Replace hardcoded constants and comments with proper named constants
Add functions for doing server side TLS initialization
Support rtmps in rtmpsrv
Add null termination to buffers before using strstr
Buffer more data before returning successfully from HTTP_read, if needed

This fixes issues if the http header and the payload data
are sent in separate packets (as they normally are), and the
buffer contains the full header but none of the payload.
Don't require 144 bytes to be buffered before proceeding with HTTP_read

This makes the code more flexible, if servers were to use
smaller headers.
Refill if HTTP_read indicated it needs more data

HTTP_read wants to skip past the first payload byte, so
it actually needs to have at least 144 + 1 bytes buffered.

This also avoids relying on the magic 144 byte constant altogether,
which could easily break if servers include less reply headers.
Use CRLF newlines consistently for all HTTP POST headers
Free skipped packets in RTMP_GetNextMediaPacket
Allocate the channel arrays dynamically

This avoids having to allocate space for all theoretical channels
if most of them aren't used. This drops the size of the full
RTMP struct from over 1200 KB to 16 KB (on 64 bit), and as long as
only channels with a low number are used, the amount of total
allocated memory stays far below what it was before.
Add adobe authentication support

From: Sergiy <piratfm@gmail.com>

To use this, add flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)
and pubUser=<username> pubUser=<password> to the RTMP url.

This should both work for generic adobe authentication, and for
publishing to akamai.