From 6125b6bc5204a618e6fc8976600332a423bd0fc0 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 23 Nov 2006 15:33:51 +0000 Subject: - Made WFIFOHEAD() check for available buffer size remaining on the connection, and when there's not enough space, it will increase it. - Added define TURBO to the Makefile. It enables MouseJstr's socket access optimization which should speed up the code when accessing the write/read buffers repeatedly within a function. - Fixed the functions where the RFIFOHEAD/WFIFOHEAD functions were used incorrectly (prevents TURBO enabled compilations from finishing) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9297 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common/socket.c') diff --git a/src/common/socket.c b/src/common/socket.c index 2e52b079f..f7cb5d33b 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -701,7 +701,8 @@ int WFIFOSET(int fd,int len) unsigned char *sin_addr = (unsigned char *)&s->client_addr.sin_addr; ShowFatalError("socket: Buffer Overflow. Connection %d (%d.%d.%d.%d) has written %d byteson a %d/%d bytes buffer.\n", fd, sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3], len, s->wdata_size, s->max_wdata); - ShowDebug("Likely command that caused it: 0x%x\n", WFIFOW(fd,0)); + ShowDebug("Likely command that caused it: 0x%x\n", + (*(unsigned short*)(s->wdata+s->wdata_size))); // no other chance, make a better fifo model exit(1); } -- cgit v1.2.3-70-g09d2