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)
Do not call gerpeername and getsockname at every accept/connect. Do it only when needed. d2505dbca77358b6ed67394e09904b525ea517e6 Catalin(ux) M. BOIE 2010-05-06 16:38:40
Simplified setting NONBLOCK in Conn_setnonblock. 18d93d4daf5182e2c2749be05f7bbd43bb18bb18 Catalin(ux) M. BOIE 2010-05-06 16:13:34
strstr should not use case sensitive when searching for \n. 50658544213ff74d0e03625c5e3fae0eadba73ad Catalin(ux) M. BOIE 2010-05-06 16:11:06
Grow receiving buffer with Conn_default_ibuf instead of 0! Stupid! f663a98fc5db5f64a4ed7bf9a37ae5a1a708ac3c Catalin(ux) M. BOIE 2010-05-06 16:10:13
Use fd -1 to signal that the socket is closed. 66c44cbeb5672fae1bea46260adbae06a3562d88 Catalin(ux) M. BOIE 2010-05-06 16:08:59
Better error logging in xbind example. dac03d74521e751de9d900ea115ad2fbd2deba6e Catalin(ux) M. BOIE 2010-02-16 20:22:05
Fixed some stupid choices regarding storage type for the output of snprintf. 3cddc7934c4fc2640e4a60d408e98c45acef48c9 Catalin(ux) M. BOIE 2010-02-05 00:12:13
First round of memory status. 9e267dc05ec2c0b1e50288a6d9a5db5d3677e82e Catalin(ux) M. BOIE 2010-02-04 23:46:48
Do not overwrite Conn_error in Conn_free_intern. 380c378dd92e7a797f0dfec99bed7ce77034933c Catalin(ux) M. BOIE 2010-02-04 23:31:50
No need to remove fd from epoll just before closing it. bf7e91a441314a37f5f8a2430645c913b953499f Catalin(ux) M. BOIE 2010-02-04 23:17:05
Log status at the end for xbind example. 2caa2d8a3dc509e91235fd23c396061931ae1ef8 Catalin(ux) M. BOIE 2010-02-04 23:11:39
Log also fd in Conn_free_intern. 2e12c2ed0b4c39341ec3da3c6fc52d32f4a351eb Catalin(ux) M. BOIE 2010-02-04 23:11:09
In shutdown, close the file descriptors. 8bf16a0b5413d8f99cb466b52efcbd12318e958d Catalin(ux) M. BOIE 2010-01-27 18:51:36
Added xbind example. 1cdf8e8fd7ba9049eafef8f136d6b4e5e870b0ff Catalin(ux) M. BOIE 2009-12-30 22:37:01
TODO in/out. b0d7ba7f8abe58861a47586d767ff35bc1f0961d Catalin(ux) M. BOIE 2009-12-30 22:35:55
Stop Conn if nothing to do. 7f13d71774792aa97b341a2e69bb557d15b6c74a Catalin(ux) M. BOIE 2009-12-06 01:38:12
Improved Conn_split_* and removed a bad leak! f47f85c65ac5781d9419b58b20db632772947c64 Catalin(ux) M. BOIE 2009-12-06 01:24:58
Bump up the version. 4788a6979d84939cc7aaf824ef8e0b7357cab6cc Catalin(ux) M. BOIE 2009-12-07 12:50:16
Duilder updates. 1b717c718189468006ff0e7fb228571e76fb97e6 Catalin(ux) M. BOIE 2009-12-07 12:49:55
Exported Conn_engine_set function. 1c69de5306d302fcd6b3e6351d3e28771b08bb05 Catalin(ux) M. BOIE 2009-11-12 15:18:40
Commit d2505dbca77358b6ed67394e09904b525ea517e6 - Do not call gerpeername and getsockname at every accept/connect. Do it only when needed.
Signed-off-by: Catalin(ux) M. BOIE <cboie@route66.ro>
Author: Catalin(ux) M. BOIE
Author date (UTC): 2010-05-06 16:38
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2010-06-11 09:04
Parent(s): 18d93d4daf5182e2c2749be05f7bbd43bb18bb18
Signing key:
Tree: 37ce29ad8af3eb967706072c6075f22b6f4a7b04
File Lines added Lines deleted
Conn.c 2 3
Conn_engine_core.c 12 0
Conn_engine_core.h 4 2
File Conn.c changed (mode: 100644) (index 507bd53..768cff6)
... ... static void Conn_accept(const unsigned int slot)
858 858
859 859 Conn_setnonblock(X->fd); Conn_setnonblock(X->fd);
860 860
861 Conn_set_address(X, 0);
862 Conn_set_address(X, 1);
861 X->flags |= CONN_ADDR_LOCAL_DIRTY | CONN_ADDR_REMOTE_DIRTY;
863 862
864 863 err = Conn_engine_add_obj(X); err = Conn_engine_add_obj(X);
865 864 if (err != 0) { if (err != 0) {
 
... ... static void Conn_poll_cb(const unsigned int slot, int revents)
1249 1248
1250 1249 Conns[slot].state = CONN_STATE_OPEN; Conns[slot].state = CONN_STATE_OPEN;
1251 1250
1252 Conn_set_address(&Conns[slot], 0);
1251 Conns[slot].flags |= CONN_ADDR_LOCAL_DIRTY;
1253 1252
1254 1253 Conns[slot].time_open = Conn_now; Conns[slot].time_open = Conn_now;
1255 1254
File Conn_engine_core.c changed (mode: 100644) (index 04a2b20..2614afb)
... ... char *Conn_status_slot(const unsigned int slot)
475 475 Conn_speed(speedi, sizeof(speedi), si); Conn_speed(speedi, sizeof(speedi), si);
476 476 Conn_speed(speedo, sizeof(speedo), so); Conn_speed(speedo, sizeof(speedo), so);
477 477
478 Conn_set_address(&Conns[slot], 0);
479 Conn_set_address(&Conns[slot], 1);
480
478 481 local_addr = "-"; local_addr = "-";
479 482 local_port = 0; local_port = 0;
480 483 remote_addr = "-"; remote_addr = "-";
 
... ... int Conn_set_address(struct Conn *C, const int flags)
1127 1130 int *pport; int *pport;
1128 1131 unsigned int slot; unsigned int slot;
1129 1132
1133 /* Test if we need to regenerate. */
1134 if (flags & 1) {
1135 if (!(C->flags & CONN_ADDR_LOCAL_DIRTY))
1136 return 0;
1137 } else {
1138 if (!(C->flags & CONN_ADDR_REMOTE_DIRTY))
1139 return 0;
1140 }
1141
1130 1142 slot = C->slot; slot = C->slot;
1131 1143
1132 1144 switch (Conns[slot].sock_domain) { switch (Conns[slot].sock_domain) {
File Conn_engine_core.h changed (mode: 100644) (index b341afa..040328e)
... ... enum CONN_ERROR {
66 66 }; };
67 67
68 68 /* FLAGS */ /* FLAGS */
69 #define CONN_FLAGS_AUTO_RECONNECT 0x01 << 0
70 #define CONN_FLAGS_CLOSE_AFTER_SEND 0x01 << 1
69 #define CONN_FLAGS_AUTO_RECONNECT 1 << 0
70 #define CONN_FLAGS_CLOSE_AFTER_SEND 1 << 1
71 #define CONN_ADDR_LOCAL_DIRTY 1 << 2
72 #define CONN_ADDR_REMOTE_DIRTY 1 << 3
71 73
72 74 /* Parameters */ /* Parameters */
73 75 enum CONN_PARA { enum CONN_PARA {
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