Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Added Conn_addr_info - check what family an address is. | 10087d1dec5592e4a5396df09aade7d963cf1ea4 | Catalin(ux) M. BOIE | 2009-03-17 08:55:47 |
Bump up the version. | 4ce4f82faa025d9a386538d1db5d74a443baf62a | Catalin(ux) M. BOIE | 2009-03-10 09:22:37 |
Do not try to close free state slots. | f17b6d92d668f72de10967ae9178131916db64c8 | Catalin(ux) M. BOIE | 2009-03-09 10:29:35 |
TODO: More entries added (timer optimization). | 0b0be1574b15e7dae4b7dca9f02f0ff78bc02136 | Catalin(ux) M. BOIE | 2009-03-09 10:27:37 |
Raised debug level for compacting phase. | d610f3d45075311f9f21c7c122dfefa773c48a64 | Catalin(ux) M. BOIE | 2009-03-09 10:17:41 |
Bump up the version. | b8a55af5786f74ea38e5929af347cfc79f0d3dfd | Catalin(ux) M. BOIE | 2009-03-09 10:14:10 |
Moved free_intern in the periodic scanning to not miss connections in listen. | 5fb989866b1ceb68e64e62e035610c40cf519c03 | Catalin(ux) M. BOIE | 2009-03-09 10:05:03 |
More clear logging. | 3599fc41cce9bd25e5461d0c4350780f4dbc64a6 | Catalin(ux) M. BOIE | 2009-03-09 10:04:47 |
Bump up the version. | 64a2ec25c265a6750b25e7bd5be85f66766e4cf4 | Catalin(ux) M. BOIE | 2009-03-09 08:59:22 |
Fixed a bug preventing a socket in listen state to be closed. | 287e366451321862731e005d48391ed39149693b | Catalin(ux) M. BOIE | 2009-03-09 08:58:51 |
Duilder updates. | 30f5e95e50703f2bb3e5ba6f088b09f858e0e95c | Catalin(ux) M. BOIE | 2009-03-09 08:58:40 |
Extended timeout to 1000ms from 500ms. No need to wake up too frequent. | ea268527d103d09685192399bbad6ebbd22430e8 | Catalin(ux) M. BOIE | 2009-03-06 13:11:36 |
Bump version in duilder. | cbe72841517c536aa714fd8dfdbe1799248664e2 | Catalin(ux) M. BOIE | 2009-03-05 15:35:37 |
Added suport to bind to a specific IP. | 5de8bd574a0bd2b57cc0ea98c4c20186dcfc9d8c | Catalin(ux) M. BOIE | 2009-03-02 13:59:07 |
TODO: Added bind to ip and access control. | d7dd6bd61fdb4974da679979f05913cc24c9c0ae | Catalin(ux) M. BOIE | 2009-03-02 13:34:13 |
Lot of small changes that were need to fix epoll integration. | 92877346e9cbecc7bea6f6d342e6d03475349878 | Catalin(ux) M. BOIE | 2009-02-26 12:20:07 |
Fixed the server example to output a \n terminated line. | ed20ea84c9c6bd5dc9a3c066d03e4c8a049e1369 | Catalin(ux) M. BOIE | 2009-02-26 12:16:33 |
Added an accept_error callback to server example (s.c). | 7014b75488c82c4b1f1c5b52cf7d4d2278719f4d | Catalin(ux) M. BOIE | 2009-02-26 12:15:56 |
Fixed exit from client example (c.c) to catch leaks. | b912a406c59719919d3d98f4ca92cbbb3f986e99 | Catalin(ux) M. BOIE | 2009-02-26 12:15:08 |
Added queue stuff - not used for now. | b913455733a88e63bea980e7490d4f36766e15fc | Catalin(ux) M. BOIE | 2009-02-26 10:50:56 |
File | Lines added | Lines deleted |
---|---|---|
Conn_engine_core.c | 35 | 0 |
Conn_engine_core.h | 2 | 0 |
Makefile.in | 5 | 0 |
examples/udp_s.c | 1 | 1 |
tests/.gitignore | 1 | 0 |
tests/Makefile | 15 | 0 |
tests/run | 5 | 0 |
tests/t1.c | 30 | 0 |
File Conn_engine_core.c changed (mode: 100644) (index ff4c1b3..56045de) | |||
... | ... | void Conn_queue_destroy(struct Conn_queue *q) | |
921 | 921 | ||
922 | 922 | q->head = q->tail = NULL; | q->head = q->tail = NULL; |
923 | 923 | } | } |
924 | |||
925 | /* Misc */ | ||
926 | /* | ||
927 | * Returns the address family for address stored in @addr. | ||
928 | */ | ||
929 | int Conn_addr_family(const char *addr) | ||
930 | { | ||
931 | struct addrinfo hints, *results = NULL; | ||
932 | int ret; | ||
933 | |||
934 | memset(&hints, 0, sizeof(struct addrinfo)); | ||
935 | hints.ai_family = AF_UNSPEC; | ||
936 | hints.ai_socktype = 0; | ||
937 | hints.ai_flags = AI_NUMERICHOST; | ||
938 | hints.ai_protocol = 0; | ||
939 | hints.ai_canonname = NULL; | ||
940 | hints.ai_addr = NULL; | ||
941 | hints.ai_next = NULL; | ||
942 | |||
943 | ret = getaddrinfo(addr, NULL, &hints, &results); | ||
944 | if (ret != 0) { | ||
945 | snprintf(Conn_error, sizeof(Conn_error), | ||
946 | "getaddrinfo error on %s (%s)", | ||
947 | addr, gai_strerror(ret)); | ||
948 | if (results) | ||
949 | freeaddrinfo(results); | ||
950 | return -1; | ||
951 | } | ||
952 | |||
953 | ret = results->ai_family; | ||
954 | |||
955 | freeaddrinfo(results); | ||
956 | |||
957 | return ret; | ||
958 | } |
File Conn_engine_core.h changed (mode: 100644) (index 754f621..dab1c50) | |||
... | ... | extern char *Conn_obuf(const struct Conn *C); | |
277 | 277 | extern char *Conn_domain(const struct Conn *C); | extern char *Conn_domain(const struct Conn *C); |
278 | 278 | extern char *Conn_type(const struct Conn *C); | extern char *Conn_type(const struct Conn *C); |
279 | 279 | ||
280 | extern int Conn_addr_family(const char *addr); | ||
281 | |||
280 | 282 | /* queue stuff */ | /* queue stuff */ |
281 | 283 | extern void Conn_queue_init(struct Conn_queue *q); | extern void Conn_queue_init(struct Conn_queue *q); |
282 | 284 | extern int Conn_queue_add(struct Conn_queue *q, | extern int Conn_queue_add(struct Conn_queue *q, |
File Makefile.in changed (mode: 100644) (index 976d5d7..918d7fc) | |||
... | ... | libConn.a: $(OBJS) | |
32 | 32 | ar rcs libConn.a $(OBJS) | ar rcs libConn.a $(OBJS) |
33 | 33 | ||
34 | 34 | ||
35 | .PHONY: tests | ||
36 | tests: | ||
37 | $(MAKE) -C tests | ||
38 | |||
35 | 39 | .PHONY: examples | .PHONY: examples |
36 | 40 | examples: | examples: |
37 | 41 | $(MAKE) -C examples | $(MAKE) -C examples |
... | ... | examples: | |
41 | 45 | clean: | clean: |
42 | 46 | @-rm -f *.a *.o *.so* $(PRJ)-*.rpm $(PRJ)-*-*-*.tgz $(PRJ)-*.tar.gz | @-rm -f *.a *.o *.so* $(PRJ)-*.rpm $(PRJ)-*-*-*.tgz $(PRJ)-*.tar.gz |
43 | 47 | @$(MAKE) -C examples clean | @$(MAKE) -C examples clean |
48 | @$(MAKE) -C tests clean | ||
44 | 49 | ||
45 | 50 | ||
46 | 51 | install: all | install: all |
File examples/udp_s.c changed (mode: 100644) (index 1516c3f..67e60ea) | |||
... | ... | static void s_recv(struct Conn *C) | |
77 | 77 | ||
78 | 78 | static void s_error(struct Conn *C) | static void s_error(struct Conn *C) |
79 | 79 | { | { |
80 | Log(1, "%s slot=%d id=%llu\n", | ||
80 | Log(1, "%s: slot=%d, id=%llu\n", | ||
81 | 81 | __FUNCTION__, C->slot, Conn_getid(C)); | __FUNCTION__, C->slot, Conn_getid(C)); |
82 | 82 | } | } |
83 | 83 |
File tests/.gitignore added (mode: 100644) (index 0000000..9857323) | |||
1 | *.run |
File tests/Makefile added (mode: 100644) (index 0000000..52a145f) | |||
1 | TARGETS := t1.run | ||
2 | |||
3 | all: $(TARGETS) | ||
4 | |||
5 | INCS += -I.. | ||
6 | LIBS += -L.. -lConn | ||
7 | OBJS := | ||
8 | DEPS := ../libConn.so.$(VER) $(OBJS) | ||
9 | |||
10 | t1.run: t1.c $(DEPS) | ||
11 | gcc $(CFLAGS) $(INCS) t1.c -o $@ $(LIBS) | ||
12 | |||
13 | .PHONY: clean | ||
14 | clean: | ||
15 | @-rm -f $(TARGETS) *.log core |
File tests/run added (mode: 100755) (index 0000000..ab268aa) | |||
1 | #!/bin/bash | ||
2 | |||
3 | export LD_LIBRARY_PATH=..:${LD_LIBRARY_PATH} | ||
4 | |||
5 | debug "$@" |
File tests/t1.c added (mode: 100644) (index 0000000..05d13f6) | |||
1 | #include <Conn.h> | ||
2 | |||
3 | int main(void) | ||
4 | { | ||
5 | char *s; | ||
6 | int ret = 0, r; | ||
7 | |||
8 | s = "127.0.0.1"; | ||
9 | r = Conn_addr_family(s); | ||
10 | if (r != PF_INET) { | ||
11 | printf("ERROR: %s->%d (%s).\n", s, r, Conn_strerror()); | ||
12 | ret++; | ||
13 | } | ||
14 | |||
15 | s = "1234::1"; | ||
16 | r = Conn_addr_family(s); | ||
17 | if (r != PF_INET6) { | ||
18 | printf("ERROR: %s->%d (%s).\n", s, r, Conn_strerror()); | ||
19 | ret++; | ||
20 | } | ||
21 | |||
22 | s = "1234:::1"; | ||
23 | r = Conn_addr_family(s); | ||
24 | if (r != -1) { | ||
25 | printf("ERROR: %s->%d (%s).\n", s, r, Conn_strerror()); | ||
26 | ret++; | ||
27 | } | ||
28 | |||
29 | return ret; | ||
30 | } |