- Timestamp:
- 2015-03-15T14:41:48Z (10 years ago)
- Children:
- b4e96d6
- Parents:
- e6ef4a8
- git-author:
- dequis <dx@…> (13-03-15 09:28:36)
- git-committer:
- dequis <dx@…> (15-03-15 14:41:48)
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.h
re6ef4a8 rc408298 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
re6ef4a8 rc408298 166 166 } 167 167 168 void msn_queue_feed(struct msn_data *h, char *bytes, int st) 169 { 170 h->rxq = g_renew(char, h->rxq, h->rxlen + 1024); 171 memcpy(h->rxq + h->rxlen, bytes, st); 172 h->rxlen += st; 173 174 if (getenv("BITLBEE_DEBUG")) { 175 fprintf(stderr, "\n\x1b[92m<<< "); 176 write(2, bytes , st); 177 fprintf(stderr, "\x1b[97m"); 178 } 179 } 180 168 181 /* This one handles input from a MSN Messenger server. Both the NS and SB servers usually give 169 182 commands, but sometimes they give additional data (payload). This function tries to handle … … 176 189 int msn_handler(struct msn_data *h) 177 190 { 178 struct im_connection *ic = h->ic; 179 int st; 180 181 h->rxq = g_renew(char, h->rxq, h->rxlen + 1024); 182 st = read(h->fd, h->rxq + h->rxlen, 1024); 183 h->rxlen += st; 184 185 if (st <= 0) { 186 fprintf(stderr, "\n\x1b[92m<<< [closed]\x1b[97m "); 187 return(-1); 188 } 189 190 if (getenv("BITLBEE_DEBUG")) { 191 fprintf(stderr, "\n\x1b[92m<<< "); 192 write(2, h->rxq + h->rxlen - st, st); 193 fprintf(stderr, "\x1b[97m"); 194 } 191 int st = 1; 195 192 196 193 while (st) { -
protocols/msn/ns.c
re6ef4a8 rc408298 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.