1. 08 Oct, 2016 2 commits
  2. 07 Oct, 2016 3 commits
    • Nicholas Ormrod's avatar
      Disallow COW in FBString · 427c43f4
      Nicholas Ormrod authored
      Summary:
      Remove all code that create large strings.
      
      This diff does not remove code that deals with large strings, so that the transition to libgcc will be smoother. Note that the FBSTRING_ASSERT inside of setCapacity will be disabled in the libgcc build.
      
      Reviewed By: luciang, ot
      
      Differential Revision: D3977459
      
      fbshipit-source-id: 09c1712854b31509138c5cc8baf19caf3c715bb6
      427c43f4
    • Lucian Grijincu's avatar
      folly: symbolizer: increase default signal-handler symbolizer elf file cache... · bde0ad1f
      Lucian Grijincu authored
      folly: symbolizer: increase default signal-handler symbolizer elf file cache size (make it work with large number of .so)
      
      Summary:
      Bump the default size so we can symbolize symbols in dynamically linked
      binaries with lots and lots of shared libraries :)
      
      folly/experimental/symbolizer/ElfCache.h
      ```
        * Will not grow; once the capacity is reached, lookups for files that
        * aren't already in the cache will fail (return nullptr).
        class SignalSafeElfCache
      ```
      
      Reviewed By: ot, philippv
      
      Differential Revision: D3984649
      
      fbshipit-source-id: acdca9b9adf6c16f3a1556bc3f57b28844cdd9cc
      bde0ad1f
    • Mirek Klimos's avatar
      FunctionScheduler - return whether shutdown was successful · 46930a2a
      Mirek Klimos authored
      Summary: We want to fail fast if we attempt to stop a scheduler that was not running
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3976919
      
      fbshipit-source-id: d8aa8b35aa9e22758e6a7ef64f48a7dd6d990b1c
      46930a2a
  3. 06 Oct, 2016 3 commits
    • Alex Yarmula's avatar
      Reverted commit D3979179 · b59ee680
      Alex Yarmula authored
      Summary:
      When `delayed` is called on the Future, the underlying `futures::sleep` call runs on a timer thread, and the resulting callback is called on the same thread. Therefore, in the following sequence:
      
        f.via(&someExecutor).within(one_ms).then([&]() { /* [1] */ })
      
      The code in [1] is not running in someExecutor. This can cause confusion by users of the library who expect the initial `via` to be sticky.
      
      This change returns to the prior `Executor` after `delayed` is finished.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3979179
      
      fbshipit-source-id: e1448f5603f0c9440490ae3bf0e670687f4179f3
      b59ee680
    • Jim Meyering's avatar
      folly/io: avoid shadowing warnings · d359ca68
      Jim Meyering authored
      Summary: Fix shadowing warnings.
      
      Reviewed By: russoue
      
      Differential Revision: D3979165
      
      fbshipit-source-id: 19a3940e210e4d5a698dbc0e6d74b317a74a94fa
      d359ca68
    • Alex Yarmula's avatar
      use previous Executor after delayed · 67fcea20
      Alex Yarmula authored
      Summary:
      When `delayed` is called on the Future, the underlying `futures::sleep` call runs on a timer thread, and the resulting callback is called on the same thread. Therefore, in the following sequence:
      
        f.via(&someExecutor).within(one_ms).then([&]() { /* [1] */ })
      
      The code in [1] is not running in someExecutor. This can cause confusion by users of the library who expect the initial `via` to be sticky.
      
      This change returns to the prior `Executor` after `delayed` is finished.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3979179
      
      fbshipit-source-id: 936ff5626e8ac377ffb15babf573349466984e3a
      67fcea20
  4. 05 Oct, 2016 7 commits
  5. 04 Oct, 2016 6 commits
    • Qinfan Wu's avatar
      Implicit construct sorted_vector_set from std::initializer_list · 06767a9b
      Qinfan Wu authored
      Summary:
      The following thrift file doesn't work:
        typedef set<i32> (cpp.template = "folly::sorted_vector_set") IntSet
        struct Test {
          1: map<i32, IntSet> m = {7: [1, 2]},
        }
      
      The generated file looks like this:
        Test()
            : m(std::initializer_list<
                std::pair<const int32_t, folly::sorted_vector_set<int32_t>>>{
                {7, std::initializer_list<int32_t>{1, 2}}}) {}
      
      Given that `std::set` allows implicit construction from `std::initializer_list`, it's probably okay to make `folly::sorted_vector_set` the same.
      
      Reviewed By: ot
      
      Differential Revision: D3968054
      
      fbshipit-source-id: 978d59a7e545e44d603eeb9671815ac7f2c57342
      06767a9b
    • Jim Meyering's avatar
      folly/io/async/AsyncSocket.cpp: avoid shadowing warning for "rv" · 0e125753
      Jim Meyering authored
      Summary:
      Enabling the proposed-for-upstream gcc -Wshadow-local option exposes this shadowing:
      ```
      folly/io/async/AsyncSocket.cpp: In member function 'virtual void folly::AsyncSocket::connect(folly::AsyncSocket::ConnectCallback*, const folly::SocketAddress&, int, const OptionMap&, const folly::SocketAddress&)':
      folly/io/async/AsyncSocket.cpp:421:11: error: declaration of 'rv' shadows a previous local [-Werror=shadow-compatible-local]
      folly/io/async/AsyncSocket.cpp:364:9: error: shadowed declaration is here [-Werror=shadow-compatible-local]
      ```
      
      Reviewed By: ngoyal, knekritz
      
      Differential Revision: D3963873
      
      fbshipit-source-id: 85b3ab1fc3b200b81615a00d66a183cc9c792a90
      0e125753
    • Arthur O'Dwyer's avatar
      hazptr: Replace friend "swap" with a member function and a non-friend · 4d012b25
      Arthur O'Dwyer authored
      Summary:
      This matches what the STL does with e.g. std::vector::swap() and std::shared_ptr::swap().
      
      http://en.cppreference.com/w/cpp/container/vector/swap
      http://en.cppreference.com/w/cpp/memory/shared_ptr/swap
      
      Should be relatively uncontroversial, I would think.
      Closes https://github.com/facebook/folly/pull/489
      
      Reviewed By: magedm
      
      Differential Revision: D3963285
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 3fa6bf77e66fa9a673cb648b0bf87b1db3caa6c8
      4d012b25
    • Jim Meyering's avatar
      folly/io/Compression.cpp: avoid shadowing warnings for "rc" · e7256a8a
      Jim Meyering authored
      Summary:
      gcc's -Wshadow (and the under-review -Wshadow-local) would evoke this:
      ```
      folly/io/Compression.cpp:650:9: error: declaration of 'rc' shadows a previous local [-Werror=shadow-compatible-local]
      folly/io/Compression.cpp:637:7: error: shadowed declaration is here [-Werror=shadow-compatible-local]
      folly/io/Compression.cpp:566:9: error: declaration of 'rc' shadows a previous local [-Werror=shadow-compatible-local]
      folly/io/Compression.cpp:548:7: error: shadowed declaration is here [-Werror=shadow-compatible-local]
      ```
      In each case, I removed the "int" from the latter declaration.
      
      Reviewed By: philippv
      
      Differential Revision: D3966308
      
      fbshipit-source-id: 584cb9ffe8ba0e56914223c440efabe9e0de6b17
      e7256a8a
    • Giuseppe Ottaviano's avatar
      Outline several fbstring/malloc functions · 2ff9d181
      Giuseppe Ottaviano authored
      Summary: Outline all the non-trivial constructor and the destructor, `assign()`, and `append()` to reduce code size. The fast path of copy, and moves, are instead still inlined.
      
      Reviewed By: philippv
      
      Differential Revision: D3896612
      
      fbshipit-source-id: 25050d4ba28d25da226a7bc49d5b542947d0c512
      2ff9d181
    • Giuseppe Ottaviano's avatar
      Fix a typo · 471f03d0
      Giuseppe Ottaviano authored
      Reviewed By: lbrandy
      
      Differential Revision: D3964328
      
      fbshipit-source-id: 0b1dc2d4b2a1565019770668445a624625b8257e
      471f03d0
  6. 03 Oct, 2016 3 commits
    • Shubhanshu Agrawal's avatar
      add BatchDispatcher · 52736dce
      Shubhanshu Agrawal authored
      Summary:
      This diff adds BatchDispatcher, which can be used to batch values while performing IO.
      This would be useful in writing single id code in node, and would be use to batch ids while doing IO at storage adapter.
      
      Differential Revision: D3900404
      
      fbshipit-source-id: f53aa352344ff55674c7544302b6a1b4726214b6
      52736dce
    • Giuseppe Ottaviano's avatar
      Optimize frequently inlined FBString methods · be4c6d6b
      Giuseppe Ottaviano authored
      Summary:
      Almost every method of `fbstring` needs to perform category
      dispatching. The category constants are `size_t`, which become 8-byte
      immediate values in the dispatching code, so even a simple `if
      (category() == Category::isSmall)` is quite large. When inlined
      hundreds of thousands of time, it adds up.
      
      This diff redefines the category type to be 1 byte (without changing
      the ABI). It also optimizes `size()` and `c_str()` and makes them
      branch-free, which probably is not going to have any perf impact but
      it saves a few bytes.
      
      Generated code for some small functions:
      
      - `reset()`
      Before:
      ```
      48 ba 00 00 00 00 00    movabs $0x1700000000000000,%rdx
      00 00 17
      48 89 f8                mov    %rdi,%rax
      c6 07 00                movb   $0x0,(%rdi)
      48 89 57 10             mov    %rdx,0x10(%rdi)
      ```
      
      20 bytes
      
      After:
      ```
      48 89 f8                mov    %rdi,%rax
      c6 47 17 17             movb   $0x17,0x17(%rdi)
      c6 07 00                movb   $0x0,(%rdi)
      ```
      
      10 bytes
      
      - `c_str()`
      Before:
      ```
      48 b8 00 00 00 00 00    movabs $0xc000000000000000,%rax
      00 00 c0
      48 85 47 10             test   %rax,0x10(%rdi)
      74 08                   je     401fd8
      48 8b 07                mov    (%rdi),%rax
      c3                      retq
      0f 1f 40 00             nopl   0x0(%rax)
      48 89 f8                mov    %rdi,%rax
      ```
      
      26 bytes (without the `retq`)
      
      After:
      ```
      f6 47 17 c0             testb  $0xc0,0x17(%rdi)
      48 89 f8                mov    %rdi,%rax
      48 0f 45 07             cmovne (%rdi),%rax
      ```
      
      11 bytes
      
      - `size()`
      Before:
      ```
      48 b8 00 00 00 00 00    movabs $0xc000000000000000,%rax
      00 00 c0
      48 85 47 10             test   %rax,0x10(%rdi)
      74 08                   je     401fa8
      48 8b 47 08             mov    0x8(%rdi),%rax
      c3                      retq
      0f 1f 00                nopl   (%rax)
      48 0f be 57 17          movsbq 0x17(%rdi),%rdx
      b8 17 00 00 00          mov    $0x17,%eax
      48 29 d0                sub    %rdx,%rax
      ```
      
      36 bytes (without the `retq`)
      
      After:
      ```
      0f b6 57 17             movzbl 0x17(%rdi),%edx
      b8 17 00 00 00          mov    $0x17,%eax
      48 29 d0                sub    %rdx,%rax
      48 0f 48 47 08          cmovs  0x8(%rdi),%rax
      ```
      
      17 bytes
      
      Reviewed By: philippv
      
      Differential Revision: D3957276
      
      fbshipit-source-id: ef40d82bbbb0456b1044421cd02133c268abe39b
      be4c6d6b
    • Philip Pronin's avatar
      switch back to inline assembly in compression::instructions · 11e98e93
      Philip Pronin authored
      Summary:
      D3278901 never worked, GCC (at least 4.9) failed to propagate
      `FOLLY_TARGET_ATTRIBUTE("arch=haswell")` down, `blsr` and `select64`
      weren't inlined in EF coding on Haswell, showing up in CPU profile.
      
      This diff switches back to inline assembly, removing second dispatching
      mechanism (IFUNC; in additional to caller-side `Default` / `Nehalem` / `Haswell`
      dispatching) for `compression::instructions`, and disables functionality on
      compilers not supporting AT&T syntax (MSVC++) for now.
      
      Added `FOLLY_ALWAYS_INLINE` to make sure failure to inline results in
      compilation failure.
      
      Reviewed By: ot
      
      Differential Revision: D3959438
      
      fbshipit-source-id: e40573fbfbf38991caa2cd70293aeaeeec3afad7
      11e98e93
  7. 02 Oct, 2016 1 commit
    • Sven Over's avatar
      Fix folly::Partial copy/move construction · 806a09e4
      Sven Over authored
      Summary:
      Any attempt to copy or move an object returned by folly::partial
      yields a compiler error because it is invoking the constructor
      for wrapping callable objects, which triggers a type mismatch.
      
      This diff fixes that by explicitly naming the default implementations
      of copy and move constructors.
      
      This diff also adds additional tests that fail to compile without this fix.
      
      And then this diff also moves the Partial class into folly::detail,
      because it is not meant to be named in user code, but only returned
      by the folly::partial function.
      
      Reviewed By: mhx
      
      Differential Revision: D3923809
      
      fbshipit-source-id: a8883951afd2a1999acbfffc51296393b058f860
      806a09e4
  8. 30 Sep, 2016 2 commits
    • Lucian Grijincu's avatar
      folly: use std::__throw_out_of_range · eb6bd53f
      Lucian Grijincu authored
      Summary:
      A ton of these functions are tiny and should be inlined. `throw std::out_of_range("bla")` generates quite a lot of code.
      
      See godbolt from {D3940968}: https://godbolt.org/g/9K36Km
      
        advanceNoInline(S):
                movq    %rdi, %rax
                sarq    $32, %rax
                cmpl    %eax, %edi
                jg      .L20
                leal    1(%rdi), %eax
                ret
        .L20:
                subq    $8, %rsp
                call    S::outOfRange() [clone .isra.0]
      
      vs previous implementation
      
        advance(S):
                movq    %rdi, %rdx
                sarq    $32, %rdx
                cmpl    %edx, %edi
                jg      .L14
                leal    1(%rdi), %eax
                ret
        .L14:
                pushq   %rbp
                pushq   %rbx
                movl    $16, %edi
                subq    $8, %rsp
                call    __cxa_allocate_exception
                movl    $.LC0, %esi
                movq    %rax, %rdi
                movq    %rax, %rbx
                call    std::out_of_range::out_of_range(char const*)
                movl    std::out_of_range::~out_of_range(), %edx
                movl    typeinfo for std::out_of_range, %esi
                movq    %rbx, %rdi
                call    __cxa_throw
                movq    %rax, %rbp
                movq    %rbx, %rdi
                call    __cxa_free_exception
                movq    %rbp, %rdi
                call    _Unwind_Resume
      
      This pattern is in the standard library as well:
      ```
            reference
            at(size_type __n)
            {
      	if (__n >= _Nm)
      	  std::__throw_out_of_range(__N("array::at"));
      	return _M_instance[__n];
            }
      ```
      
      https://github.com/gcc-mirror/gcc/blob/edd716b6b1caa1a5cb320a8cd7f626f30198e098/libstdc%2B%2B-v3/include/tr1/array#L138
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3947075
      
      fbshipit-source-id: 6e174c725791762a533a534c8482ea9576460b86
      eb6bd53f
    • Ted Percival's avatar
      Find dwarf.h in libdwarf subdirectory · fc8025b4
      Ted Percival authored
      Summary:
      libdwarf headers moved from `/usr/include` to `/usr/include/libdwarf` in [dwarfutils 20160613-2](http://metadata.ftp-master.debian.org/changelogs/main/d/dwarfutils/unstable_changelog).
      
      Adds a check for the library as well, and fixes a tiny typo in the `libunwind` check.
      
      No longer checks for `libdwarf.h`; only `dwarf.h` is used.
      Closes https://github.com/facebook/folly/pull/480
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3878961
      
      Pulled By: Orvid
      
      fbshipit-source-id: 7970d33511bf6d351cec2c8077cb07b85f2f8d33
      fc8025b4
  9. 29 Sep, 2016 5 commits
    • Lucian Grijincu's avatar
      folly: Range: detail::throwOutOfRange -> std::__throw_out_of_range · 10ff2d21
      Lucian Grijincu authored
      Summary:
      No need to define our own.
      
      Generated code is similar: https://godbolt.org/g/5xWrNx (one extra move instruction).
      
      ```
      .L20:
              subq    $8, %rsp
              call    S::outOfRange() [clone .isra.0]
      ```
      
      ```
      .LC1:
              .string "out of range"
      .L26:
              subq    $8, %rsp
              movl    $.LC1, %edi
              call    std::__throw_out_of_range(char const*)
      ```
      
      Reviewed By: Orvid
      
      Differential Revision: D3945578
      
      fbshipit-source-id: c65e9dea55e8f01f51766b2695af68d2bc92c266
      10ff2d21
    • Dan Schatzberg's avatar
      Fix ThreadCachedInt race condition · 6039ee41
      Dan Schatzberg authored
      Summary:
      Acquire a SharedMutex at ThreadExit to ensure that after unlinking the ThreadEntry from
      the list, future accessAllThreads() won't miss a destroying thread.
      
      This is quite a dangerous fix as it changes some lock ordering semantics. ThreadLocal
      elements are now destroyed while holding a lock, so if the destruction function
      acquires a different lock, ordering must be consistent with other
      uses of accessAllThreads().
      
      I've made accessAllThreads() an opt-in feature via a template parameter and changed
      all existing uses. I've also fixed a few lock ordering issues that arose due to this
      change.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D3931072
      
      fbshipit-source-id: 4d464408713184080079698df453b95873bb1a6c
      6039ee41
    • Subodh Iyengar's avatar
      Fix apple bug around TFO writes · 546ea578
      Subodh Iyengar authored
      Summary:
      When using connectx to do TFO, apple has a bug
      where the second write after a TFO write will cause
      the socket to throw an ENOTCONN error instead of an
      EAGAIN. Linux handles this case fine and returns an
      EAGAIN, however apple returns ENOTCONN.
      
      We solve this by treating ENOTCONN as an EAGAIN temporarily.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3942681
      
      fbshipit-source-id: ab4f0b5fd6cdcfe9c584ea00849705a2d739d65f
      546ea578
    • Subodh Iyengar's avatar
      Add tfo functions for apple · edbb8ae9
      Subodh Iyengar authored
      Summary:
      Adds TFO functions for apple devices
      Also allows android as well by removing that
      restriction. Newer versions of android support
      TFO, so this allows us to experiment with them
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3942664
      
      fbshipit-source-id: faf439783b018cf7c987a2e3ade5ea6c0c02bf48
      edbb8ae9
    • Lucian Grijincu's avatar
      folly: Range: outline exception throwing · d6c0ba01
      Lucian Grijincu authored
      Summary:
      Here's some godbolt: https://godbolt.org/g/9K36Km
      
        advanceNoInline(S):
                movq    %rdi, %rax
                sarq    $32, %rax
                cmpl    %eax, %edi
                jg      .L20
                leal    1(%rdi), %eax
                ret
        .L20:
                subq    $8, %rsp
                call    S::outOfRange() [clone .isra.0]
      
      vs previous implementation
      
        advance(S):
                movq    %rdi, %rdx
                sarq    $32, %rdx
                cmpl    %edx, %edi
                jg      .L14
                leal    1(%rdi), %eax
                ret
        .L14:
                pushq   %rbp
                pushq   %rbx
                movl    $16, %edi
                subq    $8, %rsp
                call    __cxa_allocate_exception
                movl    $.LC0, %esi
                movq    %rax, %rdi
                movq    %rax, %rbx
                call    std::out_of_range::out_of_range(char const*)
                movl    std::out_of_range::~out_of_range(), %edx
                movl    typeinfo for std::out_of_range, %esi
                movq    %rbx, %rdi
                call    __cxa_throw
                movq    %rax, %rbp
                movq    %rbx, %rdi
                call    __cxa_free_exception
                movq    %rbp, %rdi
                call    _Unwind_Resume
      
      Reviewed By: ot
      
      Differential Revision: D3940968
      
      fbshipit-source-id: b47a41e7cdd863fcef099ff3c21860b2979ee6e8
      d6c0ba01
  10. 28 Sep, 2016 4 commits
    • Giuseppe Ottaviano's avatar
      Add unchecked versions of advance(), subtract(), and subpiece() in Range · 998f6331
      Giuseppe Ottaviano authored
      Summary:
      `Range` has a somewhat inconsistent API: most methods assume
      argument validity as a precondition (mirroring their STL
      counterparts), others check the arguments and throw for invalid ones.
      
      Since `Range` is intended as a zero-cost abstraction on top of
      pointers/iterators, unchecked methods should be preferred. At this
      point however we cannot change the semantics of `advance()` and other
      methods. This diff adds new unchecked versions of these methods.
      
      Reviewed By: luciang
      
      Differential Revision: D3938480
      
      fbshipit-source-id: 6952683ee0716aa1584e79584158fbf3e083b52e
      998f6331
    • Witchakorn Kamolpornwijit's avatar
      Fix SUPPLY_MISSING_INT128_TRAITS · c85f38c3
      Witchakorn Kamolpornwijit authored
      Summary:
      The original code `AC_DEFINE([FOLLY_SUPPLY_MISSING_INT128_TRAITS...` resulted in defining the constant FOLLY_FOLLY_SUPPLY_MISSING_INT128_TRAITS in folly-config.h. This patch fix the name of the constant so that the name match with what appear in Traits.h.
      Closes https://github.com/facebook/folly/pull/485
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3931349
      
      Pulled By: Orvid
      
      fbshipit-source-id: bd7e7d3580d02134d36706bd5836822135232d26
      c85f38c3
    • Maged Michael's avatar
      folly/experimental/hazptr: fix gcc 5 build · d6e6f8b4
      Maged Michael authored
      Summary: Fix includes in memory_resource.h
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3935848
      
      fbshipit-source-id: 713ce85ad17072779dfa1c667459e367c5e1d4b7
      d6e6f8b4
    • Michael Lee's avatar
      Set a default value for slot in SharedMutex.h · c532329a
      Michael Lee authored
      Summary:
      `SharedMutexImpl::lockSharedImpl` has a potentially uninitialized access:
      
        Assume state = 0
        canAlreadyDefer = (state & kMayDefer) != 0 ==> false
        aboveDeferThreshold = (state & kHasS) >= (kNumSharedToStartDeferring - 1) * kIncrHasS ==> false
      
        if (canAlreadyDefer || (aboveDeferThreshold && !drainInProgress)) ==> false
      
        line:1452: gotSlot(slot)->compare_exchange_strong(...) uses slot uninitialized
      
      Reviewed By: Orvid
      
      Differential Revision: D3933638
      
      fbshipit-source-id: 0fbce5c00b8b1f34e50c302cb88def97853c5afe
      c532329a
  11. 27 Sep, 2016 1 commit
    • Sven Over's avatar
      Introducing folly::FunctionRef · 4b39d461
      Sven Over authored
      Summary:
      This commit introduces a simple function reference type, similar to
      std::reference_wrapper, but the template parameter is the function
      signature type rather than the type of the referenced object.
      
      A folly::FunctionRef is cheap to construct as it contains only a
      pointer to the referenced callable and a pointer to a function which
      invokes the callable.
      
      The user of FunctionRef must be aware of the reference semantics:
      storing a copy of a FunctionRef is potentially dangerous and should
      be avoided unless the referenced object definitely outlives the
      FunctionRef object. Thus any function that accepts a FunctionRef
      parameter should only use it to invoke the referenced function and
      not store a copy of it. Knowing that FunctionRef itself has reference
      semantics, it is generally okay to use it to reference lambdas that
      capture by reference.
      
      Reviewed By: ericniebler
      
      Differential Revision: D3277364
      
      fbshipit-source-id: 0a7676919cd240da5b6e1f94cadba4289e0aca28
      4b39d461
  12. 26 Sep, 2016 3 commits
    • Anirudh Ramachandran's avatar
      SSL_SESSION wrapper · 4450b4ac
      Anirudh Ramachandran authored
      Summary:
      This is a start to wrapping various SSL objects going forward so different
      binaries can choose different version of OpenSSL (i.e., BoringSSL, OpenSSL
      1.1.0, OpenSSL 1.0.2, etc.). There's no change to the caller - everyone just
      uses 'SSLSession', but the implementation details vary
      
      Reviewed By: siyengar
      
      Differential Revision: D3707791
      
      fbshipit-source-id: f895334a768cb7d43b41af40c9bc06be5307cc7f
      4450b4ac
    • Anirudh Ramachandran's avatar
      AsyncSSLSocket::getSSLClientCiphers using static map · 67dac89c
      Anirudh Ramachandran authored
      Summary:
      OpenSSL SSL_METHOD->get_cipher_by_char is not present in either OpenSSL
      1.1.0 or BoringSSL. In addition, knekritz reports that time's being spent in
      binary searching for cipher names.
      
      Since the ciphercodes and names are (fairly) static, we store these in a static
      hash map.
      
      Reviewed By: siyengar
      
      Differential Revision: D3275185
      
      fbshipit-source-id: 08b36f3e73239b415b74c6ecc30ed65832d9ebd0
      67dac89c
    • Phil Willoughby's avatar
      Make a SharedPromise from a Future · 8bed0626
      Phil Willoughby authored
      Summary: Makes it easy to split a Future into multiple Futures
      
      Reviewed By: rongrong
      
      Differential Revision: D3885897
      
      fbshipit-source-id: 6ac9fb22444dd828fbdebb44b06bf3d93d0f7583
      8bed0626