- Timestamp:
- Mar 10, 2014, 12:13:22 PM (11 years ago)
- Branches:
- master
- Children:
- fe81e9a
- Parents:
- e80f9fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
icb.c
re80f9fc r7882a6f 43 43 */ 44 44 void 45 icb_init(struct icbd_callbacks *ic) 46 { 47 icb_drop = ic->drop; 48 icb_log = ic->log; 49 icb_send = ic->send; 50 45 icb_init(void) 46 { 51 47 LIST_INIT(&groups); 52 48 … … 98 94 if (strlen(cmd) > 0 && cmd[0] == 'w') { 99 95 icb_error(is, "Command not implemented"); 100 icb _drop(is, NULL);96 icbd_drop(is, NULL); 101 97 return; 102 98 } 103 99 if (strlen(cmd) == 0 || strcmp(cmd, "login") != 0) { 104 100 icb_error(is, "Malformed login packet"); 105 icb _drop(is, NULL);101 icbd_drop(is, NULL); 106 102 return; 107 103 } … … 152 148 icb_vis(is->nick, nick, ICB_MAXNICKLEN, VIS_SP)) { 153 149 icb_error(is, "Invalid nick"); 154 icb _drop(is, NULL);150 icbd_drop(is, NULL); 155 151 return; 156 152 } … … 166 162 if (!creategroups) { 167 163 icb_error(is, "Invalid group %s", group); 168 icb _drop(is, NULL);164 icbd_drop(is, NULL); 169 165 return; 170 166 } else { … … 173 169 return; 174 170 } 175 icb _log(NULL, LOG_DEBUG, "%s created group %s",171 icbd_log(NULL, LOG_DEBUG, "%s created group %s", 176 172 is->nick, group); 177 173 } … … 180 176 if (strcmp(s->nick, is->nick) == 0) { 181 177 icb_error(is, "Nick is already in use"); 182 icb _drop(is, NULL);178 icbd_drop(is, NULL); 183 179 return; 184 180 } … … 238 234 if (s == is) 239 235 continue; 240 icb _send(s, buf, buflen + 1);236 icbd_send(s, buf, buflen + 1); 241 237 } 242 238 } … … 321 317 break; 322 318 default: 323 icb _log(is, LOG_ERR, "unknown cmdout type");319 icbd_log(is, LOG_ERR, "unknown cmdout type %d", type); 324 320 return; 325 321 } … … 367 363 buf[0] = buflen; 368 364 va_end(ap); 369 icb _send(is, buf, buflen + 1);365 icbd_send(is, buf, buflen + 1); 370 366 } 371 367 … … 390 386 } 391 387 logger(ig->name, "", buf); 392 icb _log(NULL, LOG_DEBUG, "%s", buf);388 icbd_log(NULL, LOG_DEBUG, "%s", buf); 393 389 va_end(ap); 394 390 } … … 409 405 buf[0] = ++buflen; /* account for ICB_M_ERROR */ 410 406 buf[1] = ICB_M_ERROR; 411 icb _send(is, buf, buflen + 1);412 icb _log(is, LOG_DEBUG, "%s", buf + 2);407 icbd_send(is, buf, buflen + 1); 408 icbd_log(is, LOG_DEBUG, "%s", buf + 2); 413 409 } 414 410 … … 620 616 va_end(ap); 621 617 buf[0] = buflen; 622 icb _send(is, buf, buflen + 1);618 icbd_send(is, buf, buflen + 1); 623 619 } 624 620
Note:
See TracChangeset
for help on using the changeset viewer.