ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/parse.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/parse.c (file contents):
Revision 3504 by michael, Sat May 10 19:51:29 2014 UTC vs.
Revision 3614 by michael, Thu May 22 18:40:26 2014 UTC

# Line 104 | Line 104 | static char *para[MAXPARA + 2]; /* <comm
104  
105   static int cancel_clients(struct Client *, struct Client *, char *);
106   static void remove_unknown(struct Client *, char *, char *);
107 < static void handle_numeric(char[], struct Client *, int, char *[]);
107 > static void handle_numeric(unsigned int, struct Client *, int, char *[]);
108   static void handle_command(struct Message *, struct Client *, unsigned int, char *[]);
109  
110  
# Line 120 | Line 120 | parse(struct Client *client_p, char *pbu
120    struct Message *msg_ptr = NULL;
121    char *ch = NULL;
122    char *s = NULL;
123 <  char *numeric = NULL;
123 >  unsigned int numeric = 0;
124    unsigned int parc = 0;
125    unsigned int paramcount;
126  
# Line 194 | Line 194 | parse(struct Client *client_p, char *pbu
194    if (*(ch + 3) == ' ' && /* ok, lets see if its a possible numeric.. */
195        IsDigit(*ch) && IsDigit(*(ch + 1)) && IsDigit(*(ch + 2)))
196    {
197 <    numeric = ch;
197 >    numeric = (*ch - '0') * 100 + (*(ch + 1) - '0') * 10 + (*(ch + 2) - '0');
198      paramcount = 2;  /* destination, and the rest of it */
199      ++ServerStats.is_num;
200      s = ch + 3;  /* I know this is ' ' from above if            */
# Line 468 | Line 468 | mod_del_cmd(struct Message *msg)
468   {
469    assert(msg && msg->cmd);
470  
471 +  if (!msg_tree_parse(msg->cmd))
472 +    return;
473 +
474    del_msg_element(&msg_tree, msg->cmd);
475   }
476  
# Line 612 | Line 615 | remove_unknown(struct Client *client_p,
615                           "Unknown prefix (%s) from %s, Squitting %s",
616                           lbuffer, client_p->name, lsender);
617      sendto_one(client_p, ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
618 <               me.name, lsender, lbuffer, client_p->name);
618 >               me.id, lsender, lbuffer, client_p->name);
619    }
620    else
621      sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)",
622 <               me.name, lsender, me.name);
622 >               me.id, lsender, me.name);
623   }
624  
625   /*
# Line 641 | Line 644 | remove_unknown(struct Client *client_p,
644   * the savvy approach is NEVER generate an error in response to an... error :)
645   */
646   static void
647 < handle_numeric(char numeric[], struct Client *source_p, int parc, char *parv[])
647 > handle_numeric(unsigned int numeric, struct Client *source_p, int parc, char *parv[])
648   {
649    struct Client *target_p = NULL;
650    struct Channel *chptr = NULL;
# Line 676 | Line 679 | handle_numeric(char numeric[], struct Cl
679     * remotely - but the information they contain may be useful, so we
680     * remap them up. Weird, but true.  -- Isomer
681     */
682 <  if (numeric[0] == '0')
683 <    numeric[0] = '1';
682 >  if (numeric < 100)
683 >    numeric += 100;
684  
685    if (target_p)
686    {
687      /* Fake it for server hiding, if its our client */
688      if (ConfigServerHide.hide_servers && MyClient(target_p) &&
689          !HasUMode(target_p, UMODE_OPER))
690 <      sendto_one(target_p, ":%s %s %s %s", me.name, numeric, target_p->name, parv[2]);
690 >      sendto_one_numeric(target_p, &me, numeric|SND_EXPLICIT, "%s", parv[2]);
691      else
692 <      sendto_one(target_p, ":%s %s %s %s", ID_or_name(source_p, target_p),
690 <                 numeric, ID_or_name(target_p, target_p), parv[2]);
692 >      sendto_one_numeric(target_p, source_p, numeric|SND_EXPLICIT, "%s", parv[2]);
693    }
694    else
695 <    sendto_channel_butone(source_p, source_p, chptr, 0, "%s %s %s",
695 >    sendto_channel_butone(source_p, source_p, chptr, 0, "%u %s %s",
696                            numeric, chptr->chname, parv[2]);
697   }
698  

Diff Legend

– Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)