diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-24 12:41:38 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-24 12:41:38 +0000 |
commit | 16d301eb02e84f03df387db15750e4cb52beaf9f (patch) | |
tree | f45264671d0eaf0af9d8d5ea00b2c74af36dffa9 /src/common | |
parent | 269579a5d2ec5df0841c94158102228bc1634d97 (diff) | |
download | hercules-16d301eb02e84f03df387db15750e4cb52beaf9f.tar.gz hercules-16d301eb02e84f03df387db15750e4cb52beaf9f.tar.bz2 hercules-16d301eb02e84f03df387db15750e4cb52beaf9f.tar.xz hercules-16d301eb02e84f03df387db15750e4cb52beaf9f.zip |
- Added all the missing FIFOHEADs in the login/sql servers (required for TURBO support)
- Fixed the fact that the TURBO code breaks when you attempt to handle more than one connection at a time within the same function. However this broke map-server compilation, therefore, don't use TURBO yet! It needs more fixing (and I need more time to fix it)
- While at it, cleaned a few packet implementations in the char/login servers which were not only ugly, but had some really stupid flaws within (stuff like escaping a string, and then using the non-escaped variable to insert to SQL? T_T) And will someone explain me why the TXT servers are coded much more cleanly, and without such horribly broken code as I find in the SQL ones? T_T;
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9307 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/socket.c | 1 | ||||
-rw-r--r-- | src/common/socket.h | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index f7cb5d33b..1273677b6 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -877,7 +877,6 @@ int do_parsepacket(void) continue;
}
}
- RFIFOHEAD(i);
RFIFOFLUSH(i);
}
return 0;
diff --git a/src/common/socket.h b/src/common/socket.h index 02badae3f..ae13353b2 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -26,8 +26,8 @@ extern time_t stall_time; #define RFIFOSPACE(fd) (session[fd]->max_rdata-session[fd]->rdata_size)
#ifdef TURBO
-#define RFIFOHEAD(fd) char *rbPtr = session[fd]->rdata+session[fd]->rdata_pos
-#define RFIFOP(fd,pos) (&rbPtr[pos])
+#define RFIFOHEAD(fd) char *rbPtr ## fd = session[fd]->rdata+session[fd]->rdata_pos
+#define RFIFOP(fd,pos) (&rbPtr ## fd[pos])
#else
//Make it a comment so it does not disrupts the rest of code.
#define RFIFOHEAD(fd) //
@@ -55,8 +55,8 @@ extern time_t stall_time; #define WFIFOSPACE(fd) (session[fd]->max_wdata-session[fd]->wdata_size)
#ifdef TURBO
-#define WFIFOHEAD(fd, x) char *wbPtr = session[fd]->wdata+session[fd]->wdata_size;
-#define WFIFOP(fd,pos) (&wbPtr[pos])
+#define WFIFOHEAD(fd, x) char *wbPtr ## fd = fd?(session[fd]->wdata+session[fd]->wdata_size):0;
+#define WFIFOP(fd,pos) (&wbPtr ## fd[pos])
#else
#define WFIFOHEAD(fd, size) { if((fd) && session[fd]->wdata_size + (size) > session[fd]->max_wdata ) realloc_writefifo(fd, size); }
|