File Conn.c changed (mode: 100644) (index 304e689..110c6e5) |
... |
... |
int Conn_init(const unsigned int max) |
170 |
170 |
Conn_max = max; |
Conn_max = max; |
171 |
171 |
|
|
172 |
172 |
Conn_no = 0; |
Conn_no = 0; |
|
173 |
|
Conn_work_to_do = 0; |
173 |
174 |
Conn_total = 0; |
Conn_total = 0; |
174 |
175 |
Conn_max_reached = 0; |
Conn_max_reached = 0; |
175 |
176 |
gettimeofday(&Conn_now, NULL); |
gettimeofday(&Conn_now, NULL); |
|
... |
... |
static void Conn_free_intern(struct Conn *C) |
321 |
322 |
|
|
322 |
323 |
/* Decrement the number of busy connections */ |
/* Decrement the number of busy connections */ |
323 |
324 |
Conn_no--; |
Conn_no--; |
|
325 |
|
Conn_work_to_do--; |
324 |
326 |
} |
} |
325 |
327 |
} |
} |
326 |
328 |
|
|
|
... |
... |
struct Conn *Conn_alloc(void) |
446 |
448 |
C->id = Conn_id++; |
C->id = Conn_id++; |
447 |
449 |
|
|
448 |
450 |
Conn_no++; |
Conn_no++; |
|
451 |
|
/* Conn_work_to_do will not be incremented here, only in commit! */ |
449 |
452 |
|
|
450 |
453 |
Log(10, "\tFound free slot=%u, id=%llu. Now Conn_no=%d\n", |
Log(10, "\tFound free slot=%u, id=%llu. Now Conn_no=%d\n", |
451 |
454 |
C->slot, C->id, Conn_no); |
C->slot, C->id, Conn_no); |
|
... |
... |
int Conn_commit(struct Conn *C) |
682 |
685 |
|
|
683 |
686 |
C->state = first_state; |
C->state = first_state; |
684 |
687 |
|
|
|
688 |
|
Conn_work_to_do++; |
|
689 |
|
|
685 |
690 |
return 0; |
return 0; |
686 |
691 |
|
|
687 |
692 |
out_free_fd: |
out_free_fd: |
|
... |
... |
static void Conn_accept(struct Conn *C) |
851 |
856 |
else if (Conn_accept_cb != NULL) |
else if (Conn_accept_cb != NULL) |
852 |
857 |
Conn_accept_cb(X); |
Conn_accept_cb(X); |
853 |
858 |
|
|
|
859 |
|
Conn_work_to_do++; |
|
860 |
|
|
854 |
861 |
Conn_total++; |
Conn_total++; |
855 |
862 |
} |
} |
856 |
863 |
|
|
|
... |
... |
int Conn_poll(const int timeout) |
1311 |
1318 |
int timeout2; |
int timeout2; |
1312 |
1319 |
unsigned int i, last; |
unsigned int i, last; |
1313 |
1320 |
|
|
1314 |
|
Log(11, "%s: timeout=%d Conn_no=%d)\n", |
|
1315 |
|
__FUNCTION__, timeout, Conn_no); |
|
|
1321 |
|
Log(9, "%s: timeout=%d Conn_no=%d, Conn_work_to_do=%u)\n", |
|
1322 |
|
__FUNCTION__, timeout, Conn_no, Conn_work_to_do); |
1316 |
1323 |
|
|
1317 |
1324 |
if (timeout == -1) |
if (timeout == -1) |
1318 |
1325 |
timeout2 = 1000; |
timeout2 = 1000; |
|
... |
... |
int Conn_poll(const int timeout) |
1323 |
1330 |
if (Conn_must_stop == 1) |
if (Conn_must_stop == 1) |
1324 |
1331 |
return 0; |
return 0; |
1325 |
1332 |
|
|
1326 |
|
if (Conn_no == 0) |
|
|
1333 |
|
if (Conn_work_to_do == 0) { |
|
1334 |
|
Log(9, "%s: work_to_do is 0, so return 0!\n", |
|
1335 |
|
__FUNCTION__); |
1327 |
1336 |
return 0; |
return 0; |
|
1337 |
|
} |
1328 |
1338 |
|
|
1329 |
1339 |
if (Conn_pending > 0) |
if (Conn_pending > 0) |
1330 |
1340 |
Conn_trytoconnect(); |
Conn_trytoconnect(); |
File Conn_engine_core.c changed (mode: 100644) (index c05d5a7..34e68f8) |
... |
... |
unsigned int Conn_max_send = 32 * 1024; |
35 |
35 |
unsigned int Conn_max_recv = 32 * 1024; |
unsigned int Conn_max_recv = 32 * 1024; |
36 |
36 |
|
|
37 |
37 |
unsigned int Conn_no = 0; |
unsigned int Conn_no = 0; |
|
38 |
|
unsigned int Conn_work_to_do = 0; |
38 |
39 |
unsigned int Conn_max = 0; |
unsigned int Conn_max = 0; |
39 |
40 |
unsigned long Conn_total = 0; |
unsigned long Conn_total = 0; |
40 |
41 |
unsigned int Conn_start = 0; |
unsigned int Conn_start = 0; |
File Conn_engine_core.h changed (mode: 100644) (index da7262d..bf5b921) |
... |
... |
extern unsigned int Conn_default_obuf; |
232 |
232 |
extern unsigned int Conn_max_ibuf; |
extern unsigned int Conn_max_ibuf; |
233 |
233 |
extern unsigned int Conn_max_obuf; |
extern unsigned int Conn_max_obuf; |
234 |
234 |
extern unsigned int Conn_no; |
extern unsigned int Conn_no; |
|
235 |
|
extern unsigned int Conn_work_to_do; |
235 |
236 |
extern unsigned int Conn_max; |
extern unsigned int Conn_max; |
236 |
237 |
extern unsigned long Conn_total; |
extern unsigned long Conn_total; |
237 |
238 |
extern unsigned int Conn_start; |
extern unsigned int Conn_start; |