ircdを自分だけが使用し、大量に書き込みが許される状況では、ircdのExcess Floodの機能が非常に邪魔だ。
数キロバイトのテキストがircdに貯まるだけで、Excess Floodが発動し、強制ログアウトさせられる。
configで機能を削除する方法もあったが、とりあえずソースを弄って、Excess Floodの機能を削除した。
Excess Floodとmsg_readyエラーを削除する必要がある。
以下にソースを弄ったログを。
# less -N irc2.10.3p7+jp6/ircd/s_bsd.c
1935
1936 // READ ERROR キャンセル
1937
1938 /* ここからコメントアウト
1939 else if (msg_ready)
1940 return exit_client(cptr, cptr, &me, "msg_readyエラーいらね。");
1941 ここまで */
1942
1943 /*
1944 ** For server connections, we process as many as we can without
1945 ** worrying about the time of day or anything :)
1946 */
1947 if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr) ||
1948 IsService(cptr))
1949 {
1950 if (length > 0)
1951 {
1952 done = dopacket(cptr, readbuf, length);
1953 if (done && done != 2)
1954 return done;
1955 }
1956 }
1957 else
1958 {
1959 /*
1960 ** Before we even think of parsing what we just read, stick
1961 ** it on the end of the receive queue and do it when its
1962 ** turn comes around.
1963 */
1964 if (length && dbuf_put(&cptr->recvQ, readbuf, length) < 0)
1965 return exit_client(cptr, cptr, &me, "dbuf_put fail");
1966
1967 // Excess Flood キャンセル↓
1968 /* ここからコメントアウト
1969 if (IsPerson(cptr) &&
1970 DBufLength(&cptr->recvQ) > CLIENT_FLOOD)
1971 {
1972 cptr->exitc = EXITC_FLOOD;
1973 return exit_client(cptr, cptr, &me, "Excess Flood");
1974 }
1975 ここまで */
1976
1977
1978 return client_packet(cptr);
1979 }
1980 return 1;
1981 }
これで再コンパイルして、無事溢れることなく、大量のテキストをircdに投げることができた。
また、他の方法としては、config.hを弄る方法もある。
以下にそのログを。
# less -N irc2.10.3p7+jp6/i686-pc-linux-gnu/config.h 320 * CLIENT_FLOOD 321 * 322 * this controls the number of bytes the server will allow a client to 323 * send to the server without processing before disconnecting the client for 324 * flooding it. Values greater than 8000 make no difference to the server. 325 */ 326 #define CLIENT_FLOOD 10000000000 //←ここの値をでかく(バイト) ・ ・ 544 #if defined(CLIENT_FLOOD) 545 //# if (CLIENT_FLOOD < 8000) || (CLIENT_FLOOD > 512) ←この例外処理の範囲を 545 # if (CLIENT_FLOOD > 8000) || (CLIENT_FLOOD < 512) //←こんな風にでも変更 546 error CLIENT_FLOOD needs redefining. 547 # endif 548 #else 549 error CLIENT_FLOOD undefined 550 #endif
これでコンパイルしてもOKだったと思う。
前だったからちょいと忘れたけど・・・