Project

General

Profile

Feature #804 ยป 0001-New-commandline-options-W-portnumber-for-Webaccess-a.patch

Markus Madlener -, 2011-12-11 17:32

View differences:

src/avahi.c
55 55
static AvahiEntryGroup *group = NULL;
56 56
static char *name = NULL;
57 57

  
58
/*
59
 * Modified by [email protected] / 20.09.2011
60
 * Setable PORT for WebUI and HTSP-Streaming
61
 */
62
static long wwwport = 9981;
63
static long htspport = 9982;
64

  
58 65
static void create_services(AvahiClient *c);
59 66

  
60 67
static void
......
131 138
     tvhlog(LOG_DEBUG, "AVAHI", "Adding service '%s'", name);
132 139

  
133 140
    /* Add the service for HTSP */
141
	/*
142
	 * Modified by [email protected] / 20.09.2011
143
	 * Setable PORT for WebUI and HTSP-Streaming
144
	 */
134 145
    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
135 146
					     AVAHI_PROTO_UNSPEC, 0, name, 
136
					     "_htsp._tcp", NULL, NULL, 9982,
147
					     "_htsp._tcp", NULL, NULL, htspport,
137 148
					     NULL)) < 0) {
138 149

  
139 150
      if (ret == AVAHI_ERR_COLLISION)
......
147 158

  
148 159

  
149 160
    /* Add the service for HTTP */
161
	/*
162
	 * Modified by [email protected] / 20.09.2011
163
	 * Setable PORT for WebUI and HTSP-Streaming
164
	 */
150 165
    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
151 166
					     AVAHI_PROTO_UNSPEC, 0, name, 
152
					     "_http._tcp", NULL, NULL, 9981,
167
					     "_http._tcp", NULL, NULL, wwwport,
153 168
					     "path=/",
154 169
					     NULL)) < 0) {
155 170

  
......
264 279
/**
265 280
 *
266 281
 */
282
 /*
283
 * Modified by [email protected] / 20.09.2011
284
 * Setable PORT for WebUI and HTSP-Streaming
285
 */
267 286
void
268
avahi_init(void)
287
avahi_init(long www_port, long htsp_port)
269 288
{
289
  if (htsp_port > 0 && htsp_port <= 65536) htspport = htsp_port;
290
  if (www_port > 0 && www_port <= 65536) wwwport = www_port;
291
  	
270 292
  pthread_t tid;
271 293

  
272 294
  pthread_create(&tid, NULL, avahi_thread, NULL);
src/avahi.h
1
void avahi_init(void);
1
/*
2
/ [email protected]
3
*/
4
void avahi_init(long www_port, long htsp_port);
src/htsp.c
1341 1341
/**
1342 1342
 *  Fire up HTSP server
1343 1343
 */
1344
 /*
1345
 * Modified by [email protected] / 20.09.2011
1346
 * Setable PORT for WebUI and HTSP-Streaming
1347
 */
1348

  
1344 1349
void
1345
htsp_init(void)
1350
htsp_init(long htsp_port)
1346 1351
{
1347
  htsp_server = tcp_server_create(9982, htsp_serve, NULL);
1352
  htsp_server = tcp_server_create(htsp_port, htsp_serve, NULL);
1353
  tvhlog(LOG_NOTICE, "START", "Streaming is etablished on Port %d", htsp_port);
1348 1354
}
1349 1355

  
1350 1356
/**
src/htsp.h
22 22
#include "epg.h"
23 23
#include "dvr/dvr.h"
24 24

  
25
void htsp_init(void);
25
/*
26
 * Modified by [email protected] / 20.09.2011
27
 * Setable PORT for WebUI and HTSP-Streaming
28
 */
29
void htsp_init(long htsp_port);
26 30

  
27 31
void htsp_channel_update_current(channel_t *ch);
28 32

  
src/http.c
806 806
/**
807 807
 *  Fire up HTTP server
808 808
 */
809
/*
810
 * Modified by [email protected] / 20.09.2011
811
 * Setable PORT for WebUI and HTSP-Streaming
812
 */
809 813
void
810
http_server_init(void)
814
http_server_init(long www_port)
811 815
{
812
  http_server = tcp_server_create(9981, http_serve, NULL);
816
  http_server = tcp_server_create(www_port, http_serve, NULL);
817
  tvhlog(LOG_NOTICE, "START", "Webaccess is etablished on Port %d", www_port);
813 818
}
src/http.h
133 133

  
134 134

  
135 135

  
136
void http_server_init(void);
136
/*
137
 * Modified by [email protected] / 20.09.2011
138
 * Setable PORT for WebUI and HTSP-Streaming
139
 */
140
void http_server_init(long www_port);
137 141

  
138 142
int http_access_verify(http_connection_t *hc, int mask);
139 143

  
src/main.c
245 245
  char *p, *endp;
246 246
  uint32_t adapter_mask = 0xffffffff;
247 247
  int crash = 0;
248
/*
249
 * Modified by [email protected] / 20.09.2011
250
 * Setable PORT for WebUI and HTSP-Streaming
251
 */
252
  uint32_t htsp_port;
253
  uint32_t www_port;
254
  htsp_port = 9982;
255
  www_port = 9981;
248 256

  
249 257
  // make sure the timezone is set
250 258
  tzset();
251 259

  
252
  while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:s")) != -1) {
260
  while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:s:H:W:")) != -1) {
253 261
    switch(c) {
254 262
    case 'a':
255 263
      adapter_mask = 0x0;
......
304 312
    case 'j':
305 313
      join_transport = optarg;
306 314
      break;
315
	/*
316
	 * Modified by [email protected] / 20.09.2011
317
	 * Setable PORT for WebUI and HTSP-Streaming
318
	 */
319
    case 'H':
320
      htsp_port = atol(optarg);
321
      break;
322
    case 'W':
323
      www_port = atol(optarg);
324
      break;
307 325
    default:
308 326
      usage(argv[0]);
309 327
    }
......
385 403
#if ENABLE_V4L
386 404
  v4l_init();
387 405
#endif
388
  http_server_init();
406

  
407
/*
408
 * Modified by [email protected] / 20.09.2011
409
 * Setable PORT for WebUI and HTSP-Streaming
410
 */
411
  http_server_init(www_port);
389 412

  
390 413
  webui_init(TVHEADEND_CONTENT_PATH);
391 414

  
......
399 422

  
400 423
  dvr_init();
401 424

  
402
  htsp_init();
425
/*
426
 * Modified by [email protected] / 20.09.2011
427
 * Setable PORT for WebUI and HTSP-Streaming
428
 */
429
  htsp_init(htsp_port);
403 430

  
404 431
  ffdecsa_init();
405 432
  
......
410 437
    subscription_dummy_join(join_transport, 1);
411 438

  
412 439
#ifdef CONFIG_AVAHI
413
  avahi_init();
440
/*
441
 * Modified by [email protected] / 20.09.2011
442
 * Setable PORT for WebUI and HTSP-Streaming
443
 */
444
  avahi_init(www_port, htsp_port);
414 445
#endif
415 446

  
416 447
  pthread_mutex_unlock(&global_lock);
417
- 
    (1-1/1)