catalinux / Conn (public) (License: LGPLv2) (since 2016-03-01) (hash sha1)
Net library for easy building ipv4/ipv6 network daemons/clients
List of commits:
Subject Hash Author Date (UTC)
Cosmetic changes. 14da1b82e17275b6869493fa15e931536b77e547 Catalin(ux) M. BOIE 2009-09-18 09:31:23
Log also how many pending connections are after trytoconnect call. 4cd341f53a426cb49e437a46388b586913c0c859 Catalin(ux) M. BOIE 2009-09-18 09:30:47
Bumped up the version to 1.0.26. 2c68c221bf5ef3f5a0779e94c0448231b9fd630f Catalin(ux) M. BOIE 2009-09-18 08:31:14
Fixed a bug regarding work_to_do (decrementing on bind errors). 8b8585685bdd07d0e1df9a7ca9e41ecca9cc73bf Catalin(ux) M. BOIE 2009-09-18 08:30:10
Log also commit function. c920c0191bebc71b18bc318803db7f02ddc7b77f Catalin(ux) M. BOIE 2009-09-18 08:21:53
Log also work_to_do. a7c800b63e6ca4384726c7269e097c4f76f9991e Catalin(ux) M. BOIE 2009-09-18 07:51:26
Conn_eat logs also the slot. f65411260656b348ea34da12e7bbcbe62d7350f6 Catalin(ux) M. BOIE 2009-09-18 07:47:10
More logging in hang-up case. 325c292c46f8deb6e621836f16dec2d43cc5aea9 Catalin(ux) M. BOIE 2009-09-18 07:30:39
Bumbed up the version to 1.0.25. 379d8e2aa9df2b504cc5f539981fecf0d882c509 Catalin(ux) M. BOIE 2009-09-17 14:47:48
Lots of bulk changes to work-around C pointer change. bf3d2ae7af927b3624c4685c72ca6fa812bca640 Catalin(ux) M. BOIE 2009-09-17 14:47:19
Bumped version to 1.0.24. 77e8249758effc45a86d66f8edc5973f11a5b6f9 Catalin(ux) M. BOIE 2009-09-17 12:20:16
Allow chg function to fail. Problem needs more thinking. a01999f729b0afd5891dcd538c91e564c274ce69 Catalin(ux) M. BOIE 2009-09-17 12:19:24
Done some optimizations for buffer expanding. 0fa9c81dc4ded2296c1825c5ccd3b264995962aa Catalin(ux) M. BOIE 2009-09-17 12:02:46
Do not wrongly set connection type to P2P! ccb997058dedaa139cf12e30eb8547f2dd99993e Catalin(ux) M. BOIE 2009-09-17 11:17:31
Bumped version to 1.0.23. b79fc6931982e2389f1b29b91d2386eaa779c143 Catalin(ux) M. BOIE 2009-09-17 09:43:00
Duilder updates. 534af0dbaf993201b588d463f58e64401ccc7d85 Catalin(ux) M. BOIE 2009-09-17 09:42:45
Fixed triggers. 6a95b877268bbf4522c53398e29c3dab1a8f22d1 Catalin(ux) M. BOIE 2009-09-17 09:41:44
Bumped version to 1.0.22. 0efd6d2a3787fe9a3f2c963bbcc85c95d44b954a Catalin(ux) M. BOIE 2009-09-02 16:23:25
Updated duilder. 8bfb064fb40b962a0ed18f3af21fbfd0289672dd Catalin(ux) M. BOIE 2009-09-02 15:48:51
Added latency reporting. 218047bf22e2804a585703751b51c6b2d54c59ad Catalin(ux) M. BOIE 2009-09-02 16:29:44
Commit 14da1b82e17275b6869493fa15e931536b77e547 - Cosmetic changes.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2009-09-18 09:31
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2009-09-18 09:31
Parent(s): 4cd341f53a426cb49e437a46388b586913c0c859
Signing key:
Tree: d7c68bb001d582a04574f36e132fc15eab063f88
File Lines added Lines deleted
Conn.c 7 6
Conn_engine_core.c 2 2
File Conn.c changed (mode: 100644) (index 670110b..727b3e5)
... ... int Conn_enqueue(struct Conn *C, void *buf, const size_t count)
271 271
272 272 static void Conn_free_intern(const unsigned int slot) static void Conn_free_intern(const unsigned int slot)
273 273 { {
274 Log(11, "%s: Cleaning-up id %llu (slot %u) in state %s [%s]...\n",
274 Log(11, "%s: Cleaning-up id %llu (slot=%u) in state %s [%s]...\n",
275 275 __FUNCTION__, Conns[slot].id, slot, Conn_state(&Conns[slot]), __FUNCTION__, Conns[slot].id, slot, Conn_state(&Conns[slot]),
276 276 Conn_errno(&Conns[slot])); Conn_errno(&Conns[slot]));
277 277
 
... ... static void Conn_accept(const unsigned int slot)
787 787 socklen_t cax_len, sax_len; socklen_t cax_len, sax_len;
788 788 struct Conn *X; struct Conn *X;
789 789
790 Log(10, "Accepting a connection on slot %u via %s/%d, type %s, domain %s"
790 Log(10, "Accepting a connection on slot=%u via %s/%d, type %s, domain %s"
791 791 ", protocol %s.\n", ", protocol %s.\n",
792 792 slot, Conns[slot].bind_addr, Conns[slot].bind_port, Conn_type(&Conns[slot]), slot, Conns[slot].bind_addr, Conns[slot].bind_port, Conn_type(&Conns[slot]),
793 793 Conn_domain(&Conns[slot]), Conn_get_socket_protocol(&Conns[slot])); Conn_domain(&Conns[slot]), Conn_get_socket_protocol(&Conns[slot]));
 
... ... static void Conn_trytoconnect(void)
977 977 if (Conns[i].state != CONN_STATE_CONNECT_a) if (Conns[i].state != CONN_STATE_CONNECT_a)
978 978 continue; continue;
979 979
980 Log(9, "\tTry to connect slot=%u, id=%llu, to %s/%d...\n",
980 Log(9, "\tTrying to connect slot=%u, id=%llu, to %s/%d...\n",
981 981 Conns[i].slot, Conns[i].id, Conns[i].addr, Conns[i].port); Conns[i].slot, Conns[i].id, Conns[i].addr, Conns[i].port);
982 982
983 983 memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
 
... ... static void Conn_poll_cb(const unsigned int slot, int revents)
1290 1290 } }
1291 1291
1292 1292 /* /*
1293 * Moving a in-use slot over a free one for compacting reason.
1293 * Moving an in-use slot over a free one for compacting reason.
1294 1294 */ */
1295 1295 static void Conn_move_slot(const unsigned int dst, const unsigned int src) static void Conn_move_slot(const unsigned int dst, const unsigned int src)
1296 1296 { {
 
... ... static void Conn_move_slot(const unsigned int dst, const unsigned int src)
1299 1299 if (dst == src) if (dst == src)
1300 1300 return; return;
1301 1301
1302 Log(10, "\t%s: Moving id %llu from slot %u to slot %d...\n",
1302 Log(10, "\t%s: Moving id %llu from slot=%u to slot=%d...\n",
1303 1303 __FUNCTION__, Conns[src].id, src, dst); __FUNCTION__, Conns[src].id, src, dst);
1304 1304
1305 1305 /* We need to save old location because of usefull pointers */ /* We need to save old location because of usefull pointers */
 
... ... static void Conn_move_slot(const unsigned int dst, const unsigned int src)
1308 1308 Conns[src] = tmp; Conns[src] = tmp;
1309 1309
1310 1310 Conns[dst].slot = dst; Conns[dst].slot = dst;
1311 Conns[src].slot = src;
1311 1312
1312 1313 Conn_engine_move_slot(dst, src); Conn_engine_move_slot(dst, src);
1313 1314 } }
 
... ... int Conn_poll(const int timeout)
1360 1361
1361 1362 /* Closing connection if it is in error state */ /* Closing connection if it is in error state */
1362 1363 if (Conns[slot].error_state > 0) { if (Conns[slot].error_state > 0) {
1363 Log(11, "\tSlot %u in error, exchange with pos %u.\n",
1364 Log(11, "\tSlot=%u in error, exchange with pos %u.\n",
1364 1365 slot, last); slot, last);
1365 1366 Conn_move_slot(slot, last); Conn_move_slot(slot, last);
1366 1367 Conn_free_intern(last); Conn_free_intern(last);
File Conn_engine_core.c changed (mode: 100644) (index 727bb83..50839b9)
... ... int Conn_try_expand_buf(const unsigned int slot, const int what, const unsigned
303 303 if (buf_size - tail >= needed) if (buf_size - tail >= needed)
304 304 return 0; return 0;
305 305
306 Log(10, "\tTry to expand buffer on slot %u for [%s] needed=%d head=%u tail=%u.\n",
306 Log(10, "\tTry to expand buffer on slot=%u for [%s] needed=%d head=%u tail=%u.\n",
307 307 slot, what == 0 ? "o" : "i", needed, slot, what == 0 ? "o" : "i", needed,
308 308 head, tail); head, tail);
309 309
 
... ... void Conn_eat(struct Conn *C, const unsigned int bytes)
979 979 Conns[slot].ibuf_tail = 0; Conns[slot].ibuf_tail = 0;
980 980 } }
981 981
982 Log(10, "Conn_eat(slot %u, %u) head=%u tail=%u qlen=%u\n",
982 Log(10, "Conn_eat(slot=%u, %u) head=%u tail=%u qlen=%u\n",
983 983 slot, bytes, Conns[slot].ibuf_head, Conns[slot].ibuf_tail, slot, bytes, Conns[slot].ibuf_head, Conns[slot].ibuf_tail,
984 984 Conn_qlen(&Conns[slot])); Conn_qlen(&Conns[slot]));
985 985 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/Conn

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/Conn

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/Conn

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main