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)
Be more verbose in try_expand_buf and error out connection when cannot expand. e95ac8d7e5015958d3594862c6183b63bab80d4a Catalin(ux) M. BOIE 2010-09-30 20:58:08
Ignore xbind1 compiled example. 089b68cf9fc5c16ee7d8136b28a52ec4dd139c78 Catalin(ux) M. BOIE 2010-08-23 19:42:01
Removed direct access to Conn structure in s.c example. f6215273602571ef2c98479bdba930ebe312cbc9 Catalin(ux) M. BOIE 2010-08-23 19:38:33
Bumped the version to 1.0.32. f158fca2cf9f3285ae761cd4ce30b01911b84385 Catalin(ux) M. BOIE 2010-06-23 21:30:47
The cache for epoll_ctl, has to take also the slot in consideration. ed378c16927c707feee481b2cd0ea7fbdf257d9d Catalin(ux) M. BOIE 2010-06-09 19:18:03
After calling getsockname, set cache as clean. 199f0fd96b064fd1e63f5773b1e7ab58e7d91303 Catalin(ux) M. BOIE 2010-06-08 18:30:20
Do not try to call getsockname if connection is not opened. e9853b5b5a01df3c5e07f6fe4607a68fd7181b39 Catalin(ux) M. BOIE 2010-06-08 18:28:49
Supports kernels below 2.6.9 (epoll_ctl). 97919a022fae39bdefc3f7e4c50526fb473dfd34 Catalin(ux) M. BOIE 2010-06-08 18:06:35
Cosmetic logging. ad806920255f8ca5f9281b6b6a3a53edf2d5088f Catalin(ux) M. BOIE 2010-06-08 17:35:45
When generating one line of slot status, do not append \n. 20ed77b4bf5909ded12cd225753a8858d8941792 Catalin(ux) M. BOIE 2010-06-08 15:57:16
Indented Conn_poll_cb to better watch logs. 58d734a8895b03eb17724eefe37e862c9665fb2c Catalin(ux) M. BOIE 2010-06-08 15:52:44
If we have POLLOUT set and the queue is empty, do not call recv function. 2f3b266eea11dea7c28f1c24b615f667585a215e Catalin(ux) M. BOIE 2010-06-08 15:27:40
Conn_{addr,port}_{local,remote} functions added. 47643b30ea900240e821983c89eb1f806f91c6ea Catalin(ux) M. BOIE 2010-06-08 15:03:52
Wrong cache consulted! 6d018b014156ada0bf1a138ac2178386f6bb90ab Catalin(ux) M. BOIE 2010-06-08 15:03:34
If slot is in FREE state and we get events, do not abort, but log an error. 52301f684bb4a49fd74556f8b15fee643c4bfb06 Catalin(ux) M. BOIE 2010-06-07 20:25:21
More verbose logging and added some TODOs. a27014689701b1dd3d0e3c02629d3c7dd0edc77e Catalin(ux) M. BOIE 2010-06-07 20:24:43
Added Conn_[io]qlen and obsoleted Conn_qlen (ambiguous). be3822589afe052fade15fd81afee3549217131a Catalin(ux) M. BOIE 2010-06-07 20:23:39
Use u32 field of epoll. ptr on 64bit gave an warning. 37c86810ceaadd0c8139f11e3737577efea4cabd Catalin(ux) M. BOIE 2010-06-07 19:46:15
Export CONN_VERSION in Conn_config.h d34d7a1da235b00c3aa1c8e0494310c4dd100886 Catalin(ux) M. BOIE 2010-06-07 19:45:53
In Conn_poll_cb, show human readable events. a3e305582e9bf1185254f8feeab90c51af626443 Catalin(ux) M. BOIE 2010-06-07 17:22:49
Commit e95ac8d7e5015958d3594862c6183b63bab80d4a - Be more verbose in try_expand_buf and error out connection when cannot expand.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2010-09-30 20:58
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2010-09-30 20:58
Parent(s): 089b68cf9fc5c16ee7d8136b28a52ec4dd139c78
Signing key:
Tree: e3998cfe16655b932b247f291dc5af2adbff6b3f
File Lines added Lines deleted
Conn.c 2 1
Conn_engine_core.c 7 4
File Conn.c changed (mode: 100644) (index ab4bea8..5bc8ccc)
... ... static void Conn_recv_cb_i(const unsigned int slot)
1157 1157 if (Conns[slot].ibuf_tail == Conns[slot].ibuf_size) { if (Conns[slot].ibuf_tail == Conns[slot].ibuf_size) {
1158 1158 r = Conn_try_expand_buf(slot, 1, Conn_default_ibuf); r = Conn_try_expand_buf(slot, 1, Conn_default_ibuf);
1159 1159 if (r != 0) { if (r != 0) {
1160 Log(1, "\tMEM: Cannot expand ibuf!\n");
1160 Conns[slot].error_state = CONN_ERROR_MEM;
1161 /* TODO: Just suspend connection for 1 second instead */
1161 1162 return; return;
1162 1163 } }
1163 1164 } }
File Conn_engine_core.c changed (mode: 100644) (index ad9a674..1ef5a31)
... ... int Conn_try_expand_buf(const unsigned int slot, const int what,
308 308 amount = 128; amount = 128;
309 309
310 310 hm = buf_size + amount; hm = buf_size + amount;
311 if (hm > max_buf)
311 if ((max_buf > 0) && (hm > max_buf))
312 312 hm = max_buf; hm = max_buf;
313 313
314 314 /* Seems we are not allowed to grow larger */ /* Seems we are not allowed to grow larger */
315 if (hm <= buf_size)
315 if (hm <= buf_size) {
316 Log(1, "Cannot obtain needed bytes:"
317 " hm(%u) <= buf_size(%u)!\n",
318 hm, buf_size);
316 319 return -1; return -1;
320 }
317 321
318 322 p = realloc(pbuf, hm); p = realloc(pbuf, hm);
319 323 if (p == NULL) { if (p == NULL) {
320 Log(3, "Cannot realloc obuf!\n");
324 Log(1, "Cannot realloc pbuf to %u bytes!\n", hm);
321 325 return -1; return -1;
322 326 } }
323 327
 
... ... int Conn_try_expand_buf(const unsigned int slot, const int what,
331 335 Conn_mem_buffers_in += hm - old_size; Conn_mem_buffers_in += hm - old_size;
332 336 } }
333 337
334
335 338 Log(10, "\tSucces. Old/new size = %u/%u.\n", Log(10, "\tSucces. Old/new size = %u/%u.\n",
336 339 old_size, hm); old_size, hm);
337 340
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