- temp[t] = '\0';
- strlcpy(str,temp,MAXBUF);
- }
-}
-
-/* chop a string down to 512 characters and preserve linefeed (irc max
- * line length) */
-
-void chop(char* str)
-{
- if (!str)
- {
- log(DEBUG,"ERROR! Null string passed to chop()!");
- return;
- }
- string temp = str;
- FOREACH_MOD OnServerRaw(temp,false,NULL);
- const char* str2 = temp.c_str();
- snprintf(str,MAXBUF,"%s",str2);
- if (strlen(str) >= 512)
- {
- str[509] = '\r';
- str[510] = '\n';
- str[511] = '\0';
- }
-}
-
-
-void Blocking(int s)
-{
- int flags;
- log(DEBUG,"Blocking: %d",s);
- flags = fcntl(s, F_GETFL, 0);
- fcntl(s, F_SETFL, flags ^ O_NONBLOCK);
-}
-
-void NonBlocking(int s)
-{
- int flags;
- log(DEBUG,"NonBlocking: %d",s);
- flags = fcntl(s, F_GETFL, 0);
- fcntl(s, F_SETFL, flags | O_NONBLOCK);
-}
-
-int CleanAndResolve (char *resolvedHost, const char *unresolvedHost)
-{
- DNS d(DNSServer);
- int fd = d.ReverseLookup(unresolvedHost);
- if (fd < 1)