... | ... |
@@ -61,7 +61,7 @@ MAIN_NAME=ser |
61 | 61 |
VERSION = 0 |
62 | 62 |
PATCHLEVEL = 10 |
63 | 63 |
SUBLEVEL = 99 |
64 |
-EXTRAVERSION = -dev22-tcp |
|
64 |
+EXTRAVERSION = -dev23-tcp |
|
65 | 65 |
|
66 | 66 |
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
67 | 67 |
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]") |
... | ... |
@@ -126,14 +126,14 @@ struct tcp_connection{ |
126 | 126 |
int flags; /* connection related flags */ |
127 | 127 |
enum tcp_conn_states state; /* connection state */ |
128 | 128 |
void* extra_data; /* extra data associated to the connection, 0 for tcp*/ |
129 |
- int timeout; /* connection timeout, after this it will be removed*/ |
|
129 |
+ unsigned int timeout;/* connection timeout, after this it will be removed*/ |
|
130 | 130 |
unsigned id_hash; /* hash index in the id_hash */ |
131 |
- int aliases; /* aliases number, at least 1 */ |
|
132 |
- struct tcp_conn_alias con_aliases[TCP_CON_MAX_ALIASES]; |
|
133 | 131 |
struct tcp_connection* id_next; /* next, prev in id hash table */ |
134 | 132 |
struct tcp_connection* id_prev; |
135 | 133 |
struct tcp_connection* c_next; /* child next prev (use locally) */ |
136 | 134 |
struct tcp_connection* c_prev; |
135 |
+ struct tcp_conn_alias con_aliases[TCP_CON_MAX_ALIASES]; |
|
136 |
+ int aliases; /* aliases number, at least 1 */ |
|
137 | 137 |
}; |
138 | 138 |
|
139 | 139 |
|
... | ... |
@@ -414,7 +414,6 @@ struct tcp_connection* tcpconn_new(int sock, union sockaddr_union* su, |
414 | 414 |
c->rcv.proto_reserved2=0; |
415 | 415 |
c->state=state; |
416 | 416 |
c->extra_data=0; |
417 |
- c->flags|=F_CONN_REMOVED; |
|
418 | 417 |
#ifdef USE_TLS |
419 | 418 |
if (type==PROTO_TLS){ |
420 | 419 |
if (tls_tcpconn_init(c, sock)==-1) goto error; |
... | ... |
@@ -423,11 +422,10 @@ struct tcp_connection* tcpconn_new(int sock, union sockaddr_union* su, |
423 | 422 |
{ |
424 | 423 |
c->type=PROTO_TCP; |
425 | 424 |
c->rcv.proto=PROTO_TCP; |
426 |
- c->flags=0; |
|
427 | 425 |
c->timeout=get_ticks()+tcp_con_lifetime; |
428 | 426 |
} |
429 |
- |
|
430 |
- |
|
427 |
+ c->flags|=F_CONN_REMOVED; |
|
428 |
+ |
|
431 | 429 |
tcp_connections_no++; |
432 | 430 |
return c; |
433 | 431 |
|
... | ... |
@@ -1014,8 +1012,8 @@ static inline int handle_new_connect(struct socket_info* si) |
1014 | 1012 |
tcpconn->refcnt++; /* safe, not yet available to the |
1015 | 1013 |
outside world */ |
1016 | 1014 |
tcpconn_add(tcpconn); |
1017 |
- DBG("handle_new_connect: new connection: %p %d\n", |
|
1018 |
- tcpconn, tcpconn->s); |
|
1015 |
+ DBG("handle_new_connect: new connection: %p %d flags: %04x\n", |
|
1016 |
+ tcpconn, tcpconn->s, tcpconn->flags); |
|
1019 | 1017 |
/* pass it to a child */ |
1020 | 1018 |
if(send2child(tcpconn)<0){ |
1021 | 1019 |
LOG(L_ERR,"ERROR: handle_new_connect: no children " |
... | ... |
@@ -1047,7 +1045,8 @@ static void tcpconn_destroy(struct tcp_connection* tcpconn) |
1047 | 1045 |
TCPCONN_LOCK; /*avoid races w/ tcp_send*/ |
1048 | 1046 |
tcpconn->refcnt--; |
1049 | 1047 |
if (tcpconn->refcnt==0){ |
1050 |
- DBG("tcpconn_destroy: destroying connection\n"); |
|
1048 |
+ DBG("tcpconn_destroy: destroying connection %p, flags %04x\n", |
|
1049 |
+ tcpconn, tcpconn->flags); |
|
1051 | 1050 |
fd=tcpconn->s; |
1052 | 1051 |
#ifdef USE_TLS |
1053 | 1052 |
/*FIXME: lock ->writelock ? */ |
... | ... |
@@ -1061,7 +1060,8 @@ static void tcpconn_destroy(struct tcp_connection* tcpconn) |
1061 | 1060 |
/* force timeout */ |
1062 | 1061 |
tcpconn->timeout=0; |
1063 | 1062 |
tcpconn->state=S_CONN_BAD; |
1064 |
- DBG("tcpconn_destroy: delaying ...\n"); |
|
1063 |
+ DBG("tcpconn_destroy: delaying (%p, flags %04x) ...\n", |
|
1064 |
+ tcpconn, tcpconn->flags); |
|
1065 | 1065 |
|
1066 | 1066 |
} |
1067 | 1067 |
TCPCONN_UNLOCK; |