Changeset cf02dd6 for libfaim/conn.c
- Timestamp:
- Dec 10, 2003, 3:20:45 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- b1fe407
- Parents:
- 8c46404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/conn.c
re374dee rcf02dd6 192 192 193 193 /** 194 * aim_connrst - Clears out connection list, killing remaining connections. 195 * @sess: Session to be cleared 196 * 197 * Clears out the connection list and kills any connections left. 198 * 194 * Clears out connection list, killing remaining connections. 195 * 196 * @param sess Session to be cleared 199 197 */ 200 198 static void aim_connrst(aim_session_t *sess) … … 218 216 219 217 /** 220 * aim_conn_init - Reset a connection to default values. 221 * @deadconn: Connection to be reset 222 * 218 * Reset a connection to default values. 223 219 * Initializes and/or resets a connection structure. 224 220 * 221 * @param deadconn Connection to be reset 225 222 */ 226 223 static void aim_conn_init(aim_conn_t *deadconn) … … 533 530 fd = socket(hp->h_addrtype, SOCK_STREAM, 0); 534 531 535 if (sess-> flags & AIM_SESS_FLAGS_NONBLOCKCONNECT)532 if (sess->nonblocking) 536 533 fcntl(fd, F_SETFL, O_NONBLOCK); /* XXX save flags */ 537 534 538 535 if (connect(fd, (struct sockaddr *)&sa, sizeof(struct sockaddr_in)) < 0) { 539 if (sess-> flags & AIM_SESS_FLAGS_NONBLOCKCONNECT) {536 if (sess->nonblocking) { 540 537 if ((errno == EINPROGRESS) || (errno == EINTR)) { 541 538 if (statusret) … … 853 850 854 851 /** 855 * aim_session_init - Initializes a session structure 856 * @sess: Session to initialize 857 * @flags: Flags to use. Any of %AIM_SESS_FLAGS %OR'd together. 858 * @debuglevel: Level of debugging output (zero is least) 859 * 860 * Sets up the initial values for a session. 861 * 862 */ 863 faim_export void aim_session_init(aim_session_t *sess, fu32_t flags, int debuglevel) 852 * Initializes a session structure by setting the initial values 853 * stuff in the aim_session_t struct. 854 * 855 * @param sess Session to initialize. 856 * @param nonblocking Set to true if you want connections to be non-blocking. 857 * @param debuglevel Level of debugging output (zero is least). 858 */ 859 faim_export void aim_session_init(aim_session_t *sess, bool nonblocking, int debuglevel) 864 860 { 865 861 … … 873 869 aim_initsnachash(sess); 874 870 sess->msgcookies = NULL; 875 sess->icq_info = NULL; 876 sess->oft_info = NULL; 877 sess->snacid_next = 0x00000001; 878 879 sess->flags = 0; 871 sess->nonblocking = nonblocking; 880 872 sess->debug = debuglevel; 881 873 sess->debugcb = defaultdebugcb; 882 883 874 sess->modlistv = NULL; 884 875 sess->snacid_next = 0x00000001; 876 877 sess->locate.userinfo = NULL; 878 sess->locate.torequest = NULL; 879 sess->locate.requested = NULL; 880 sess->locate.waiting_for_response = FALSE; 885 881 sess->ssi.received_data = 0; 886 882 sess->ssi.numitems = 0; … … 890 886 sess->ssi.timestamp = (time_t)0; 891 887 sess->ssi.waiting_for_ack = 0; 892 888 sess->icq_info = NULL; 893 889 sess->authinfo = NULL; 894 890 sess->emailinfo = NULL; 895 896 /* 897 * Default to SNAC login unless XORLOGIN is explicitly set. 898 */ 899 if (!(flags & AIM_SESS_FLAGS_XORLOGIN)) 900 sess->flags |= AIM_SESS_FLAGS_SNACLOGIN; 901 sess->flags |= flags; 891 sess->oft_info = NULL; 902 892 903 893 /* … … 907 897 aim_tx_setenqueue(sess, AIM_TX_QUEUED, NULL); 908 898 909 910 899 /* 911 900 * Register all the modules for this session... 912 901 */ 913 902 aim__registermodule(sess, misc_modfirst); /* load the catch-all first */ 914 aim__registermodule(sess, general_modfirst);903 aim__registermodule(sess, service_modfirst); 915 904 aim__registermodule(sess, locate_modfirst); 916 905 aim__registermodule(sess, buddylist_modfirst); … … 926 915 aim__registermodule(sess, chatnav_modfirst); 927 916 aim__registermodule(sess, chat_modfirst); 928 /* aim__registermodule(sess, odir_modfirst); */ /* kretch */929 /* aim__registermodule(sess, bart_modfirst); */ /* kretch */917 aim__registermodule(sess, odir_modfirst); 918 aim__registermodule(sess, bart_modfirst); 930 919 /* missing 0x11 - 0x12 */ 931 920 aim__registermodule(sess, ssi_modfirst); … … 1058 1047 aim_tx_enqueue(sess, fr); 1059 1048 1049 /* clean out SNACs over 60sec old */ 1050 aim_cleansnacs(sess, 60); 1051 1060 1052 return 0; 1061 1053 }
Note: See TracChangeset
for help on using the changeset viewer.