Skip to content

Commit a0ac7be

Browse files
committed
add clientid for notify
1 parent 355dbef commit a0ac7be

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

modules/nginx-client-module/ngx_client.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,10 @@ ngx_client_connect_server(void *data, struct sockaddr *sa, socklen_t socklen)
730730
ngx_log_error(NGX_LOG_ERR, &s->log, ngx_errno,
731731
"nginx client connect peer failed");
732732
goto failed;
733+
} else if (rc == NGX_DECLINED) {
734+
ngx_log_error(NGX_LOG_ERR, &s->log, ngx_errno,
735+
"nginx client connect peer failed");
736+
goto failed;
733737
}
734738

735739
if (rc == NGX_DONE) {

modules/nginx-rtmp-module/ngx_rtmp_oclp_module.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,11 @@ ngx_rtmp_oclp_create_event(ngx_conf_t *cf, ngx_rtmp_oclp_event_t *event,
463463

464464
event->url.len = values[i].len;
465465
event->url.data = values[i].data;
466+
if (values[i].data[values[i].len - 1] != '/') {
467+
event->url.data = ngx_pcalloc(cf->pool, values[i].len + 1);
468+
event->url.len = values[i].len + 1;
469+
ngx_snprintf(event->url.data, event->url.len, "%V/", &values[i]);
470+
}
466471

467472
if (ngx_parse_request_url(&ru, &event->url) != NGX_OK) {
468473
ngx_conf_log_error(NGX_LOG_WARN, cf, 0, "request url format error");
@@ -738,13 +743,17 @@ ngx_rtmp_oclp_common_url(ngx_str_t *url, ngx_rtmp_session_t *s,
738743
buf = p;
739744

740745
if (ru.args.len) { // url already has args
741-
p = ngx_snprintf(buf, len, "&call=%s&act=%s&domain=%V&app=%V&name=%V",
746+
p = ngx_snprintf(buf, len,
747+
"&call=%s&act=%s&domain=%V&app=%V&name=%V&clientid=%D",
742748
ngx_rtmp_oclp_app_type[nctx->type],
743-
ngx_rtmp_oclp_stage[stage], &s->domain, &s->app, &s->name);
749+
ngx_rtmp_oclp_stage[stage],
750+
&s->domain, &s->app, &s->name, s->number);
744751
} else {
745-
p = ngx_snprintf(buf, len, "?call=%s&act=%s&domain=%V&app=%V&name=%V",
752+
p = ngx_snprintf(buf, len,
753+
"?call=%s&act=%s&domain=%V&app=%V&name=%V&clientid=%D",
746754
ngx_rtmp_oclp_app_type[nctx->type],
747-
ngx_rtmp_oclp_stage[stage], &s->domain, &s->app, &s->name);
755+
ngx_rtmp_oclp_stage[stage],
756+
&s->domain, &s->app, &s->name, s->number);
748757
}
749758
len -= p - buf;
750759
buf = p;

0 commit comments

Comments
 (0)