diff options
Diffstat (limited to 'net/napshare/files/patch-aa')
-rw-r--r-- | net/napshare/files/patch-aa | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/net/napshare/files/patch-aa b/net/napshare/files/patch-aa index c498607f721f..9468ac402c57 100644 --- a/net/napshare/files/patch-aa +++ b/net/napshare/files/patch-aa @@ -8,3 +8,122 @@ #include "interface.h" #include "support.h" +--- src/search.c.orig Fri May 25 18:52:42 2001 ++++ src/search.c Wed Dec 12 16:33:52 2001 +@@ -14,17 +14,17 @@ + + // Known Vendor Codes for reference + +-#define BearShareType 'BEAR' +-#define GnotellaType 'GNOT' +-#define GnucleusType 'GNUC' +-#define LimeWireType 'LIME' +-#define MactellaType 'MACT' +-#define ToadNodeType 'TOAD' +-#define GnutType 'GNUT' +-#define GtkGnutellaType 'GTKG' +-#define NapShareType 'NAPS' ++#define BearShareType "BEAR" ++#define GnotellaType "GNOT" ++#define GnucleusType "GNUC" ++#define LimeWireType "LIME" ++#define MactellaType "MACT" ++#define ToadNodeType "TOAD" ++#define GnutType "GNUT" ++#define GtkGnutellaType "GTKG" ++#define NapShareType "NAPS" + // Open Cola Folders Client +-#define OCFoldersType 'OCFG' ++#define OCFoldersType "OCFG" + + // some temp strings + static gchar stmp_1[4096]; +@@ -907,15 +907,13 @@ + GSList *l, *next; + gchar *titles[5], info[400], vendor[100], temp[6]; + struct record *rc; +- guint32 row,i,t; ++ guint32 row,i; + + vendor[0] = 0; + rs->status = 0; +- if (rs->trailer) { // we have trailer information, decode the vendor specific info +- READ_GUINT32_BE((rs->trailer + 1), t); // put it into a int for easy compare +- switch (t) // remember to skip rs->trailer length byte at [0] +- { +- case GtkGnutellaType: // got Gtk-Gnutella trailer, handle it ++ if (rs->trailer) { ++ // we have trailer information, decode the vendor specific info ++ if ( !strncasecmp ( rs->trailer + 1, GtkGnutellaType, 4 )) { + strcat(vendor,"GtkGnut"); // format bit 3= has uploaded, 2= busy, 0= need push + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 1) && (rs->trailer[6] & 0x04)) +@@ -923,54 +921,48 @@ + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag + // if (dbg > 4) printf("TRAILER=%.4X\n",rs->status); // use for testing +- break; + +- case NapShareType: // got NapShare trailer, handle it ++ } else if ( !strncasecmp ( rs->trailer + 1, NapShareType, 4 )) { + strcat(vendor,"NapShare"); // format bit 3= has uploaded, 2= busy, 0= need push + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 1) && (rs->trailer[6] & 0x04)) + rs->status = rs->status | 0x02; // bit 1, busy flag + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag +- break; + +- case LimeWireType: // got LimeWire trailer, handle it ++ } else if ( !strncasecmp ( rs->trailer + 1, LimeWireType, 4 )) { + strcat(vendor,"Lime"); // Not sure, but should be like bearshare + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 2) && (rs->trailer[7] & 0x04)) + rs->status = rs->status | 0x02; // bit 1, busy flag + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag +- break; + +- case BearShareType: // got Bearshare trailer, handle it ++ } else if ( !strncasecmp ( rs->trailer + 1, BearShareType, 4 )) { + strcat(vendor,"Bear"); // Protocol doc says how to decode the bytes, but I cheat + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 2) && (rs->trailer[7] & 0x04)) + rs->status = rs->status | 0x02; // bit 1, busy flag + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag +- break; + +- case GnotellaType: // got Gnotella trailer, handle it ++ } else if ( !strncasecmp ( rs->trailer + 1, GnotellaType, 4 )) { + strcat(vendor,"Gnot"); // same as bearshare + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 2) && (rs->trailer[7] & 0x04)) + rs->status = rs->status | 0x02; // bit 1, busy flag + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag +- break; + +- case GnucleusType: // got Gnucleus trailer, handle it ++ } else if ( !strncasecmp ( rs->trailer + 1, GnucleusType, 4 )) { + strcat(vendor,"Gnuc"); // same as bearshare + rs->status = rs->status | 0x80; // bit 7, known vendor flag + if ((rs->trailer[5] == 2) && (rs->trailer[7] & 0x04)) + rs->status = rs->status | 0x02; // bit 1, busy flag + if ((rs->trailer[5] > 0) && (rs->trailer[6] & 0x01)) + rs->status = rs->status | 0x01; // bit 0, firewall flag +- break; + +- default: ++ } else { + temp[0] = 0; + for (i=0;i<4;i++) { // unknown type, do we have all alpha ? + if (isalpha(rs->trailer[i+1])) temp[i] = rs->trailer[i+1]; +@@ -981,7 +973,6 @@ + } + temp[4] = 0; // terminate + strcat(vendor,temp); +- break; + } // close switch statement + } // if trailer + if (rs->status & 0x02) strcat(vendor,",Busy"); |