- 17 Mar, 2017 2 commits
-
-
Brian Smith authored
Summary: This is more in line with "traditional" output from cli tools on *nix. Reviewed By: yfeldblum Differential Revision: D4719055 fbshipit-source-id: 2389a4a2a49f18d4b3d0257f68036f73f8fbc49e
-
Andreas C. Osowski authored
Summary: Adds a default inline implementation for `std::hash` and `std::equal_to` to `folly::Uri`. Both do the comparison / hash based upon the return value of `folly::Uri::toString`. Reviewed By: yfeldblum Differential Revision: D4711506 fbshipit-source-id: f4c2a9de8d4302fd315a9f31329cc8ba9f5e0409
-
- 16 Mar, 2017 2 commits
-
-
Michael Steinert authored
Summary: I'm working on a project where the target platform is tiny a bit out of date: $ openssl version OpenSSL 1.0.0-fips 29 Mar 2010 For various "reasons" I'm not able to update it at this time, however I would like to use Proxygen (and hence Folly). This patch allows Folly to compile with the above version of OpenSSL. Closes https://github.com/facebook/folly/pull/562 Reviewed By: Orvid Differential Revision: D4715116 Pulled By: yfeldblum fbshipit-source-id: be38ffb78f1e5cee971ce8cb81936b7f16efe050
-
JiaJie Ye authored
Summary: Add getPeerAddress/getLocalAddress folly::SocketAddress() function Reviewed By: yfeldblum Differential Revision: D4706693 fbshipit-source-id: 534e862f4168bc9e7bb02e41eac8e2ced6a02c59
-
- 15 Mar, 2017 3 commits
-
-
Christopher Dykes authored
Summary: To GCC 4.8, because it's not *quite* dead yet. This is needed to get FixedString working properly on GCC 4.8 Reviewed By: yfeldblum Differential Revision: D4646026 fbshipit-source-id: 075df04e479bd2b11f6538da2ed3e78b59956621
-
Michael Steinert authored
Summary: I encountered a situation where "pkg-config --libs openssl" included some linker flags, i.e. $ pkg-config --libs openssl -Wl,-z,relro -lssl -lcrypto -ldl -lz This resulted in these linker flags being passed to sed. This change filters out the linker flags from the pkg-config output. Closes https://github.com/facebook/folly/pull/559 Reviewed By: pixelb Differential Revision: D4700120 Pulled By: yfeldblum fbshipit-source-id: 530d524caf965919418d19a1df53d2b418f67717
-
Felix Handte authored
Summary: This diff adds string-based compress and uncompress support to folly::io::Codec. By default, the string API is implemented by translating to and from IOBufs. Room is left for individual implementations to override that behavior and go straight to the underlying library. Reviewed By: yfeldblum Differential Revision: D4690770 fbshipit-source-id: 7e2615da9add8328654505cdda6a2c79583b4558
-
- 14 Mar, 2017 3 commits
-
-
Michael Steinert authored
Summary: Closes https://github.com/facebook/folly/pull/560 Reviewed By: pixelb Differential Revision: D4700198 Pulled By: yfeldblum fbshipit-source-id: 5e251e5719c6783c9f8a4fd9bab357ed362340c0
-
Michael Steinert authored
Summary: This option is useful when compiling on systems that do not want to include libunwind. Closes https://github.com/facebook/folly/pull/558 Reviewed By: andrewjcg Differential Revision: D4701878 Pulled By: yfeldblum fbshipit-source-id: 61765e2e04ea1da510f06d7805c2c54381aa771e
-
Dmitry Pleshkov authored
Summary: Use default constructor directly, instead of copying the element introduced by default parameter value. This behavior is compatible with `std::vector`. Reviewed By: ot, bixue2010, luciang Differential Revision: D4700611 fbshipit-source-id: d3bd82c46c2857f5abcbec5dd2a64aaa85eaefe4
-
- 13 Mar, 2017 4 commits
-
-
Christopher Dykes authored
Summary: Folly supports being compiled without all of the compression libraries, so we need a way to determine at runtime what libraries Folly has been compiled to support. Reviewed By: yfeldblum Differential Revision: D4692556 fbshipit-source-id: 0ec459db70a4b1d64f1e07c87a1f51ae584bccd0
-
Nick Terrell authored
Summary: Modify `QueueAppender::pushAtMost(const uint8_t*, size_t)` to fill the end of the current buffer before it allocates another. Reviewed By: yfeldblum Differential Revision: D4687832 fbshipit-source-id: 7c21f4359da9f0cf26d9577abddfd640b0c877e9
-
Tom Jackson authored
Summary: Since this is a not-uncommon pattern now: ```lang=cpp if (auto found1 = get_ptr(m, k1)) { if (auto found2 = get_ptr(*found, k2)) { return use(*found2); } } ``` This diff enables: ```lang=cpp if (auto found = get_ptr(m, k1, k2)) { return use(*found); } ``` Note that it works for const and non-const maps, returning a correspondingly mutable pointer. Reviewed By: luciang, yfeldblum Differential Revision: D3812701 fbshipit-source-id: 77ace9f5dca6cdc4cae7e6dfb9e5fc1075b5b571
-
Phil Willoughby authored
Summary: With more experience of using folly::Singleton in our code we have found new recommendations for how it should be used. This change updates the documentation block to include those recommendations. Reviewed By: yfeldblum Differential Revision: D4688700 fbshipit-source-id: 40350c2330084a28f1dc0744176d0ac8a0e64d39
-
- 11 Mar, 2017 1 commit
-
-
Andrii Grynenko authored
Summary: EventBase support is achieved through default VirtualEventBase mechanism. Reviewed By: yfeldblum Differential Revision: D4685948 fbshipit-source-id: 15c8c789a55776984aa9087455e3f7b79d7604ad
-
- 10 Mar, 2017 7 commits
-
-
Maged Michael authored
Summary: IndexedMemPool uses regular memory for the global and local next links. There can be concurrent reads and writes of such links. In order to avoid C++ undefined behavior due to the data races, these links should be atomic. Relaxed loads and stores are sufficient for correctness. Depends on D4680286 Reviewed By: nbronson Differential Revision: D4680317 fbshipit-source-id: 27c0d888e08bd5d862aee4c6dc6ee393033b32e3
-
Christopher Dykes authored
Summary: It's a pain, so rely on macros to figure a few things about the build configuration. Reviewed By: yfeldblum Differential Revision: D4229128 fbshipit-source-id: 78b414c21cae6ba51ade2ab75b117cccad5c608c
-
Andrii Grynenko authored
Summary: This switches mcrouter to use VirtualEventBase as the unified way of managing its threads. This allows multiple mcrouters to be run on the same thread-pool, without having to keep separate shutdown logic. As an immediate win - this eliminates any special shutdown logic from tcc and standalone mcrouter. Reviewed By: jmswen Differential Revision: D4570982 fbshipit-source-id: 3974279005150e3e1db16230fde6b5951ae016b9
-
Kyle Nekritz authored
Summary: The new AsyncSocket is already constructed at this point so just use the event base from it. Reviewed By: djwatson Differential Revision: D4689395 fbshipit-source-id: aac898c1c6e6e0e0ffcb20b16bbf2b842cc31d54
-
Maxim Georgiev authored
Implementing a callback interface for folly::AsyncSocket allowing to supply an ancillary data buffer with msghdr structure to sendmsg() system call Summary: Implementing a callback interface for folly::AsyncSocket allowing to supply an ancillary data buffer with msghdr structure to sendmsg() system call. Reviewed By: afrind Differential Revision: D4422168 fbshipit-source-id: 29a23b05f704aff796d368f4ac9514c49b7ce578
-
Andrii Grynenko authored
Summary: Existing runInLoop implementation was generally not safe (it did not capture the KeepAlive token). runInLoop() is mostly used in library code though, and often times it's ok not capture the KeepAlive token. It's better to just have the caller make the decision, rather then keep runInLoop() and make it always capture the KeepAlive token. Reviewed By: yfeldblum Differential Revision: D4684025 fbshipit-source-id: 65907bbe9c774e2a7b92580d0c0387d346b495d5
-
Adam Simpkins authored
Summary: Even though an ostream operator<<() is defined for StringPiece, gtest doesn't use it when printing StringPiece values in test failure messages. Because StringPiece defines a nested iterator type gtest instead treats StringPiece as a container, and prints each of its elements (characters) one-by-one. This is fairly awkward to read. This diff defines an explicit PrintTo() function for StringPiece in folly/test/TestUtils.h. This makes gtest print StringPiece values nicely if you include TestUtils.h in your test sources. Reviewed By: yfeldblum Differential Revision: D4672257 fbshipit-source-id: 4b39ccc116e5382c29c37c2abe879293d310faf5
-
- 09 Mar, 2017 2 commits
-
-
Maged Michael authored
Summary: IndexedMemPool uses regular memory for the global and local next links. There is a data race as there can be concurrent reads and writes of such links. Added a test for data races. Reviewed By: nbronson Differential Revision: D4680286 fbshipit-source-id: 9ef3ed439b9df07d69afe570e516c146caa53a6c
-
Kyle Nekritz authored
Summary: MSG_PEEK was difficult if not impossible to use well since we do not provide a way wait for more data to arrive. If you are using setPeek on AsyncSocket, and you do not receive the amount of data you want, you must either abandon your peek attempt, or spin around the event base waiting for more data. This diff replaces the peek interface on AsyncSocket with a pre-received data interface, allowing users to insert data back onto the front of connections after reading some data in another layer. Reviewed By: djwatson Differential Revision: D4626315 fbshipit-source-id: c552e64f5b3ac9e40ea3358d65b4b9db848f5d74
-
- 08 Mar, 2017 6 commits
-
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D4671818 fbshipit-source-id: 80154adfef238f0be62da12fb843e22de1ae65ca
-
Christopher Dykes authored
Summary: GCC & Clang allow the use of a non-captured constexpr local within a lambda, MSVC does not. All 3 compilers allow this when the local has static storage. Reviewed By: yfeldblum Differential Revision: D4675147 fbshipit-source-id: 3e07eb77731cbd3ebda6aee4b0b57ac19ac34de5
-
Christopher Dykes authored
Summary: With the way it is currently, if `jemalloc.h` is included after `folly/Malloc.h`, `jemalloc.h` ends up redefining these. This changes it to just include `jemalloc.h` if we know we're compiling with JEMalloc. Reviewed By: yfeldblum Differential Revision: D4660285 fbshipit-source-id: 814e36432676e89cf7ba2bc5247b7dde2bfdc14a
-
Anirudh Ramachandran authored
Summary: D4624754 broke mcrouter-oss because that uses older OpenSSL (1.0.1). Reviewed By: yfeldblum, jmswen Differential Revision: D4670767 fbshipit-source-id: f297c8d3e013525bb36bd059eb40c70f0c4c2dcc
-
Jon Maltiel Swenson authored
Summary: Title. Reviewed By: yfeldblum Differential Revision: D4674125 fbshipit-source-id: 71ad38d7a52ab1c27fcc7ff14d130978b0ece382
-
Andrii Grynenko authored
Summary: Make each EventBase have a defuault VirtualEventBase which is attached to it and is joined on destruction. Default VirtualEventBase is lazily created on first request. This makes it trivial to use code switched to VirtualEventBase both with VirtualEventBase and EventBase. Reviewed By: yfeldblum Differential Revision: D4644639 fbshipit-source-id: cf28a3632463a1c61404c225ce1186f5a4a062a3
-
- 07 Mar, 2017 2 commits
-
-
Alexander Blom authored
Summary: There is no need for EventBase to log every loop iteration on a relatively low VLOG level. Just move it up to 11 like the other verbose logging in EventBase.cpp Reviewed By: yfeldblum Differential Revision: D4642379 fbshipit-source-id: 351636afb186ba94b2447b206d7d1389cbdba110
-
Anirudh Ramachandran authored
Summary: Add a few more getters (subject, issuer, notbefore, notafter) to OpenSSLCertUtils. Also add an additional API to AsyncSSLSocket to add application-generated alert strings during the handshake, for e.g., during certificate verification Reviewed By: knekritz Differential Revision: D4624754 fbshipit-source-id: f01998b9e0e58b88ece8c6dc51ab590988bf0a8f
-
- 06 Mar, 2017 1 commit
-
-
Johannes Kopf authored
Summary: This file only compiles with MSVC after I made the change in this diff. The code was difficult to follow, so I am not sure if the template is needed here? Reviewed By: yfeldblum Differential Revision: D4656575 fbshipit-source-id: 19415623bdb1757b573f12cdc9d8544d716ce6f2
-
- 05 Mar, 2017 2 commits
-
-
Jim Meyering authored
Summary: Fix warnings exposed by gcc's -Wshadow-compatible-local. Don't use a hard-coded names that would cause shadowing with each nested use of this macro. This avoids errors like the following: folly/Foreach.h:94:18: error: declaration of 'FOR_EACH_privateCount' shadows a previous local [-Werror=shadow-compatible-local] folly/Foreach.h:91:12: error: shadowed declaration is here [-Werror=shadow-compatible-local] Reviewed By: yfeldblum Differential Revision: D4656783 fbshipit-source-id: d7cd820fb04ccd78242f7487e2b219dc300709b6
-
Subodh Iyengar authored
Summary: AsyncSSLSocket can be connected using connect with total timeouts. This adds a method to get the total timeout that was set. Reviewed By: ngoyal, yfeldblum Differential Revision: D4656331 fbshipit-source-id: a55ad9f081449d358b8133e9598a2063f625a2e6
-
- 04 Mar, 2017 1 commit
-
-
Marc Celani authored
Summary: It is not unusual to write a RequestData that will send a request to a backend service upon destruction (for example, to log the request data). This typically involves calling EventBase::runInEventBaseThread() to do the logging. Normally, if you wait until the RequestContext is destructing for this to happen, everything works fine. However, if you explicitly call clearContextData(), then this can cause a deadlock. clearContextData() holds the write lock on the data_. Imagine the NotificationQueue thread tries to set the context (for some other reason), and it is waiting on the read lock on the data_. It does so while holding a lock on its own queue. Now, the clearContextData() calls the destructor while holding the write lock on data_, and the destructor calls runInEventBaseThread, which grabs the queue's lock. Deadlock. This can either be fixed in NotificationQueue or RequestContext. I decided to fix it in RequestContext because there may be other deadlocks that don't involve NotificationQueue (see the test plan). There are other deadlocks in RequestContext if you call write methods in RequestData::onSet or onUnset. But fixing this would require a massive perf regression (I imagine using shared_ptr instead of unique_ptr, and copying the ptrs under readlock and calling the callbacks after releasing the lock - yuck!) So instead, warn people against doing that. Reviewed By: yfeldblum Differential Revision: D4655400 fbshipit-source-id: cfebe696953a19dc4dba49976bbcd0ec1363bc42
-
- 03 Mar, 2017 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Tweak size handling in `Endian`. Either multiply by 8 in one place, or divide by 8 in another place. Go with the latter, because `sizeof` in C++ emits byte sizes, not bit sizes. Reviewed By: simpkins Differential Revision: D4645020 fbshipit-source-id: cb78600ba4c20bebc66aed506d4b5d6c378fc998
-
- 02 Mar, 2017 3 commits
-
-
Christopher Dykes authored
Summary: This reverts commit 21b86944f513da0700039a3e3736937fd72e8887 Differential Revision: D4618623 fbshipit-source-id: 6ab6498a2ce22895d7052e258d1af216d46ca178
-
Subodh Iyengar authored
Summary: The current method to supply connect timeouts to AsyncSSLSocket is to supply only the max connect + ssl connect time. However in some cases when connect time is known, it is desirable to supply it so that if connect does not succeed in connect time we can error out quicker and retry. This adds a new method for connect time in addition to the total Connect time. An alternative to this would be to create a AsyncSocket, connect it and then pass it's fd to AsyncSSLSocket, however that approach does not work well when TFO is being used, because TFO State is a part of the AsyncSocket's state and that is not encapsulated with the fd transfer. We could move the state around, but that is error prone, and this is much simpler and isolated to AsyncSSLSocket. Reviewed By: knekritz Differential Revision: D4626924 fbshipit-source-id: d802d035efbced68873ab59314d9f0e661e5509b
-
Yedidya Feldblum authored
Summary: [Folly] Refactor `Endian`. Define `swap` for all types, instead of only declaring it for all types, but have its implementation call a function that only has a given set of non-template overloads for a given set of supported types. The effective change is that now `Endian::swap<std::string>` will fail to compile, rather than compile but fail to link. And support floating-point types. Reviewed By: nbronson Differential Revision: D4615706 fbshipit-source-id: 5034e1e4466b8118a258d917ce8f4094460ca01a
-