1. 27 Oct, 2014 2 commits
    • David Gibson's avatar
      mem: Correct testcases · 2ab3ac5b
      David Gibson authored
      Currently the 'mem' module testcases use test/run.c even though they don't
      rely on access to the module internals.  They're also missing an include
      of mem.c, which has the effect that on systems with a C library memmem()
      implementaiton, only that is tested, not the (re-)implementation in the
      mem module itself.  This corrects that by moving run.c to api.c/
      
      Additionally, the memmem() testcases don't cover the case where the
      "needle" appears multiple times in the "haystack".  This patch also adds
      such a test.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      2ab3ac5b
    • David Gibson's avatar
      mem: Rename memmem module to mem · 992931f0
      David Gibson authored
      Currently the 'memmem' module does nothing but provide an implementation of
      the memmem() function if it is missing from the standard C library.
      
      However there are other functions (e.g. memrchr()) also missing from some
      C library implementations, so rename the module to mem to allow future
      inclusion of other functions.
      
      This also updates the rfc822 module - the only existing user of the
      memmem module - to use the new name.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      992931f0
  2. 25 Oct, 2014 6 commits
  3. 23 Oct, 2014 1 commit
    • Chris McCormick's avatar
      Changed the look of the website. Added a new logo design (source SVG... · 08f71340
      Chris McCormick authored
      Changed the look of the website. Added a new logo design (source SVG included). Fixed an issue with junkcode prefix not being set (broken links and images on current site). Removed /tmp/ccan in clean as it was preventing 'make webpages' running twice. Brought the HTML closer to standards compliance (doctype, encoding). Added meta tag for mobile device browsers to render nicely.
      08f71340
  4. 13 Oct, 2014 7 commits
  5. 13 Sep, 2014 3 commits
  6. 27 Aug, 2014 2 commits
  7. 18 Aug, 2014 4 commits
  8. 15 Aug, 2014 1 commit
  9. 12 Aug, 2014 1 commit
  10. 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
  11. 05 Aug, 2014 1 commit
  12. 04 Aug, 2014 7 commits
  13. 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
  14. 01 Aug, 2014 1 commit