Commit graph

377 commits

Author SHA1 Message Date
Jo-Philipp Wich
8b0d933154 uloop: rename uloop_timeout_pending() to uloop_timeout_remaining() 2013-01-23 19:33:12 +01:00
Jo-Philipp Wich
77984bd24d uloop: add uloop_timeout_pending() function to determine the remaining time of an active timeout 2013-01-23 19:32:45 +01:00
Felix Fietkau
e009fd8c82 build: remove install prefix override
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-23 15:22:29 +01:00
Felix Fietkau
8a89e7f388 blob/blobmsg: use 32 bit load/store for 64 bit access, unaligned attributes cause data corruption on ARM
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-23 02:41:20 +01:00
Felix Fietkau
f15ceb8ced ustream-fd: retry partial writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-22 10:09:55 +01:00
Luka Perkov
220958b7d9 rename internal variables in json_get_type
Signed-off-by: Luka Perkov <luka@openwrt.org>
2013-01-17 13:34:55 +01:00
Felix Fietkau
c360ec576c blobmsg: add blobmsg_get_string
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 15:29:14 +01:00
Felix Fietkau
f5245f9887 add license headers for usock
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 15:27:38 +01:00
Felix Fietkau
432b93f633 list_compat.h: add copyright info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:49:16 +01:00
Felix Fietkau
569bc29c5a uloop: replace copyright info (code has been completely rewritten over time), relicense to ISC
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:47:51 +01:00
Felix Fietkau
0ab17bcb3a jshn: add copyright info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:45:59 +01:00
Felix Fietkau
1ec5b85848 blobmsg: fix blobmsg_parse_array, drop name field requirement
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:07:32 +01:00
Felix Fietkau
4b5f278195 blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:02:51 +01:00
Felix Fietkau
2f74dbad14 blobmsg: add blobmsg_parse_array()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-08 02:05:03 +01:00
Felix Fietkau
dde64e47ca uloop: use clock_gettime with the monotonic clock instead of using gettimeofday()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 03:04:04 +01:00
Felix Fietkau
aa4f3bde06 uloop: add a clock_gettime() implementation for mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 02:42:58 +01:00
Felix Fietkau
76f584c761 blobmsg_json: export blobmsg_add_object
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 02:15:48 +01:00
Felix Fietkau
b7930023ee uloop: add back state tracking on mac os x, it seems to work reliably now (after the other fixes)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-05 16:04:55 +01:00
Luka Perkov
f1735cd94e sanitize json_get_type function
Signed-off-by: Luka Perkov <luka@openwrt.org>
2013-01-04 13:28:08 +01:00
Felix Fietkau
17f4e41ecb uloop: improve edge trigger reliability on mac os x
Sometimes after re-arming a fd, an initial event for reads is not generated,
even though there is data pending. Work around this by making the trigger
level-triggered first, then switching to edge trigger after processing the first
event.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-04 03:18:42 +01:00
Felix Fietkau
c2916d7bcc uloop: ensure SIGCHLD is properly received on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-04 03:13:29 +01:00
Felix Fietkau
6a8df07590 uloop: do less state/change tracking for kevent() on mac os x, it is unreliable
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-04 01:15:48 +01:00
Felix Fietkau
8686989fff ustream: increment receive buffer count
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-03 16:32:49 +01:00
Felix Fietkau
5bbedafe09 ustream-fd: prevent callbacks during init
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-03 16:32:45 +01:00
Felix Fietkau
6c28da1ae2 ustream-fd: fix read error handling
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-03 16:32:40 +01:00
Felix Fietkau
e7825661a2 uloop: fix immediate timeout processing on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-01 23:37:22 +01:00
Felix Fietkau
7157c3a4df utils: add BUILD_BUG_ON (similar to the one in the linux kernel)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-01 16:10:44 +01:00
Felix Fietkau
7a117988d9 ustream: add ustream_pending_data accessor function
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-01 16:10:39 +01:00
Felix Fietkau
59000546c0 utils: make it unnecessary to specify the last NULL argument for calloc_a
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:40:12 +01:00
Felix Fietkau
9c8ab5d64c utils: move ARRAY_SIZE from uloop to utils.h
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:24:27 +01:00
Felix Fietkau
d03a6a27c7 add utils.c, containing a calloc-like function to allocate multiple chunks with different sizes in one block and return pointers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:24:26 +01:00
Felix Fietkau
29c066cfd6 ustream: avoid calling s->poll from a write path to avoid looping back through the notify_write cb
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-30 19:21:03 +01:00
Felix Fietkau
300a809a7a ustream: fix polling for write buffer availability after buffering writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-30 17:26:40 +01:00
Felix Fietkau
84822fd6d5 ustream: suppress write attempts in ustream_printf and ustream_vprintf if a write error was flagged
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-30 15:46:18 +01:00
Felix Fietkau
975ac3e5e3 ustream: add ustream_read_buf_full() helper
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-30 15:25:35 +01:00
Felix Fietkau
4d0a00c82c jshn: fix check to reset array sequence counters on cleanup 2012-12-18 13:38:27 +01:00
Jo-Philipp Wich
0505bf5f42 jshn: introduce json_is_a() convenience function to check field types without using a temporary variable 2012-12-17 13:54:45 +01:00
Felix Fietkau
079549666f jshn: fix array handling
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-16 19:58:06 +01:00
Felix Fietkau
7bca5dd29d jshn: fix some variable handling regressions
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-16 18:04:14 +01:00
Felix Fietkau
e16fa068a5 jshn: add support for namespaces
Can be used to fix variable namespace clashes in library code using jshn

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-16 17:46:08 +01:00
Felix Fietkau
9d8f2dd47b blob.h: fix endian check
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-02 17:49:12 +01:00
Felix Fietkau
407f7a0bb3 uloop: fix tv_diff() calculation
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-10-31 20:28:15 +01:00
Felix Fietkau
0385cbc068 uloop: another timer fix
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-10-31 20:09:47 +01:00
Felix Fietkau
33b9f3aa0b uloop: fix sub-second timer offsets for uloop_timeout_set 2012-10-31 20:03:45 +01:00
Felix Fietkau
a9b44ebe55 ustream: make notify_state optional as well 2012-10-30 00:00:57 +01:00
Felix Fietkau
efc9f4b702 ustream: mark notify_read cb as optional 2012-10-30 00:00:23 +01:00
Felix Fietkau
dc69ce4799 ustream: add a poll callback function defined by the ustream implementation 2012-10-29 23:39:48 +01:00
Felix Fietkau
df0968d19b ustream: fix variable initialization
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-10-29 23:11:08 +01:00
Felix Fietkau
15ce776772 ustream-example: fix logic inversion 2012-10-23 18:00:20 +02:00
Felix Fietkau
6e7e8a1a91 uloop: fix a segfault on deleting the first active timer from within another timer 2012-10-23 03:41:45 +02:00