diff options
| author | Mistivia <i@mistivia.com> | 2025-11-30 21:57:37 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-30 21:57:37 +0800 |
| commit | 71549ca55d515c69efd87a2a58401c135db39e21 (patch) | |
| tree | 5481e10ec6e3a87c7096e1f8196e6020a9113131 /rtmpserver.cpp | |
| parent | 1929cd6231a38a4bcd8950417a038ec35c60b54d (diff) | |
add live key support
Diffstat (limited to 'rtmpserver.cpp')
| -rw-r--r-- | rtmpserver.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/rtmpserver.cpp b/rtmpserver.cpp index 1745434..cb0766e 100644 --- a/rtmpserver.cpp +++ b/rtmpserver.cpp @@ -234,12 +234,10 @@ void handle_connect(Client *client, double txid, Decoder *dec) send_reply(client, txid, version, status); -/* uint32_t chunk_len = htonl(1024); std::string set_chunk((char *) &chunk_len, 4); - rtmp_send(client, MSG_SET_CHUNK, CONTROL_ID, set_chunk, 0, - MEDIA_CHANNEL); - + rtmp_send(client, MSG_SET_CHUNK, CONTROL_ID, set_chunk); +/* client->chunk_len = 1024; */ } @@ -260,6 +258,14 @@ void handle_fcpublish(Client *client, double txid, Decoder *dec) std::string path = amf_load_string(dec); debug("fcpublish %s\n", path.c_str()); + printf("fcpublish %s\n", path.c_str()); + if (strlen(ezlive_config->key) > 0) { + if (strcmp(ezlive_config->key, path.c_str()) != 0) { + publishernum = 0; + printf( "wrong live key.\n"); + throw std::runtime_error{"wrong live key."}; + } + } client->path = path; @@ -795,7 +801,7 @@ void do_poll(void) } struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - if (client != NULL && ts.tv_sec - client->livets > 90) { + if (client != NULL && ts.tv_sec - client->livets > 60) { fprintf(stderr, "client timeout.\n"); close_client(client, i); --i; |
