|
@@ -105,6 +105,15 @@ static int allocate_buffer(int req_size) {
|
|
|
|
|
|
char* get_static_buffer(int req_size) {
|
|
char* get_static_buffer(int req_size) {
|
|
char *p = NULL;
|
|
char *p = NULL;
|
|
|
|
+
|
|
|
|
+#ifdef EXTRA_DEBUG
|
|
|
|
+ if ((active_buffer < 0) || (active_buffer > MAX_BUFFERS-1)) {
|
|
|
|
+ LOG(L_CRIT, "BUG: buffers have not been initialized yet. "
|
|
|
|
+ "Call reset_static_buffer() before executing "
|
|
|
|
+ "a route block.\n");
|
|
|
|
+ abort();
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
if ((buffer[active_buffer].size >= buffer[active_buffer].offset + req_size)
|
|
if ((buffer[active_buffer].size >= buffer[active_buffer].offset + req_size)
|
|
|| (allocate_buffer(req_size))) {
|
|
|| (allocate_buffer(req_size))) {
|
|
/* enough space in current buffer or allocation successful */
|
|
/* enough space in current buffer or allocation successful */
|