Changeset a4be2f6 for protocols/msn
- Timestamp:
- 2015-04-10T17:10:41Z (10 years ago)
- Branches:
- master
- Children:
- 913a663
- Parents:
- 3b09b38
- git-author:
- dequis <dx@…> (13-03-15 09:28:36)
- git-committer:
- dequis <dx@…> (10-04-15 17:10:41)
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.h
r3b09b38 ra4be2f6 248 248 int msn_buddy_list_remove(struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *group); 249 249 void msn_buddy_ask(bee_user_t *bu); 250 void msn_queue_feed(struct msn_data *h, char *bytes, int st); 250 251 int msn_handler(struct msn_data *h); 251 252 char *msn_p11_challenge(char *challenge); -
protocols/msn/msn_util.c
r3b09b38 ra4be2f6 172 172 } 173 173 174 void msn_queue_feed(struct msn_data *h, char *bytes, int st) 175 { 176 h->rxq = g_renew(char, h->rxq, h->rxlen + 1024); 177 memcpy(h->rxq + h->rxlen, bytes, st); 178 h->rxlen += st; 179 180 if (getenv("BITLBEE_DEBUG")) { 181 fprintf(stderr, "\n\x1b[92m<<< "); 182 write(2, bytes , st); 183 fprintf(stderr, "\x1b[97m"); 184 } 185 } 186 174 187 /* This one handles input from a MSN Messenger server. Both the NS and SB servers usually give 175 188 commands, but sometimes they give additional data (payload). This function tries to handle … … 182 195 int msn_handler(struct msn_data *h) 183 196 { 184 struct im_connection *ic = h->ic; 185 int st; 186 187 h->rxq = g_renew(char, h->rxq, h->rxlen + 1024); 188 st = read(h->fd, h->rxq + h->rxlen, 1024); 189 h->rxlen += st; 190 191 if (st <= 0) { 192 fprintf(stderr, "\n\x1b[92m<<< [closed]\x1b[97m "); 193 return(-1); 194 } 195 196 if (getenv("BITLBEE_DEBUG")) { 197 fprintf(stderr, "\n\x1b[92m<<< "); 198 write(2, h->rxq + h->rxlen - st, st); 199 fprintf(stderr, "\x1b[97m"); 200 } 197 int st = 1; 201 198 202 199 while (st) { -
protocols/msn/ns.c
r3b09b38 ra4be2f6 148 148 struct msn_data *handler = data; 149 149 struct im_connection *ic = handler->ic; 150 151 if (msn_handler(handler) == -1) { /* Don't do this on ret == 0, it's already done then. */ 150 char bytes[1024]; 151 int st; 152 153 st = read(handler->fd, bytes, 1024); 154 if (st <= 0) { 152 155 imcb_error(ic, "Error while reading from server"); 153 156 imc_logout(ic, TRUE); 154 155 157 return FALSE; 156 } else { 157 return TRUE; 158 } 158 } 159 160 msn_queue_feed(handler, bytes, st); 161 162 /* Ignore ret == 0, it's already disconnected then. */ 163 msn_handler(handler); 164 165 return TRUE; 166 159 167 } 160 168
Note: See TracChangeset
for help on using the changeset viewer.