|
@@ -109,9 +109,29 @@ void cmd_getconfig(int clientsock) {
|
109
|
109
|
pthread_mutex_unlock(&cfg->channels_lock);
|
110
|
110
|
}
|
111
|
111
|
|
112
|
|
-void cmd_reconnect(int clientsock) {
|
|
112
|
+void cmd_reconnect(int clientsock, char *channel) {
|
113
|
113
|
send_200_ok(clientsock);
|
114
|
114
|
send_header_textplain(clientsock);
|
|
115
|
+ if (channel) {
|
|
116
|
+ int found = 0;
|
|
117
|
+ struct config *cfg = get_config();
|
|
118
|
+ list_lock(cfg->restreamer);
|
|
119
|
+ LNODE *l, *tmp;
|
|
120
|
+ list_for_each(cfg->restreamer, l, tmp) {
|
|
121
|
+ RESTREAMER *r = l->data;
|
|
122
|
+ if (strcmp(r->name, channel) == 0) {
|
|
123
|
+ found = 1;
|
|
124
|
+ r->reconnect = 1;
|
|
125
|
+ fdputsf(clientsock, "\nReconnecting %s input.\n", r->name);
|
|
126
|
+ break;
|
|
127
|
+ }
|
|
128
|
+ }
|
|
129
|
+ list_unlock(cfg->restreamer);
|
|
130
|
+ if (!found) {
|
|
131
|
+ fdputsf(clientsock, "\nERROR: Can not find %s channel.\n", channel);
|
|
132
|
+ }
|
|
133
|
+ return;
|
|
134
|
+ }
|
115
|
135
|
struct config *cfg = get_config();
|
116
|
136
|
pthread_mutex_lock(&cfg->channels_lock);
|
117
|
137
|
fdputsf(clientsock, "\nReconnecting %d inputs.\n", cfg->chanconf->items);
|