Kaynağa Gözat

pass conn_info to all messages instead of file descriptor.
this requires removing the connection structure and replacing
with the conn_info structure.

(Logical change 1.24)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@70 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 21 yıl önce
ebeveyn
işleme
2efdb4258c
1 değiştirilmiş dosya ile 4 ekleme ve 6 silme
  1. 4 6
      exec/main.h

+ 4 - 6
exec/main.h

@@ -84,7 +84,8 @@ struct outq_item {
 
 
 #define SIZEINB MESSAGE_SIZE_MAX
 #define SIZEINB MESSAGE_SIZE_MAX
 
 
-struct connection {
+struct conn_info {
+	int fd;				/* File descriptor for this connection */
 	int active;			/* Does this file descriptor have an active connection */
 	int active;			/* Does this file descriptor have an active connection */
 	char *inb;			/* Input buffer for non-blocking reads */
 	char *inb;			/* Input buffer for non-blocking reads */
 	int inb_nextheader;	/* Next message header starts here */
 	int inb_nextheader;	/* Next message header starts here */
@@ -95,19 +96,16 @@ struct connection {
 	enum socket_service_type service;/* Type of service so dispatch knows how to route message */
 	enum socket_service_type service;/* Type of service so dispatch knows how to route message */
 	struct saAmfComponent *component;	/* Component for which this connection relates to  TODO shouldn't this be in the ci structure */
 	struct saAmfComponent *component;	/* Component for which this connection relates to  TODO shouldn't this be in the ci structure */
 	int authenticated;		/* Is this connection authenticated? */
 	int authenticated;		/* Is this connection authenticated? */
+	struct list_head conn_list;
 	struct ais_ci ais_ci;	/* libais connection information */
 	struct ais_ci ais_ci;	/* libais connection information */
 };
 };
 
 
-extern int connection_entries;
-
-extern struct connection *connections;
-
 extern struct sockaddr_in this_ip;
 extern struct sockaddr_in this_ip;
 
 
 poll_handle aisexec_poll_handle;
 poll_handle aisexec_poll_handle;
 
 
 extern struct gmi_groupname aisexec_groupname;
 extern struct gmi_groupname aisexec_groupname;
 
 
-extern int libais_send_response (int s, void *msg, int mlen);
+extern int libais_send_response (struct conn_info *conn_info, void *msg, int mlen);
 
 
 #endif /* AIS_EXEC_H_DEFINED */
 #endif /* AIS_EXEC_H_DEFINED */