1. 13 Sep, 2014 3 commits
  2. 27 Aug, 2014 2 commits
  3. 18 Aug, 2014 4 commits
  4. 15 Aug, 2014 1 commit
  5. 12 Aug, 2014 1 commit
  6. 08 Aug, 2014 2 commits
    • Rusty Russell's avatar
      io: always make fds O_NONBLOCK. · 89762615
      Rusty Russell authored
      Debugging an issue where pettycoin would become unresponsive, I discovered
      this:
      
      poll([{fd=5, events=POLLIN}, {fd=19, events=POLLIN}, {fd=6, events=POLLIN}, {fd=15, events=POLLIN}, {fd=8, events=POLLIN}, {fd=-11}, {fd=7, events=POLL
      OUT}], 7, -1) = 1 ([{fd=7, revents=POLLOUT}]) <0.000014>
      write(7, "\224]\4\0\4\0\0\0\200\203\16\234\v\262\276\321h\357\217Y\0\204\21\31\253\304#U\0206}\20"..., 286100) = 159280 <98.894019>
      
      Despite poll saying the (TCP socket) fd was ready, the write took 98 seconds!
      The results were far more reasonable with O_NONBLOCK:
      
      write(9, "%\247l0\337^\216\24\323\2705\203Y\340h\2767/bM\373?dM\254\22g\310\v\0\0\0"..., 206460) = 40544 <0.000052>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      89762615
    • Rusty Russell's avatar
      io: don't do wakeup immediately. · 8d94c52a
      Rusty Russell authored
      ccan/io users don't expect to deal with callbacks inside each other; we should
      just mark woken connections as if they were io_always.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      8d94c52a
  7. 05 Aug, 2014 1 commit
  8. 04 Aug, 2014 7 commits
  9. 03 Aug, 2014 2 commits
    • Rusty Russell's avatar
      ccan/io: rewrite. · cdffdf5d
      Rusty Russell authored
      I found it difficult to use myself, particularly io_duplex().
      
      So this removes that, as well as timers and debug (for the moment).
      
      API changes:
      1) An io_plan is passed by pointer, rather than copied on the stack.
      3) All io_plans are generated using the struct io_conn.
      3) tal is the allocator.
      4) A new connection must be set up with a callback, so this is now the
         same as one generated from a listener.
      5) io_read_partial and io_write_partial take an explicit length.
      6) io_always() and io_wait() take an explit in/out arg.
      7) io_break() does not return a plan.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      cdffdf5d
    • Rusty Russell's avatar
      ccan/io: fix io_connect. · 12e92434
      Rusty Russell authored
      getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len) gives err == ECONNREFUSED
      when connection is refused.  Handle this (and other error cases).
      
      And we need F_SETFL not F_SETFD to restore blocking on the socket!
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      12e92434
  10. 01 Aug, 2014 1 commit
  11. 29 Jul, 2014 2 commits
    • Cody P Schafer's avatar
      configurator: add BUILTIN_CTZ*, BUILTIN_FFS, and ICCARM_INTRINSICS · 54d5123a
      Cody P Schafer authored
      Realistically, the ICCARM_INTRINSICS probably won't ever be generated
      by configurator, but will show up in manually created or alternately
      generated config.h's.
      Signed-off-by: default avatarCody P Schafer <dev@codyps.com>
      54d5123a
    • Douglas Bagnall's avatar
      opt/helpers: fix out-of-range check in opt_set_floatval() · 106eab33
      Douglas Bagnall authored
      opt_set_floatval() uses opt_set_doubleval() to do initial conversion
      and bounds checking before casting the result to float.  Previously
      the out of bounds check compared the original and float values for
      equality and declared anything unequal to be out of bounds. While this
      trick works well in the orderly integer world, it can backfire with
      floating point. For example, 3.1 resolves to the double more precisely
      known as 3.100000000000000088817841970012523233890533447265625, while
      3.1f resolves to 3.099999904632568359375.  These are not equal, though
      3.1 is generally regarded as being in bounds for a float.  There are
      around 8 billion other doubles (i.e. 3.1 +/- a little bit) that map to
      the same 3.1f value, of which only one is strictly equal to it.
      
      Why wasn't this discovered by the tests? It turns out that neither
      set_floatval nor set_doubleval were tested against non-integral
      numbers.  This is slightly improved here.
      
      This patch uses the arguably more reasonable definition of bounds that
      is found in opt_set_doubleval(): it excludes numbers that would get
      rounded to zero or an infinity. One subtlety is that the double
      version allows `--foo=INF` for an explicit infinity without overflow.
      This is possibly useful, and there is some fiddling to allow this for
      floats. Likewise an explicit zero is allowed, as you would expect.
      
      It is perhaps worth noting that the `*f = d` cast/assignment at the
      heart of it all can crash and core dump on overflow or underflow if
      the floating point exception flags are in an unexpected state.
      Signed-off-by: default avatarDouglas Bagnall <douglas@halo.gen.nz>
      106eab33
  12. 25 Jul, 2014 1 commit
  13. 17 Jul, 2014 1 commit
  14. 25 Jun, 2014 1 commit
  15. 23 Jun, 2014 6 commits
  16. 22 Jun, 2014 1 commit
  17. 21 Jun, 2014 3 commits
  18. 16 Jun, 2014 1 commit