diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-10-11 15:05:50 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-10-11 15:05:50 +0000 |
commit | d02633af4e780c4b6f6d938c67d84d2c968adb79 (patch) | |
tree | 3379b9615e285346ad6b1f87639912e01ecd44c7 /source/q_fifo.h | |
parent | f8abe42a0d1a42653b39f6cf320d3fbdd1279bb3 (diff) |
Major redesign of GTV protocol: added support for persistent GTV connections,
bidirectional pinging, low traffic (`suspended') modes.
HTTP server is now gone (remote console logging is temporary gone too),
custom binary protocol is used for GTV connections now.
MVD client no longer serves other MVD clients, only regular spectators.
Changed FIFO buffers to be regular circular buffers, not BIP-buffers.
Removed `sv_http_*', `sv_console_auth' variables.
Added `sv_mvd_maxclients' variable, `addgtvhost', `delgtvhost' and
`listgtvhosts' commands.
Renamed `sv_mvd_max*' cvars for consistency.
Reset `sv_ghostime' default value back to 6, but changed semantics:
it now waits for any packet from client, not just `begin' packet.
Added `--disable-mvd-server' and `--disable-mvd-client' options to
configure script.
FS_Restart() no longer chokes on real files opened for reading.
Fixed client chat prompt length.
Stubbed out more debugging stuff from dedicated server builds.
Diffstat (limited to 'source/q_fifo.h')
-rw-r--r-- | source/q_fifo.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/q_fifo.h b/source/q_fifo.h index 9d70bce..3bb5124 100644 --- a/source/q_fifo.h +++ b/source/q_fifo.h @@ -28,21 +28,21 @@ typedef struct { size_t ax, ay, bs; } fifo_t; -static inline void *FIFO_Reserve( fifo_t *fifo, size_t *reserved ) { +static inline void *FIFO_Reserve( fifo_t *fifo, size_t *len ) { size_t tail; if( fifo->bs ) { - *reserved = fifo->ax - fifo->bs; + *len = fifo->ax - fifo->bs; return fifo->data + fifo->bs; } tail = fifo->size - fifo->ay; - if( fifo->ax < tail ) { - *reserved = tail; + if( tail ) { + *len = tail; return fifo->data + fifo->ay; } - *reserved = fifo->ax; + *len = fifo->ax; return fifo->data; } @@ -55,7 +55,7 @@ static inline void FIFO_Commit( fifo_t *fifo, size_t len ) { } tail = fifo->size - fifo->ay; - if( fifo->ax < tail ) { + if( tail ) { fifo->ay += len; return; } @@ -112,3 +112,5 @@ static inline qboolean FIFO_TryWrite( fifo_t *fifo, void *buffer, size_t len ) { return qtrue; } +qboolean FIFO_ReadMessage( fifo_t *fifo, size_t msglen ); + |