Permalink
Browse files

added transaction support to RTMP connect command

  • Loading branch information...
1 parent 427614a commit b063daecdb6a88ff4c03ffd217c75696aff5da55 @arut committed Apr 15, 2012
Showing with 5 additions and 3 deletions.
  1. +4 −3 ngx_rtmp_cmd_module.c
  2. +1 −0 ngx_rtmp_cmd_module.h
View
7 ngx_rtmp_cmd_module.c
@@ -96,10 +96,9 @@ ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
static ngx_rtmp_amf_elt_t in_elts[] = {
- /* transaction in always 1 */
{ NGX_RTMP_AMF_NUMBER,
ngx_null_string,
- NULL, 0 },
+ &v.trans, 0 },
{ NGX_RTMP_AMF_OBJECT,
ngx_null_string,
@@ -128,7 +127,7 @@ ngx_rtmp_cmd_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v)
size_t len;
ngx_rtmp_header_t h;
- static double trans = 1;
+ static double trans;
static double capabilities = NGX_RTMP_CAPABILITIES;
static ngx_rtmp_amf_elt_t out_obj[] = {
@@ -190,6 +189,8 @@ ngx_rtmp_cmd_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v)
v->app, v->flashver, v->swf_url, v->tc_url, v->page_url,
(uint32_t)v->acodecs, (uint32_t)v->vcodecs);
+ trans = v->trans;
+
/* fill session parameters */
s->connected = 1;
View
1 ngx_rtmp_cmd_module.h
@@ -18,6 +18,7 @@
/* TODO: improve string sizes */
typedef struct {
+ double trans;
u_char app[128];
u_char flashver[32];
u_char swf_url[256];

0 comments on commit b063dae

Please sign in to comment.