1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 04:23:12 +02:00

Added ZIP_LINKS: using flag FLAGS_ZIP (0x1000000, was FLAGS_UNOCCUP2),

instead of using a 2nd flag here for the special case of "the first zip msg"
like in hybrid/etc I use cptr->zip->first to flag that. Except for the many
#ifdef ZIP_LINKS blocks added I also had to do some stuff outside it, like
crc32->our_crc32 because zlib defines it, made a READBUF define (8192),
added a msg var to parsing/send functions.. blah.. etc ;P.
I've also put the patch online at www.vulnscan.org/tmp/zip_links.diff so you
can easily look what I've changed.
TODO: ask in ./Config if ziplinks should be enabled and let ./configure check
for zlib + add the library to IRCDLIBS in Makefile if enabled.
TODO: some little code cleanups
This commit is contained in:
Bram Matthys
2003-01-28 02:50:19 +00:00
parent d0dc13faa5
commit 482df3dce3
16 changed files with 289 additions and 42 deletions
+1
View File
@@ -335,5 +335,6 @@ TS now;
#endif
#endif
#define READBUF_SIZE 8192
#endif /* __common_include__ */
+9
View File
@@ -516,6 +516,15 @@
*/
#undef FAST_BADWORD_REPLACE
/*
* Enable zipped links? [EXPERIMENTAL]
*/
#undef ZIP_LINKS
/* If you use ziplinks, you can define the compression level here,
* higher=better compressed but more CPU time, can be 1-9, but 1-4 is suggested.
*/
#define ZIP_LEVEL 2
/* ------------------------- END CONFIGURATION SECTION -------------------- */
#define MOTD MPATH
#define RULES RPATH
+1 -1
View File
@@ -521,7 +521,7 @@ extern char *oflagstr(long oflag);
extern int rehash(aClient *cptr, aClient *sptr, int sig);
extern int _match(char *mask, char *name);
extern void outofmemory(void);
extern unsigned long crc32(const unsigned char *s, unsigned int len);
extern unsigned long our_crc32(const unsigned char *s, unsigned int len);
extern int add_listener2(ConfigItem_listen *conf);
extern void link_cleanup(ConfigItem_link *link_ptr);
extern void listen_cleanup();
+16 -1
View File
@@ -127,6 +127,10 @@ typedef struct SMember Member;
typedef struct SMembership Membership;
typedef struct SMembershipL MembershipL;
#ifdef ZIP_LINKS
typedef struct Zdata aZdata;
#endif
#ifdef NEED_U_INT32_T
typedef unsigned int u_int32_t; /* XXX Hope this works! */
#endif
@@ -279,7 +283,9 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define FLAGS_NETINFO 0x200000
#define FLAGS_HYBNOTICE 0x400000
#define FLAGS_QUARANTINE 0x800000
#define FLAGS_UNOCCUP2 0x1000000
#ifdef ZIP_LINKS
#define FLAGS_ZIP 0x1000000
#endif
#define FLAGS_UNOCCUP3 0x2000000
#define FLAGS_SHUNNED 0x4000000
#ifdef USE_SSL
@@ -383,6 +389,11 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define IsSecure(x) (0)
#endif
#ifdef ZIP_LINKS
#define IsZipped(x) ((x)->flags & FLAGS_ZIP)
#define IsZipStart(x) (((x)->flags & FLAGS_ZIP) && ((x)->zip->first == 1))
#endif
#define IsHybNotice(x) ((x)->flags & FLAGS_HYBNOTICE)
#define SetHybNotice(x) ((x)->flags |= FLAGS_HYBNOTICE)
#define ClearHybNotice(x) ((x)->flags &= ~FLAGS_HYBNOTICE)
@@ -441,6 +452,10 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define ClearHidden(x) ((x)->umodes &= ~UMODE_HIDE)
#define ClearHideOper(x) ((x)->umodes &= ~UMODE_HIDEOPER)
#ifdef ZIP_LINKS
#define SetZipped(x) ((x)->flags |= FLAGS_ZIP)
#define ClearZipped(x) ((x)->flags &= ~FLAGS_ZIP)
#endif
/*
* ProtoCtl options
+1
View File
@@ -43,6 +43,7 @@ struct Zdata {
char outbuf[ZIP_MAXIMUM]; /* outgoing (unzipped) buffer */
int incount; /* size of inbuf content */
int outcount; /* size of outbuf content */
int first; /* First message? */
};
#endif /* ZIP_LINKS */