- Timestamp:
- 03/02/18 12:40:23 (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-gbox-remm.c
r11399 r11401 258 258 if (!cli || !cli->gbox || !er) { return; } 259 259 int32_t i; 260 time_t now;261 260 uchar mbuf[1024]; 262 261 struct s_client *cl = cur_client(); … … 288 287 { au_caid = er->caid; } 289 288 290 time(&now); 289 if(cl->lastcaid != er->caid) 290 { cl->disable_counter = 0; } 291 292 cl->lastcaid = er->caid; 293 cl->disable_counter++; 294 295 if (cl->disable_counter < 6) //delay 5 ecm 296 { return; } 297 291 298 if(!memcmp(cl->lastserial, aureader->hexserial, 8)) 292 299 { 293 if(llabs(now - cl->last) < 180)294 { return; }300 cl->disable_counter = 0; 301 return; 295 302 } 296 303 297 304 memcpy(cl->lastserial, aureader->hexserial, 8); 298 cl->last = now;299 305 300 306 if(au_caid) 301 {cl->disable_counter = 0; }302 else if(cl->disable_counter > 2)307 { cl->disable_counter = 0; } 308 else 303 309 { return; } 304 else305 { cl->disable_counter++; }306 310 307 311 memset(mbuf, 0, sizeof(mbuf)); 308 312 309 313 uint16_t local_gbox_id = gbox_get_local_gbox_id(); 310 314 uint32_t local_gbox_pw = gbox_get_local_gbox_password(); 311 315 312 316 gbox_message_header(mbuf, MSG_REM_EMM, peer->gbox.password, local_gbox_pw); 313 317 mbuf[10] = MSGID_REMM_REQ; … … 325 329 } 326 330 else 327 { 328 i2b_buf(4, er->prid, mbuf +17); 329 } 330 331 i2b_buf(2, er->pid, mbuf +21); 332 333 if(au_caid) 334 { 331 { i2b_buf(4, er->prid, mbuf +17); } 332 333 i2b_buf(2, er->pid, mbuf +21); 335 334 i2b_buf(2, au_caid, mbuf +23); 336 335 memcpy(mbuf +29, aureader->hexserial, 6); // serial 6 bytes … … 363 362 cs_log_dump_dbg(D_EMM, mbuf, 122, "<- send remm request, (data_len=%d):", 122); 364 363 gbox_send(cli, mbuf, 122); 365 } 366 return; 364 return; 367 365 } 368 366 -
trunk/module-gbox.c
r11399 r11401 1334 1334 { return -1; } 1335 1335 1336 //clients may timeout - dettach from peer's gbox/reader1337 cli->gbox = NULL;1338 cli->reader = NULL;1339 1336 return 0; 1340 1337 } … … 1859 1856 int32_t hostname_len = 0; 1860 1857 if (cfg.gbox_hostname) 1861 hostname_len = strlen(cfg.gbox_hostname);1858 { hostname_len = strlen(cfg.gbox_hostname); } 1862 1859 int32_t len = hostname_len + 22; 1863 1860 if(proxy->gbox && proxy->typ == 'p')
Note:
See TracChangeset
for help on using the changeset viewer.