fix deprecated keychain related APIs

Change-Id: I7d617719a8bf889cc87bae7505f6d8d9ad865f64
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/39902
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
Reviewed-by: Grady Player <gradyp@mozy.com>
Reviewed-by: John Bowers <jbowers@vmware.com>
Reviewed-by: David Brown <davidb@mozy.com>
fix release build with xcode

* mordor: remove deprecated ZERO_LINK
* run_tests: turn off "-fvisibility=hidden -fvisibility-inlines-hidden"
  settings of run_tests to be consistent with mordor.
* run_tests: remove settings ARCH and MACOSX_DEPLOYMENT_TARGET and SDKROOT
  settings which are the same as upper level project settings, so we can
  just inherit them.

Change-Id: I923b451c77efba26d00ca58658b975723a70af34
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/40460
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: John Bowers <jbowers@vmware.com>
Catch and ignore all exceptions from clientRequest::responseDone

This means that closing a stream will usually not throw
an exception, but this is just a side effect and isn't necessarily
why the change was being made.

fixes #86223

Signed-off-by: John Bowers <jbowers@vmware.com>
Change-Id: Ibacc6945f3d718ea5695f58813a1a0bff8521f5d
Reviewed-on: https://gerrit.dechocorp.com/40533
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
use double quote in ascii in comments

* was using the double quote in iso-8859-1, some editors
  complains about it. and there are not common way to
  specify the encoding (e.g. msvc 10 does not respect the
  encoding specified by the leading shebang line). so replace
  it with the double quote in ASCII.

Change-Id: Ibc40c6166cc885d5337f1373e48592f860a9bae9
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/40869
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
limit the iov count to IOV_MAX

* fixes #87702
* writev(2) fails if iovcnt is greater than IOV_MAX
* replace the number literal with the one in std::numeric_limits

Change-Id: I4dd9340c41b2429e16c3ac7f84ed62c907da501b
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/40957
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
add LZMA2Stream for lzma2 compression

* refs #86942
* LZMA2Stream is modeled after ZlibStream

Change-Id: I83fad3ded5b4c8a42e567c881ed0532e2aa20b91
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/40300
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
fix AX_CHECK_LZMA macro

* update ax_check_zlib.m4 to serial 14
* add tweaks for compatible with autoconf prior to 2.64

Change-Id: I603be6fdecdb8b5e05d3ea9ec4b5a51e0212fa33
Signed-off-by: Kefu Chai <kchai@vmware.com>
Signed-off-by: Kefu Chai <chaik@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41294
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
move m4_ifblank into where it is used

* otherwise the upper level project can not locate suger.m4
  by relative path

Change-Id: I3e11d843856cd2458a8f024d3c710743d108611d
Signed-off-by: Kefu Chai <chaik@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41307
Reviewed-by: Kevin Cai <kevinc@mozy.com>
remove assertion in getOpenSSLErrorMessage()

* refer to ticket https://redmine.dechocorp.com/issues/85327
* Trogdor experiences the assertion failure several times a week.

Change-Id: If32fc06d878f7e7d20e95d3f90f102e874a7b408
Signed-off-by: Kevin Cai <kevinc@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41296
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
update AX_CHECK_LZMA m4 macro to include lzma2.cpp

* the original AX_CHECK_LZMA will bypass the conditional definition
  if it has parameters passed in. and Makefile.am is checking it to
  tell if lzma2.{cpp,h} should be included. so to re-enable lzma2
  support, we simply define the LZMA flags and the automake
  conditional variable as long as lzma is detected.

Change-Id: I682283efaae19ffbb2dccea2990d70ff6c44f432
Signed-off-by: Kefu Chai <chaik@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41391
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
use __i386__ macro to detect i386 arch

* clang does not define `i386' macro with `-Wc++11-extensions'
  and `-arch i386' options.
* and the __i386__, __arm__, __mips__ macros are more commonly
  used and supported by both GCC and clang. so change it.

Change-Id: Iebbd2def438893c864f87d2d28e51a905b9a7cf9
Signed-off-by: Kefu Chai <chaik@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41493
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: John Bowers <jbowers@vmware.com>
Reviewed-by: Kefu Chai <kchai@vmware.com>
Fix for parallel compilation on windows

Multiple vcxproj cannot share the same compilation working directory
because certain temporary files will conflict with same name.
This produces a build break if Visual studio launches
a build of both projects in parallel

This appeared in Stash vbi2 branch, which now compiles
both mordor and mordorprotobuf.  (Workaround it to run
more incremental builds until if succeeds)

An example of this same sort of problem being fixed
in the past: https://gerrit.dechocorp.com/21400

Change-Id: I4362c5b58282f28ac89148895fd68dc0bf378c0a
Signed-off-by: Andrew Skowronski <andrews@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41601
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kefu Chai <kchai@vmware.com>
Reviewed-by: Zhaoding Wu <wuz@vmware.com>
fix compress/decompress of LZMAStream

* fixes #88242

Change-Id: I2cc55c8206c4908d70cf9b778b4c489c0155dc1c
Signed-off-by: Kefu Chai <chaik@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41751
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
set connection exceptioned if any command fails on it

* refer to ticket https://redmine.mozycorp.com/issues/88250
* this change set is not fully addressed the exception issue as
  Connection::prepare() interface is exposed outside. However as Mordor
  PQ library is not heavily used, and the usage pattern is really
  simple, it is OK for now.

Change-Id: I0753a52ce390345a1a485b2356111d467234aad8
Signed-off-by: Kevin Cai <kevinc@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41827
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
clear exception flag while trying connect() or reset()

Change-Id: Ia331899582142e6c24bf28283024c97ad6abedff
Signed-off-by: Kevin Cai <kevinc@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/41987
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Use SharingViolation for ERROR_LOCK_VIOLATION

Fix only impacts Windows

When trying to upload outlook files we hit
a violation reading the file.  however because
the error code is 33 instead of 32 the client
does not use the sharing violation code. Instead
a vague "NativeException" is thrown.

I think the situations are so similar that the
same exception can be used for both.

From winerror.h

// MessageId: ERROR_SHARING_VIOLATION
// The process cannot access the file because it is being used by another
// process.

// MessageId: ERROR_LOCK_VIOLATION
// The process cannot access the file because another process has locked a
// portion of the file.
//

I did a search in kalypso and SharingViolation
does not have special handling, I don't
see any sign that this change would have
an impact in that client.

refs #86645

Change-Id: I8f6bc97a4ac5b3ba0cdf1890ead6e784dbda1378
Signed-off-by: Andrew Skowronski <andrews@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/42251
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Zhaoding Wu <wuz@vmware.com>
Reviewed-by: Russ Simons <russs@mozy.com>
use stdint.h if using VS2010 or up

Change-Id: I0007afcad18d9a200bd66e70ea810715d5c5ffce
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/42531
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kevin Cai <kevinc@mozy.com>
disable some false positive warnings from GCC 4.6+

Change-Id: I7b91c4272d6b6c9349c37adb04fff9c261479399
Signed-off-by: Kefu Chai <kchai@vmware.com>
Reviewed-on: https://gerrit.dechocorp.com/42631
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Andrew Skowronski <askowronski@vmware.com>
refs #89957, #86223: handle clearParent gracefully

* while clear HTTPStream's parent stream, do ClientRequest::finish() if
  no errors otherwise do ClientRequest::cancel(true)
* ignore exceptions in HTTPStream destructor

Change-Id: If5e2e58a8c1ed3f0e004fc85d973648b0b22c7b3
Signed-off-by: Kevin Cai <kevinc@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/43688
Reviewed-by: Jenkins <hudsonbuild@mozy.com>
Reviewed-by: Kefu Chai <kchai@vmware.com>
Reviewed-by: John Bowers <jbowers@vmware.com>
Fixed regression in MD5HashStream

fixes #90742

During a refactoring the MD5HashStream length was changed from 16 to 32 characters

Change-Id: I9768d57f882b092eb0a7f93b30b92d8a5aa78f0a
Signed-off-by: Pancho Avila <panchoa@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/44076
Reviewed-by: Russ Simons <russs@mozy.com>
Reviewed-by: Jenkins <hudsonbuild@mozy.com>