Mercurial > pidgin
annotate libfaim/aim_snac.c @ 1388:7dc0a8bb4dcb
[gaim-migrate @ 1398]
Pounce stuff is not sensitive if it doesnt need to be.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 05 Jan 2001 09:13:13 +0000 |
parents | 920c86b753d7 |
children |
rev | line source |
---|---|
2 | 1 |
2 /* | |
3 * | |
4 * Various SNAC-related dodads... | |
5 * | |
6 * outstanding_snacs is a list of aim_snac_t structs. A SNAC should be added | |
7 * whenever a new SNAC is sent and it should remain in the list until the | |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
8 * response for it has been receieved. |
2 | 9 * |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
10 * cleansnacs() should be called periodically by the client in order |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
11 * to facilitate the aging out of unreplied-to SNACs. This can and does |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
12 * happen, so it should be handled. |
2 | 13 * |
14 */ | |
15 | |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
16 #include <faim/aim.h> |
2 | 17 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
18 /* |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
19 * Called from aim_session_init() to initialize the hash. |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
20 */ |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
21 faim_internal void aim_initsnachash(struct aim_session_t *sess) |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
22 { |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
23 int i; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
24 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
25 for (i = 0; i < FAIM_SNAC_HASH_SIZE; i++) { |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
26 sess->snac_hash[i] = NULL; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
27 faim_mutex_init(&sess->snac_hash_locks[i]); |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
28 } |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
29 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
30 return; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
31 } |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
32 |
1248
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
33 faim_internal unsigned long aim_cachesnac(struct aim_session_t *sess, |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
34 const unsigned short family, |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
35 const unsigned short type, |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
36 const unsigned short flags, |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
37 const void *data, const int datalen) |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
38 { |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
39 struct aim_snac_t snac; |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
40 |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
41 snac.id = sess->snac_nextid++; |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
42 snac.family = family; |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
43 snac.type = type; |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
44 snac.flags = flags; |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
45 |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
46 snac.data = malloc(datalen); |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
47 memcpy(snac.data, data, datalen); |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
48 |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
49 return aim_newsnac(sess, &snac); |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
50 } |
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1217
diff
changeset
|
51 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
52 /* |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
53 * Clones the passed snac structure and caches it in the |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
54 * list/hash. |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
55 */ |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
56 faim_internal unsigned long aim_newsnac(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
57 struct aim_snac_t *newsnac) |
237 | 58 { |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
59 struct aim_snac_t *snac = NULL; |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
60 int index; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
61 |
237 | 62 if (!newsnac) |
63 return 0; | |
64 | |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
715
diff
changeset
|
65 if (!(snac = calloc(1, sizeof(struct aim_snac_t)))) |
237 | 66 return 0; |
67 memcpy(snac, newsnac, sizeof(struct aim_snac_t)); | |
68 snac->issuetime = time(&snac->issuetime); | |
69 snac->next = NULL; | |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
70 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
71 index = snac->id % FAIM_SNAC_HASH_SIZE; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
72 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
73 faim_mutex_lock(&sess->snac_hash_locks[index]); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
715
diff
changeset
|
74 snac->next = sess->snac_hash[index]; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
715
diff
changeset
|
75 sess->snac_hash[index] = snac; |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
76 faim_mutex_unlock(&sess->snac_hash_locks[index]); |
237 | 77 |
78 return(snac->id); | |
2 | 79 } |
80 | |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
81 /* |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
82 * Finds a snac structure with the passed SNAC ID, |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
83 * removes it from the list/hash, and returns a pointer to it. |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
84 * |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
85 * The returned structure must be freed by the caller. |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
86 * |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
87 */ |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
88 faim_internal struct aim_snac_t *aim_remsnac(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
89 u_long id) |
237 | 90 { |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
715
diff
changeset
|
91 struct aim_snac_t *cur = NULL; |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
92 int index; |
237 | 93 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
94 index = id % FAIM_SNAC_HASH_SIZE; |
237 | 95 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
96 faim_mutex_lock(&sess->snac_hash_locks[index]); |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
97 if (!sess->snac_hash[index]) |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
98 ; |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
99 else if (sess->snac_hash[index]->id == id) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
100 cur = sess->snac_hash[index]; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
101 sess->snac_hash[index] = cur->next; |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
102 } else { |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
103 cur = sess->snac_hash[index]; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
104 while (cur->next) { |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
105 if (cur->next->id == id) { |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
106 struct aim_snac_t *tmp; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
107 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
108 tmp = cur->next; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
109 cur->next = cur->next->next; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
110 cur = tmp; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
111 break; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
112 } |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
113 cur = cur->next; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
114 } |
237 | 115 } |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
116 faim_mutex_unlock(&sess->snac_hash_locks[index]); |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
117 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
118 return cur; |
2 | 119 } |
120 | |
121 /* | |
122 * This is for cleaning up old SNACs that either don't get replies or | |
123 * a reply was never received for. Garabage collection. Plain and simple. | |
124 * | |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
125 * maxage is the _minimum_ age in seconds to keep SNACs. |
2 | 126 * |
127 */ | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
128 faim_internal int aim_cleansnacs(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
129 int maxage) |
2 | 130 { |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
131 int i; |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
132 |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
133 for (i = 0; i < FAIM_SNAC_HASH_SIZE; i++) { |
1217
1e7625916fa7
[gaim-migrate @ 1227]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
134 struct aim_snac_t *cur = NULL, *next = NULL, *prev = NULL; |
1e7625916fa7
[gaim-migrate @ 1227]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
135 time_t curtime; |
1e7625916fa7
[gaim-migrate @ 1227]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
136 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
137 faim_mutex_lock(&sess->snac_hash_locks[i]); |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
138 if (!sess->snac_hash[i]) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
139 faim_mutex_unlock(&sess->snac_hash_locks[i]); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
140 continue; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
141 } |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
142 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
143 curtime = time(NULL); /* done here in case we waited for the lock */ |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
144 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
145 cur = sess->snac_hash[i]; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
146 while (cur) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
147 next = cur->next; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
148 if ((curtime - cur->issuetime) > maxage) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
149 if (sess->snac_hash[i] == cur) |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
150 prev = sess->snac_hash[i] = next; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
151 else |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
152 prev->next = next; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
153 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
154 /* XXX should we have destructors here? */ |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
155 if (cur->data) |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
156 free(cur->data); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
157 free(cur); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
158 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
159 } else { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
160 prev = cur; |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
161 } |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
162 cur = next; |
2 | 163 } |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
164 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
165 faim_mutex_unlock(&sess->snac_hash_locks[i]); |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
166 } |
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
167 |
2 | 168 return 0; |
169 } | |
170 | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
171 faim_internal int aim_putsnac(u_char *buf, int family, int subtype, int flags, u_long snacid) |
2 | 172 { |
173 int curbyte = 0; | |
237 | 174 curbyte += aimutil_put16(buf+curbyte, (u_short)(family&0xffff)); |
175 curbyte += aimutil_put16(buf+curbyte, (u_short)(subtype&0xffff)); | |
176 curbyte += aimutil_put16(buf+curbyte, (u_short)(flags&0xffff)); | |
177 curbyte += aimutil_put32(buf+curbyte, snacid); | |
2 | 178 return curbyte; |
179 } |