Module: sip-router Branch: andrei/tcp_tls_changes Commit: 3bcc0056930ddf5ab5f8a3da65de9628fe9b1f48 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3bcc0056...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Tue Mar 23 17:54:12 2010 +0100
tcp: comments & new internal command
- commented the enum conn_cmds members - added new cmd. CONN_NOP
---
tcp_conn.h | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/tcp_conn.h b/tcp_conn.h index 46ab702..bedaf4d 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -98,11 +98,26 @@ enum tcp_conn_states { S_CONN_ERROR=-2, S_CONN_BAD=-1,
/* fd communication commands */ -enum conn_cmds { CONN_DESTROY=-3, CONN_ERROR=-2, CONN_EOF=-1, CONN_RELEASE, - CONN_GET_FD, CONN_NEW, CONN_QUEUED_WRITE, - CONN_NEW_PENDING_WRITE, CONN_NEW_COMPLETE }; +enum conn_cmds { + CONN_DESTROY=-3 /* destroy connection & auto-dec. refcnt */, + CONN_ERROR=-2 /* error on connection & auto-dec. refcnt */, + CONN_EOF=-1 /* eof received or conn. closed & auto-dec refcnt */, + CONN_NOP=0 /* do-nothing (invalid for tcp_main) */, + CONN_RELEASE /* release a connection from tcp_read back into tcp_main + & auto-dec refcnt */, + CONN_GET_FD /* request a fd from tcp_main */, + CONN_NEW /* update/set a fd int a new tcp connection; refcnts are + not touched */, + CONN_QUEUED_WRITE /* new write queue: start watching the fd for write & + auto-dec refcnt */, + CONN_NEW_PENDING_WRITE /* like CONN_NEW+CONN_QUEUED_WRITE: set fd and + start watching it for write (write queue + non-empty); refcnts are not touced */, + CONN_NEW_COMPLETE /* like CONN_NEW_PENDING_WRITE, but there is no + pending write (the write queue might be empty) */ +}; /* CONN_RELEASE, EOF, ERROR, DESTROY can be used by "reader" processes - * CONN_GET_FD, NEW, ERROR only by writers */ + * CONN_GET_FD, CONN_NEW*, CONN_QUEUED_WRITE only by writers */
struct tcp_req{ struct tcp_req* next;