Skip to content

Commit

Permalink
Backwards compatibility with curl < 7.41, fixes JosephP91#32.
Browse files Browse the repository at this point in the history
  • Loading branch information
susnux committed Apr 12, 2015
1 parent 9b1a5dd commit 31c1120
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ IF(BIICODE)
ADD_BIICODE_TARGETS()
ELSE()
cmake_minimum_required(VERSION 2.8)
set(CURL_MIN_VERSION "7.28.0")

#if using an older VERSION of curl ocsp stapling can be disabled
if(WITHOUT_OCSP_STAPLING)
set(CURL_MIN_VERSION "7.28.0")
add_definitions(-DWITHOUT_OCSP_STAPLING)
else()
set(CURL_MIN_VERSION "7.41.0")
endif()
# Setting up project
project(CURLCPP)

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ cmake ..
make # -j2
```

**Note:** cURL 7.28 is required, but if you are using cURL < 7.41 you have to replace the cmake command with this one:

```bash
cmake .. -WITHOUT_OCSP_STAPLING=1
```

Then add `<curlcpp root>/build/src/` to your library path and `<curlcpp root>/include/` to your include path.

When linking, link against `curlcpp` (e.g.: g++ -std=c++11 example.cpp -o example -lcurlcpp -lcurl).
Expand Down
3 changes: 2 additions & 1 deletion include/curl_easy.h
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,10 @@ namespace curl {

/* Path to Unix domain socket */
CURLCPP_DEFINE_OPTION(CURLOPT_UNIX_SOCKET_PATH, const char*);

#if !defined(WITHOUT_OCSP_STAPLING)
/* Set if we should verify the certificate status. */
CURLCPP_DEFINE_OPTION(CURLOPT_SSL_VERIFYSTATUS, long);
#endif
} // of namespace detail

/**
Expand Down

0 comments on commit 31c1120

Please sign in to comment.