Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions cmake/Modules/FindYAJL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# - Find YAJL
# This module finds an installed YAJL package.
#
# It sets the following variables:
# YAJL_FOUND - Set to false, or undefined, if YAJL isn't found.
# YAJL_INCLUDE_DIR - The YAJL include directory.
# YAJL_LIBRARY - The YAJL library to link against.

FIND_PATH(YAJL_INCLUDE_DIR yajl/yajl_gen.h)
FIND_LIBRARY(YAJL_LIBRARY NAMES yajl)

IF (YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
SET(YAJL_FOUND TRUE)
ENDIF (YAJL_INCLUDE_DIR AND YAJL_LIBRARY)

IF (YAJL_FOUND)

# show which YAJL was found only if not quiet
IF (NOT YAJL_FIND_QUIETLY)
MESSAGE(STATUS "Found YAJL: ${YAJL_LIBRARY}")
ENDIF (NOT YAJL_FIND_QUIETLY)

ELSE (YAJL_FOUND)

# fatal error if YAJL is required but not found
IF (YAJL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find YAJL")
ENDIF (YAJL_FIND_REQUIRED)

ENDIF (YAJL_FOUND)

4 changes: 3 additions & 1 deletion libgrive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ find_package(LibGcrypt REQUIRED)
find_package(JSONC REQUIRED)
find_package(CURL REQUIRED)
find_package(EXPAT REQUIRED)
find_package(YAJL REQUIRED)
find_package(Boost 1.40.0 COMPONENTS program_options filesystem unit_test_framework system REQUIRED)
find_package(BFD)
find_package(CppUnit)
Expand Down Expand Up @@ -41,6 +42,7 @@ include_directories(
${libgrive_SOURCE_DIR}/src
${libgrive_SOURCE_DIR}/test
${GDBM_INCLUDE_DIR}
${YAJL_INCLUDE_DIR}
${OPT_INCS}
)

Expand Down Expand Up @@ -80,7 +82,7 @@ add_definitions(
add_library( grive STATIC ${LIBGRIVE_SRC} ${OPT_SRC} )

target_link_libraries( grive
yajl
${YAJL_LIBRARY}
${CURL_LIBRARIES}
${JSONC_LIBRARY}
${LIBGCRYPT_LIBRARIES}
Expand Down
4 changes: 2 additions & 2 deletions libgrive/src/protocol/AuthAgent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ bool AuthAgent::CheckRetry( long response )
// HTTP 500 and 503 should be temperory. just wait a bit and retry
if ( response == 500 || response == 503 )
{
Log( "resquest failed due to temperory error: %1%. retrying in 5 seconds",
Log( "request failed due to temperory error: %1%. retrying in 5 seconds",
response, log::warning ) ;

os::Sleep( 5 ) ;
Expand All @@ -149,7 +149,7 @@ bool AuthAgent::CheckRetry( long response )
// HTTP 401 Unauthorized. the auth token has been expired. refresh it
else if ( response == 401 )
{
Log( "resquest failed due to auth token expired: %1%. refreshing token",
Log( "request failed due to auth token expired: %1%. refreshing token",
response, log::warning ) ;

m_auth.Refresh() ;
Expand Down