lists.barton.de
Anmelden
Registrieren
Anmelden
Registrieren
Diese Liste verwalten
×
Tastenkürzel
Thread-Ansicht
j
: Nächste ungelesene Nachricht
k
: Vorherige ungelesene Nachricht
j a
: Zu allen Threads wechseln
j l
: Zur Listenübersicht springen
2025
April
März
Februar
Januar
2024
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2023
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2022
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2021
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2020
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2019
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2018
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2017
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2016
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2015
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2014
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2013
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2012
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2011
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2010
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2009
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2008
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2007
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2006
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2005
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Listenübersicht
Herunterladen
ngIRCd GIT Updates
April 2012
----- 2025 -----
April 2025
März 2025
Februar 2025
Januar 2025
----- 2024 -----
Dezember 2024
November 2024
Oktober 2024
September 2024
August 2024
Juli 2024
Juni 2024
Mai 2024
April 2024
März 2024
Februar 2024
Januar 2024
----- 2023 -----
Dezember 2023
November 2023
Oktober 2023
September 2023
August 2023
Juli 2023
Juni 2023
Mai 2023
April 2023
März 2023
Februar 2023
Januar 2023
----- 2022 -----
Dezember 2022
November 2022
Oktober 2022
September 2022
August 2022
Juli 2022
Juni 2022
Mai 2022
April 2022
März 2022
Februar 2022
Januar 2022
----- 2021 -----
Dezember 2021
November 2021
Oktober 2021
September 2021
August 2021
Juli 2021
Juni 2021
Mai 2021
April 2021
März 2021
Februar 2021
Januar 2021
----- 2020 -----
Dezember 2020
November 2020
Oktober 2020
September 2020
August 2020
Juli 2020
Juni 2020
Mai 2020
April 2020
März 2020
Februar 2020
Januar 2020
----- 2019 -----
Dezember 2019
November 2019
Oktober 2019
September 2019
August 2019
Juli 2019
Juni 2019
Mai 2019
April 2019
März 2019
Februar 2019
Januar 2019
----- 2018 -----
Dezember 2018
November 2018
Oktober 2018
September 2018
August 2018
Juli 2018
Juni 2018
Mai 2018
April 2018
März 2018
Februar 2018
Januar 2018
----- 2017 -----
Dezember 2017
November 2017
Oktober 2017
September 2017
August 2017
Juli 2017
Juni 2017
Mai 2017
April 2017
März 2017
Februar 2017
Januar 2017
----- 2016 -----
Dezember 2016
November 2016
Oktober 2016
September 2016
August 2016
Juli 2016
Juni 2016
Mai 2016
April 2016
März 2016
Februar 2016
Januar 2016
----- 2015 -----
Dezember 2015
November 2015
Oktober 2015
September 2015
August 2015
Juli 2015
Juni 2015
Mai 2015
April 2015
März 2015
Februar 2015
Januar 2015
----- 2014 -----
Dezember 2014
November 2014
Oktober 2014
September 2014
August 2014
Juli 2014
Juni 2014
Mai 2014
April 2014
März 2014
Februar 2014
Januar 2014
----- 2013 -----
Dezember 2013
November 2013
Oktober 2013
September 2013
August 2013
Juli 2013
Juni 2013
Mai 2013
April 2013
März 2013
Februar 2013
Januar 2013
----- 2012 -----
Dezember 2012
November 2012
Oktober 2012
September 2012
August 2012
Juli 2012
Juni 2012
Mai 2012
April 2012
März 2012
Februar 2012
Januar 2012
----- 2011 -----
Dezember 2011
November 2011
Oktober 2011
September 2011
August 2011
Juli 2011
Juni 2011
Mai 2011
April 2011
März 2011
Februar 2011
Januar 2011
----- 2010 -----
Dezember 2010
November 2010
Oktober 2010
September 2010
August 2010
Juli 2010
Juni 2010
Mai 2010
April 2010
März 2010
Februar 2010
Januar 2010
----- 2009 -----
Dezember 2009
November 2009
Oktober 2009
September 2009
August 2009
Juli 2009
Juni 2009
Mai 2009
April 2009
März 2009
Februar 2009
Januar 2009
----- 2008 -----
Dezember 2008
November 2008
Oktober 2008
September 2008
August 2008
Juli 2008
Juni 2008
Mai 2008
April 2008
März 2008
Februar 2008
Januar 2008
----- 2007 -----
Dezember 2007
November 2007
Oktober 2007
September 2007
August 2007
Juli 2007
Juni 2007
Mai 2007
April 2007
März 2007
Februar 2007
Januar 2007
----- 2006 -----
Dezember 2006
November 2006
Oktober 2006
September 2006
August 2006
Juli 2006
Juni 2006
Mai 2006
April 2006
März 2006
Februar 2006
Januar 2006
----- 2005 -----
Dezember 2005
November 2005
Oktober 2005
September 2005
August 2005
Juli 2005
Juni 2005
Mai 2005
April 2005
März 2005
ngircd-commits@lists.barton.de
1 Teilnehmer
22 Diskussionen
Einen n
N
euen Thread beginnen
Alexander Barton : IRC_Send_NAMES(): Code cleanup
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: f0a9dbe3ad59d3518f406f0b32a90246977ac58e URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=f0a9dbe3…
Author: Alexander Barton <alex(a)barton.de> Date: Sat Apr 28 00:20:42 2012 +0200 IRC_Send_NAMES(): Code cleanup --- src/ngircd/irc-info.c | 77 ++++++++++++++++++++++++++++--------------------- 1 files changed, 44 insertions(+), 33 deletions(-) diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index
…
[View More]
841e6e6..38b9a7d 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -1524,60 +1524,71 @@ IRC_Show_MOTD( CLIENT *Client ) } /* IRC_Show_MOTD */ +/** + * Send NAMES reply for a specific client and channel. + * + * @param Client The client requesting the NAMES information. + * @param Chan The channel + * @return CONNECTED or DISCONNECTED. + */ GLOBAL bool -IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan ) +IRC_Send_NAMES(CLIENT * Client, CHANNEL * Chan) { bool is_visible, is_member; char str[LINE_LEN + 1]; CL2CHAN *cl2chan; CLIENT *cl; - assert( Client != NULL ); - assert( Chan != NULL ); + assert(Client != NULL); + assert(Chan != NULL); - if( Channel_IsMemberOf( Chan, Client )) is_member = true; - else is_member = false; + if (Channel_IsMemberOf(Chan, Client)) + is_member = true; + else + is_member = false; /* Do not print info on channel memberships to anyone that is not member? */ if (Conf_MorePrivacy && !is_member) return CONNECTED; /* Secret channel? */ - if( ! is_member && strchr( Channel_Modes( Chan ), 's' )) return CONNECTED; - - /* Alle Mitglieder suchen */ - snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan )); - cl2chan = Channel_FirstMember( Chan ); - while( cl2chan ) - { - cl = Channel_GetClient( cl2chan ); + if (!is_member && strchr(Channel_Modes(Chan), 's')) + return CONNECTED; - if( strchr( Client_Modes( cl ), 'i' )) is_visible = false; - else is_visible = true; + snprintf(str, sizeof(str), RPL_NAMREPLY_MSG, Client_ID(Client), "=", + Channel_Name(Chan)); + cl2chan = Channel_FirstMember(Chan); + while (cl2chan) { + cl = Channel_GetClient(cl2chan); - if( is_member || is_visible ) - { - /* Nick anhaengen */ - if( str[strlen( str ) - 1] != ':' ) strlcat( str, " ", sizeof( str )); - if( strchr( Channel_UserModes( Chan, cl ), 'o' )) strlcat( str, "@", sizeof( str )); - else if( strchr( Channel_UserModes( Chan, cl ), 'v' )) strlcat( str, "+", sizeof( str )); - strlcat( str, Client_ID( cl ), sizeof( str )); + if (strchr(Client_Modes(cl), 'i')) + is_visible = false; + else + is_visible = true; - if( strlen( str ) > ( LINE_LEN - CLIENT_NICK_LEN - 4 )) - { - /* Zeile wird zu lang: senden! */ - if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED; - snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan )); + if (is_member || is_visible) { + if (str[strlen(str) - 1] != ':') + strlcat(str, " ", sizeof(str)); + if (strchr(Channel_UserModes(Chan, cl), 'o')) + strlcat(str, "@", sizeof(str)); + else if (strchr(Channel_UserModes(Chan, cl), 'v')) + strlcat(str, "+", sizeof(str)); + strlcat(str, Client_ID(cl), sizeof(str)); + + if (strlen(str) > (LINE_LEN - CLIENT_NICK_LEN - 4)) { + if (!IRC_WriteStrClient(Client, "%s", str)) + return DISCONNECTED; + snprintf(str, sizeof(str), RPL_NAMREPLY_MSG, + Client_ID(Client), "=", + Channel_Name(Chan)); } } - /* naechstes Mitglied suchen */ - cl2chan = Channel_NextMember( Chan, cl2chan ); + cl2chan = Channel_NextMember(Chan, cl2chan); } - if( str[strlen( str ) - 1] != ':') - { - /* Es sind noch Daten da, die gesendet werden muessen */ - if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED; + if (str[strlen(str) - 1] != ':') { + if (!IRC_WriteStrClient(Client, "%s", str)) + return DISCONNECTED; } return CONNECTED;
[View Less]
1
0
0
0
Alexander Barton : New function Client_CapSet() in addition to Client_Cap{Add|Del}
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: 245782897b4a8ca092a87bf6d3961cbda1dea962 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=24578289…
Author: Alexander Barton <alex(a)barton.de> Date: Fri Apr 27 23:56:56 2012 +0200 New function Client_CapSet() in addition to Client_Cap{Add|Del} --- src/ngircd/client-cap.c | 11 +++++++++++ src/ngircd/client-cap.h | 1 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/ngircd/client-cap.c
…
[View More]
b/src/ngircd/client-cap.c index edaf260..b0da807 100644 --- a/src/ngircd/client-cap.c +++ b/src/ngircd/client-cap.c @@ -38,6 +38,17 @@ Client_Cap(CLIENT *Client) } GLOBAL void +Client_CapSet(CLIENT *Client, int Cap) +{ + assert(Client != NULL); + assert(Cap >= 0); + + Client->capabilities = Cap; + LogDebug("Set new capability of \"%s\" to %d.", + Client_ID(Client), Client->capabilities); +} + +GLOBAL void Client_CapAdd(CLIENT *Client, int Cap) { assert(Client != NULL); diff --git a/src/ngircd/client-cap.h b/src/ngircd/client-cap.h index faec1c2..e477dc0 100644 --- a/src/ngircd/client-cap.h +++ b/src/ngircd/client-cap.h @@ -22,6 +22,7 @@ GLOBAL int Client_Cap PARAMS((CLIENT *Client)); +GLOBAL void Client_CapSet PARAMS((CLIENT *Client, int Cap)); GLOBAL void Client_CapAdd PARAMS((CLIENT *Client, int Cap)); GLOBAL void Client_CapDel PARAMS((CLIENT *Client, int Cap));
[View Less]
1
0
0
0
Alexander Barton : "CAP REQ" starts capability negotiation and delays user registration
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: 2327b17656b329d6210628f24c77f51533c05620 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=2327b176…
Author: Alexander Barton <alex(a)barton.de> Date: Fri Apr 27 22:47:22 2012 +0200 "CAP REQ" starts capability negotiation and delays user registration New helper function Set_CAP_Negotiation(). --- src/ngircd/irc-cap.c | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git
…
[View More]
a/src/ngircd/irc-cap.c b/src/ngircd/irc-cap.c index 956b359..c92a3f3 100644 --- a/src/ngircd/irc-cap.c +++ b/src/ngircd/irc-cap.c @@ -40,6 +40,9 @@ bool Handle_CAP_ACK PARAMS((CLIENT *Client, char *Arg)); bool Handle_CAP_CLEAR PARAMS((CLIENT *Client)); bool Handle_CAP_END PARAMS((CLIENT *Client)); +void Set_CAP_Negotiation PARAMS((CLIENT *Client)); + + /** * Handler for the IRCv3 "CAP" command. * @@ -96,10 +99,8 @@ Handle_CAP_LS(CLIENT *Client, UNUSED char *Arg) { assert(Client != NULL); - if (Client_Type(Client) != CLIENT_USER) - Client_CapAdd(Client, CLIENT_CAP_PENDING); + Set_CAP_Negotiation(Client); - Client_CapAdd(Client, CLIENT_CAP_SUPPORTED); return IRC_WriteStrClient(Client, "CAP %s LS :", Client_ID(Client)); } @@ -131,6 +132,8 @@ Handle_CAP_REQ(CLIENT *Client, char *Arg) assert(Client != NULL); assert(Arg != NULL); + Set_CAP_Negotiation(Client); + return IRC_WriteStrClient(Client, "CAP %s NAK :%s", Client_ID(Client), Arg); } @@ -189,4 +192,19 @@ Handle_CAP_END(CLIENT *Client) return CONNECTED; } +/** + * Set CAP negotiation status and mark client as "supports capabilities". + * + * @param Client The client to handle. + */ +void +Set_CAP_Negotiation(CLIENT *Client) +{ + assert(Client != NULL); + + if (Client_Type(Client) != CLIENT_USER) + Client_CapAdd(Client, CLIENT_CAP_PENDING); + Client_CapAdd(Client, CLIENT_CAP_SUPPORTED); +} + /* -eof- */
[View Less]
1
0
0
0
Alexander Barton : Correctly handle "CAP END", new client type CLIENT_WAITCAPEND
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: da4c1ebe81bbd1335356ef40c91741b953c9f8d8 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=da4c1ebe…
Author: Alexander Barton <alex(a)barton.de> Date: Sat Mar 31 16:37:31 2012 +0200 Correctly handle "CAP END", new client type CLIENT_WAITCAPEND --- src/ngircd/client.h | 1 + src/ngircd/irc-cap.c | 2 +- src/ngircd/login.c | 5 ++++- src/ngircd/parse.c | 2 +- 4 files changed, 7 insertions(+), 3
…
[View More]
deletions(-) diff --git a/src/ngircd/client.h b/src/ngircd/client.h index bdad9ce..4dbcc7a 100644 --- a/src/ngircd/client.h +++ b/src/ngircd/client.h @@ -29,6 +29,7 @@ #ifndef STRICT_RFC # define CLIENT_WAITAUTHPING 512 /* waiting for AUTH PONG from client */ #endif +#define CLIENT_WAITCAPEND 1024 /* waiting for "CAP END" command */ #define CLIENT_TYPE int diff --git a/src/ngircd/irc-cap.c b/src/ngircd/irc-cap.c index 926943c..956b359 100644 --- a/src/ngircd/irc-cap.c +++ b/src/ngircd/irc-cap.c @@ -180,7 +180,7 @@ Handle_CAP_END(CLIENT *Client) /* User is still logging in ... */ Client_CapDel(Client, CLIENT_CAP_PENDING); - if (Client_Type(Client) == CLIENT_GOTUSER) { + if (Client_Type(Client) == CLIENT_WAITCAPEND) { /* Only "CAP END" was missing: log in! */ return Login_User(Client); } diff --git a/src/ngircd/login.c b/src/ngircd/login.c index ad45219..3808997 100644 --- a/src/ngircd/login.c +++ b/src/ngircd/login.c @@ -80,8 +80,11 @@ Login_User(CLIENT * Client) #endif /* Still waiting for "CAP END" command? */ - if (Client_Cap(Client) & CLIENT_CAP_PENDING) + if (Client_Cap(Client) & CLIENT_CAP_PENDING) { + Client_SetType(Client, CLIENT_WAITCAPEND); + LogDebug("Connection %d: Waiting for CAP END ...", conn); return CONNECTED; + } #ifdef PAM if (!Conf_PAM) { diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 41e3872..66bfef5 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -114,7 +114,7 @@ static COMMAND My_Commands[] = { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, 0, 0 }, #endif #ifndef STRICT_RFC - { "CAP", IRC_CAP, CLIENT_UNKNOWN|CLIENT_GOTNICK|CLIENT_GOTPASS|CLIENT_GOTUSER|CLIENT_USER, 0, 0, 0 }, + { "CAP", IRC_CAP, 0xFFFF, 0, 0, 0 }, { "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 }, { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 }, #endif
[View Less]
1
0
0
0
Alexander Barton : Implement core IRC capability handling and "CAP" command
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: bd3a7ccb158c9f2eac1af77804529b76d99c3e79 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=bd3a7ccb…
Author: Alexander Barton <alex(a)barton.de> Date: Sat Mar 31 15:59:06 2012 +0200 Implement core IRC capability handling and "CAP" command This patch implements the core functions to support "IRC Capabilities" and the IRC "CAP" command as used by other servers and specified here: <
http://www.leeh.co.uk/draft-
…
[View More]
mitchell-irc-capabilities-02.html
>. It enables ngIRCd to support the defined handshake, but it doesn't implement any capabilities, so "CAP LS" and "CAP LIST" always return the empty set and "CAP REQ ..." always fails with "CAP NAK". --- contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj | 14 ++ doc/Capabilities.txt | 23 +++ doc/Makefile.am | 1 + src/ngircd/Makefile.am | 4 + src/ngircd/client-cap.c | 62 ++++++++ src/ngircd/client-cap.h | 28 ++++ src/ngircd/client.h | 3 +- src/ngircd/irc-cap.c | 192 +++++++++++++++++++++++ src/ngircd/irc-cap.h | 24 +++ src/ngircd/login.c | 5 + src/ngircd/messages.h | 1 + src/ngircd/parse.c | 2 + 12 files changed, 358 insertions(+), 1 deletions(-) Diff:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commitdiff;h=bd3a…
[View Less]
1
0
0
0
Alexander Barton : New "login" source file
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: edfcc2f9d5b796fd30f60138591e4f96d54cfcf6 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=edfcc2f9…
Author: Alexander Barton <alex(a)barton.de> Date: Sat Mar 31 15:38:46 2012 +0200 New "login" source file Rename Hello_User[_PostAuth] to Login_User[_PostAuth] and move it to the new login.c; and move cb_Read_Auth_Result(), too. This will enable further code to easily call Login_User() when required. --- contrib/
…
[View More]
MacOSX/ngIRCd.xcodeproj/project.pbxproj | 6 + src/ngircd/Makefile.am | 2 + src/ngircd/irc-login.c | 210 +-------------------- src/ngircd/login.c | 234 +++++++++++++++++++++++ src/ngircd/login.h | 25 +++ 5 files changed, 271 insertions(+), 206 deletions(-) Diff:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commitdiff;h=edfc…
[View Less]
1
0
0
0
Alexander Barton : Introduce_Client() => Client_Introduce(), and move it to client.c
by alex@arthur.barton.de
28 Apr '12
28 Apr '12
Module: ngircd.git Branch: master Commit: ee362b3bd2e31db4cb6b7832ca01e64a643f9b96 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ee362b3b…
Author: Alexander Barton <alex(a)barton.de> Date: Sat Mar 31 15:24:30 2012 +0200 Introduce_Client() => Client_Introduce(), and move it to client.c --- src/ngircd/client.c | 96 +++++++++++++++++++++++++++++++++++++++++++ src/ngircd/client.h | 4 +- src/ngircd/irc-login.c | 106 ++--------------------
…
[View More]
-------------------------- 3 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 7e28e8f..1b35684 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -37,6 +37,7 @@ #include "ngircd.h" #include "channel.h" #include "conf.h" +#include "conn-func.h" #include "hash.h" #include "irc-write.h" #include "log.h" @@ -69,6 +70,8 @@ static CLIENT *Init_New_Client PARAMS((CONN_ID Idx, CLIENT *Introducer, static void Destroy_UserOrService PARAMS((CLIENT *Client,const char *Txt, const char *FwdMsg, bool SendQuit)); +static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix, + void *i)); GLOBAL void Client_Init( void ) @@ -1142,6 +1145,46 @@ Client_Reject(CLIENT *Client, const char *Reason, bool InformClient) } +/** + * Introduce a new user or service client in the network. + * + * @param From Remote server introducing the client or NULL (local). + * @param Client New client. + * @param Type Type of the client (CLIENT_USER or CLIENT_SERVICE). + */ +GLOBAL void +Client_Introduce(CLIENT *From, CLIENT *Client, int Type) +{ + /* Set client type (user or service) */ + Client_SetType(Client, Type); + + if (From) { + if (Conf_IsService(Conf_GetServer(Client_Conn(From)), + Client_ID(Client))) + Client_SetType(Client, CLIENT_SERVICE); + LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).", + Client_TypeText(Client), Client_Mask(Client), + Client_Modes(Client), Client_ID(From), + Client_ID(Client_Introducer(Client)), + Client_Hops(Client), Client_Hops(Client) > 1 ? "s": ""); + } else { + Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).", + Client_TypeText(Client), Client_Mask(Client), + Client_Conn(Client)); + Log_ServerNotice('c', "Client connecting: %s (%s@%s) [%s] - %s", + Client_ID(Client), Client_User(Client), + Client_Hostname(Client), + Conn_IPA(Client_Conn(Client)), + Client_TypeText(Client)); + } + + /* Inform other servers */ + IRC_WriteStrServersPrefixFlag_CB(From, + From != NULL ? From : Client_ThisServer(), + '\0', cb_introduceClient, (void *)Client); +} /* Client_Introduce */ + + static unsigned long Count( CLIENT_TYPE Type ) { @@ -1361,6 +1404,59 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool } /* Destroy_UserOrService */ +/** + * Introduce a new user or service client to a remote server. + * + * This function differentiates between RFC1459 and RFC2813 server links and + * generates the appropriate commands to register the new user or service. + * + * @param To The remote server to inform. + * @param Prefix Prefix for the generated commands. + * @param data CLIENT structure of the new client. + */ +static void +cb_introduceClient(CLIENT *To, CLIENT *Prefix, void *data) +{ + CLIENT *c = (CLIENT *)data; + CONN_ID conn; + char *modes, *user, *host; + + modes = Client_Modes(c); + user = Client_User(c) ? Client_User(c) : "-"; + host = Client_Hostname(c) ? Client_Hostname(c) : "-"; + + conn = Client_Conn(To); + if (Conn_Options(conn) & CONN_RFC1459) { + /* RFC 1459 mode: separate NICK and USER commands */ + Conn_WriteStr(conn, "NICK %s :%d", Client_ID(c), + Client_Hops(c) + 1); + Conn_WriteStr(conn, ":%s USER %s %s %s :%s", + Client_ID(c), user, host, + Client_ID(Client_Introducer(c)), Client_Info(c)); + if (modes[0]) + Conn_WriteStr(conn, ":%s MODE %s +%s", + Client_ID(c), Client_ID(c), modes); + } else { + /* RFC 2813 mode: one combined NICK or SERVICE command */ + if (Client_Type(c) == CLIENT_SERVICE + && strchr(Client_Flags(To), 'S')) + IRC_WriteStrClientPrefix(To, Prefix, + "SERVICE %s %d * +%s %d :%s", + Client_Mask(c), + Client_MyToken(Client_Introducer(c)), + Client_Modes(c), Client_Hops(c) + 1, + Client_Info(c)); + else + IRC_WriteStrClientPrefix(To, Prefix, + "NICK %s %d %s %s %d +%s :%s", + Client_ID(c), Client_Hops(c) + 1, + user, host, + Client_MyToken(Client_Introducer(c)), + modes, Client_Info(c)); + } +} /* cb_introduceClient */ + + #ifdef DEBUG GLOBAL void diff --git a/src/ngircd/client.h b/src/ngircd/client.h index 7bb230b..def0549 100644 --- a/src/ngircd/client.h +++ b/src/ngircd/client.h @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2008 Alexander Barton (alex(a)barton.de) + * Copyright (c)2001-2012 Alexander Barton (alex(a)barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -165,6 +165,8 @@ GLOBAL const char *Client_TypeText PARAMS((CLIENT *Client)); GLOBAL void Client_Reject PARAMS((CLIENT *Client, const char *Reason, bool InformClient)); +GLOBAL void Client_Introduce PARAMS((CLIENT *From, CLIENT *Client, int Type)); + #ifdef DEBUG GLOBAL void Client_DebugDump PARAMS((void)); diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 133a0e5..53069f0 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -46,11 +46,6 @@ static bool Hello_User PARAMS(( CLIENT *Client )); static bool Hello_User_PostAuth PARAMS(( CLIENT *Client )); static void Kill_Nick PARAMS(( char *Nick, char *Reason )); -static void Introduce_Client PARAMS((CLIENT *To, CLIENT *Client, int Type)); - -static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix, - void *i)); - #ifdef PAM static void cb_Read_Auth_Result PARAMS((int r_fd, UNUSED short events)); #endif @@ -395,7 +390,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) Client_Mask(c)); Client_SetType(c, CLIENT_GOTNICK); } else - Introduce_Client(Client, c, CLIENT_USER); + Client_Introduce(Client, c, CLIENT_USER); return CONNECTED; } @@ -487,7 +482,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req) /* RFC 1459 style user registration? * Introduce client to network: */ if (Client_Type(c) == CLIENT_GOTNICK) - Introduce_Client(Client, c, CLIENT_USER); + Client_Introduce(Client, c, CLIENT_USER); return CONNECTED; } else if (Client_Type(Client) == CLIENT_USER) { @@ -601,7 +596,7 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req) return CONNECTED; } - Introduce_Client(Client, c, CLIENT_SERVICE); + Client_Introduce(Client, c, CLIENT_SERVICE); return CONNECTED; } /* IRC_SERVICE */ @@ -1057,7 +1052,7 @@ Hello_User_PostAuth(CLIENT *Client) if (Class_HandleServerBans(Client) != CONNECTED) return DISCONNECTED; - Introduce_Client(NULL, Client, CLIENT_USER); + Client_Introduce(NULL, Client, CLIENT_USER); if (!IRC_WriteStrClient (Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client))) @@ -1119,97 +1114,4 @@ Kill_Nick(char *Nick, char *Reason) } /* Kill_Nick */ -/** - * Introduce a new user or service client in the network. - * - * @param From Remote server introducing the client or NULL (local). - * @param Client New client. - * @param Type Type of the client (CLIENT_USER or CLIENT_SERVICE). - */ -static void -Introduce_Client(CLIENT *From, CLIENT *Client, int Type) -{ - /* Set client type (user or service) */ - Client_SetType(Client, Type); - - if (From) { - if (Conf_IsService(Conf_GetServer(Client_Conn(From)), - Client_ID(Client))) - Client_SetType(Client, CLIENT_SERVICE); - LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).", - Client_TypeText(Client), Client_Mask(Client), - Client_Modes(Client), Client_ID(From), - Client_ID(Client_Introducer(Client)), - Client_Hops(Client), Client_Hops(Client) > 1 ? "s": ""); - } else { - Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).", - Client_TypeText(Client), Client_Mask(Client), - Client_Conn(Client)); - Log_ServerNotice('c', "Client connecting: %s (%s@%s) [%s] - %s", - Client_ID(Client), Client_User(Client), - Client_Hostname(Client), - Conn_IPA(Client_Conn(Client)), - Client_TypeText(Client)); - } - - /* Inform other servers */ - IRC_WriteStrServersPrefixFlag_CB(From, - From != NULL ? From : Client_ThisServer(), - '\0', cb_introduceClient, (void *)Client); -} /* Introduce_Client */ - - -/** - * Introduce a new user or service client to a remote server. - * - * This function differentiates between RFC1459 and RFC2813 server links and - * generates the appropriate commands to register the new user or service. - * - * @param To The remote server to inform. - * @param Prefix Prefix for the generated commands. - * @param data CLIENT structure of the new client. - */ -static void -cb_introduceClient(CLIENT *To, CLIENT *Prefix, void *data) -{ - CLIENT *c = (CLIENT *)data; - CONN_ID conn; - char *modes, *user, *host; - - modes = Client_Modes(c); - user = Client_User(c) ? Client_User(c) : "-"; - host = Client_Hostname(c) ? Client_Hostname(c) : "-"; - - conn = Client_Conn(To); - if (Conn_Options(conn) & CONN_RFC1459) { - /* RFC 1459 mode: separate NICK and USER commands */ - Conn_WriteStr(conn, "NICK %s :%d", Client_ID(c), - Client_Hops(c) + 1); - Conn_WriteStr(conn, ":%s USER %s %s %s :%s", - Client_ID(c), user, host, - Client_ID(Client_Introducer(c)), Client_Info(c)); - if (modes[0]) - Conn_WriteStr(conn, ":%s MODE %s +%s", - Client_ID(c), Client_ID(c), modes); - } else { - /* RFC 2813 mode: one combined NICK or SERVICE command */ - if (Client_Type(c) == CLIENT_SERVICE - && strchr(Client_Flags(To), 'S')) - IRC_WriteStrClientPrefix(To, Prefix, - "SERVICE %s %d * +%s %d :%s", - Client_Mask(c), - Client_MyToken(Client_Introducer(c)), - Client_Modes(c), Client_Hops(c) + 1, - Client_Info(c)); - else - IRC_WriteStrClientPrefix(To, Prefix, - "NICK %s %d %s %s %d +%s :%s", - Client_ID(c), Client_Hops(c) + 1, - user, host, - Client_MyToken(Client_Introducer(c)), - modes, Client_Info(c)); - } -} /* cb_introduceClient */ - - /* -eof- */
[View Less]
1
0
0
0
Alexander Barton : Xcode: update project file for Xcode 4.3
by alex@arthur.barton.de
27 Apr '12
27 Apr '12
Module: ngircd.git Branch: master Commit: 359732af85e8566d919a2e0bc580a490ead49d9e URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=359732af…
Author: Alexander Barton <alex(a)barton.de> Date: Fri Apr 27 15:52:09 2012 +0200 Xcode: update project file for Xcode 4.3 (No changes needed) --- contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/contrib/MacOSX/ngIRCd.xcodeproj/project.
…
[View More]
pbxproj b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj index 289c2ed..affb329 100644 --- a/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj +++ b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj @@ -665,7 +665,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0430; }; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */; compatibilityVersion = "Xcode 3.2";
[View Less]
1
0
0
0
Alexander Barton : platformtest.sh: Detect Open64 C compiler
by alex@arthur.barton.de
24 Apr '12
24 Apr '12
Module: ngircd.git Branch: master Commit: 1dea0d91a0547fe5c0a9cb025b205cf1d9b1d3b8 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=1dea0d91…
Author: Alexander Barton <alex(a)barton.de> Date: Tue Apr 24 12:08:01 2012 +0200 platformtest.sh: Detect Open64 C compiler --- contrib/platformtest.sh | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/platformtest.sh b/contrib/platformtest.sh index 6449a67..201ed41 100755 -
…
[View More]
-- a/contrib/platformtest.sh +++ b/contrib/platformtest.sh @@ -96,9 +96,14 @@ if [ -r "Makefile" ]; then CC=$(grep "^CC = " Makefile | cut -d' ' -f3) $CC --version 2>&1 | grep -i "GCC" >/dev/null if [ $? -eq 0 ]; then - COMPILER=$($CC --version | head -1 \ - | cut -d')' -f2 | cut -d' ' -f2) - COMPILER="gcc $COMPILER" + $CC --version 2>&1 | grep -i "Open64" >/dev/null + if [ $? -eq 0 ]; then + COMPILER="Open64" + else + COMPILER=$($CC --version | head -1 \ + | cut -d')' -f2 | cut -d' ' -f2) + COMPILER="gcc $COMPILER" + fi else case "$CC" in gcc*)
[View Less]
1
0
0
0
Alexander Barton : Fix 8ec17063: "Lists_Add(): use size of destination when copying data"
by alex@arthur.barton.de
18 Apr '12
18 Apr '12
Module: ngircd.git Branch: master Commit: d67d077a711f21e722d969dc1bf7ab787042d70b URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=d67d077a…
Author: Alexander Barton <alex(a)barton.de> Date: Wed Apr 18 17:54:54 2012 +0200 Fix 8ec17063: "Lists_Add(): use size of destination when copying data" Thanks to Florian Westphal for spotting my silliness ... --- src/ngircd/lists.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/
…
[View More]
src/ngircd/lists.c b/src/ngircd/lists.c index 45a4874..5c6c52c 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -147,11 +147,8 @@ Lists_Add(struct list_head *h, const char *Mask, time_t ValidUntil, strlcpy(newelem->mask, Mask, sizeof(newelem->mask)); if (Reason) { - newelem->reason = malloc(strlen(Reason) + 1); - if (newelem->reason) - strlcpy(newelem->reason, Reason, - sizeof(newelem->reason)); - else + newelem->reason = strdup(Reason); + if (!newelem->reason) Log(LOG_EMERG, "Can't allocate memory for new list reason text!"); }
[View Less]
1
0
0
0
← Neuer
1
2
3
Älter →
Springe zur Seite:
1
2
3
Ergebnisse pro Seite:
10
25
50
100
200