summaryrefslogtreecommitdiffhomepage
path: root/plugins/fcgi/fcgiid.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-07 19:24:45 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-07 19:24:45 +0200
commit9e635d9b19e72eefef082dd8071d3e4c9d6cfab1 (patch)
tree4e205947bc1f6b62f743faf3312f3e1e7e77f647 /plugins/fcgi/fcgiid.cpp
parent1cc484b25547e349177cf652f62021b802f48655 (diff)
Separated out TCP socket class
Diffstat (limited to 'plugins/fcgi/fcgiid.cpp')
-rw-r--r--plugins/fcgi/fcgiid.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/fcgi/fcgiid.cpp b/plugins/fcgi/fcgiid.cpp
new file mode 100644
index 0000000..778cbc9
--- /dev/null
+++ b/plugins/fcgi/fcgiid.cpp
@@ -0,0 +1,19 @@
+#include "fcgiid.h"
+
+ // starting at 1
+uint16_t FCGI_ID::getID()
+{
+ if (m_unused.empty()) {
+ m_current_max++;
+ return m_current_max;
+ } else {
+ uint16_t result{*m_unused.begin()};
+ m_unused.erase(m_unused.begin());
+ return result;
+ }
+}
+
+void FCGI_ID::putID(uint16_t id)
+{
+ m_unused.insert(id);
+}