[CVS] RPM: rpm-5_4: rpm/rpmio/ mongoc.c

2016-03-09 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   09-Mar-2016 22:27:27
  Branch: rpm-5_4  Handle: 2016030921272700

  Modified files:   (Branch: rpm-5_4)
rpm/rpmio   mongoc.c

  Log:
- mongoc: permit build without libsasl2.

  Summary:
RevisionChanges Path
1.1.2.6 +4  -0  rpm/rpmio/mongoc.c
  

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mongoc.c
  
  $ cvs diff -u -r1.1.2.5 -r1.1.2.6 mongoc.c
  --- rpm/rpmio/mongoc.c11 May 2015 21:10:18 -  1.1.2.5
  +++ rpm/rpmio/mongoc.c9 Mar 2016 21:27:27 -   1.1.2.6
  @@ -39,8 +39,10 @@
   # include 
   #endif
   
  +#ifdef HAVE_LIBSASL2
   #include 
   #include 
  +#endif
   
   #include 
   #include 
  @@ -14228,6 +14230,7 @@
  return ret;
   }
   
  +#ifdef MONGOC_ENABLE_SASL
   /*==*/
   /* --- mongoc-sasl.c */
   
  @@ -14555,6 +14558,7 @@
   
  return true;
   }
  +#endif
   
   /*==*/
   /* --- mongoc-socket.c */
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm-5_4: rpm/rpmio/ mongoc.c

2016-04-03 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   04-Apr-2016 06:02:27
  Branch: rpm-5_4  Handle: 2016040404022700

  Modified files:   (Branch: rpm-5_4)
rpm/rpmio   mongoc.c

  Log:
- sanity.

  Summary:
RevisionChanges Path
1.1.2.11+1  -1  rpm/rpmio/mongoc.c
  

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mongoc.c
  
  $ cvs diff -u -r1.1.2.10 -r1.1.2.11 mongoc.c
  --- rpm/rpmio/mongoc.c29 Mar 2016 16:40:31 -  1.1.2.10
  +++ rpm/rpmio/mongoc.c4 Apr 2016 04:02:27 -   1.1.2.11
  @@ -13633,7 +13633,7 @@
 }
  }
   
  -   BSON_ASSERT (file->length = target_length);
  +   BSON_ASSERT ((file->length = target_length) > 0);
  file->is_dirty = true;
   
  RETURN (diff);
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm-5_4: rpm/rpmio/ mongoc.c

2016-04-10 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   11-Apr-2016 00:15:32
  Branch: rpm-5_4  Handle: 2016041022153200

  Modified files:   (Branch: rpm-5_4)
rpm/rpmio   mongoc.c

  Log:
- mongo: remove clang warning.

  Summary:
RevisionChanges Path
1.1.2.12+2  -2  rpm/rpmio/mongoc.c
  

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mongoc.c
  
  $ cvs diff -u -r1.1.2.11 -r1.1.2.12 mongoc.c
  --- rpm/rpmio/mongoc.c4 Apr 2016 04:02:27 -   1.1.2.11
  +++ rpm/rpmio/mongoc.c10 Apr 2016 22:15:32 -  1.1.2.12
  @@ -9216,7 +9216,7 @@
  (n_cpu * n_groups * sizeof(mongoc_counter_slots_t)));
   
   #ifdef BSON_OS_UNIX
  -   return BSON_MAX(getpagesize(), size);
  +   return BSON_MAX((size_t)getpagesize(), size);
   #else
  return size;
   #endif
  @@ -29259,7 +29259,7 @@
*
* copy into the buffer */
   
  -bytes = BSON_MIN (iov[i].iov_len - iov_pos, buf_end - buf_tail);
  +bytes = BSON_MIN (iov[i].iov_len - iov_pos, (size_t)(buf_end - 
buf_tail));
   
   memcpy (buf_tail, (char *) iov[i].iov_base + iov_pos, bytes);
   buf_tail += bytes;
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm-5_4: rpm/rpmio/ mongoc.c mongoc.h

2016-05-08 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   08-May-2016 20:47:27
  Branch: rpm-5_4  Handle: 2016050818472601

  Modified files:   (Branch: rpm-5_4)
rpm/rpmio   mongoc.c mongoc.h

  Log:
- mongo: permit enabling both openssl and common crypto on OS X.

  Summary:
RevisionChanges Path
1.1.2.13+145 -145   rpm/rpmio/mongoc.c
1.1.2.10+2  -2  rpm/rpmio/mongoc.h
  

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mongoc.c
  
  $ cvs diff -u -r1.1.2.12 -r1.1.2.13 mongoc.c
  --- rpm/rpmio/mongoc.c10 Apr 2016 22:15:32 -  1.1.2.12
  +++ rpm/rpmio/mongoc.c8 May 2016 18:47:26 -   1.1.2.13
  @@ -454,6 +454,150 @@
   }
   
   
  +/*==*/
  +/* --- mongoc-stream-tls.c */
  +
  +#ifdef MONGOC_ENABLE_SSL
  +
  +#undef MONGOC_LOG_DOMAIN
  +#define MONGOC_LOG_DOMAIN "stream-tls"
  +
  +
  +/**
  + * mongoc_stream_tls_do_handshake:
  + *
  + * force an ssl handshake
  + *
  + * This will happen on the first read or write otherwise
  + */
  +bool
  +mongoc_stream_tls_do_handshake (mongoc_stream_t *stream,
  +int32_t  timeout_msec)
  +{
  +   mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t 
*)mongoc_stream_get_tls_stream (stream);
  +
  +   BSON_ASSERT (stream_tls);
  +   BSON_ASSERT (stream_tls->do_handshake);
  +
  +   return stream_tls->do_handshake(stream, timeout_msec);
  +}
  +
  +
  +/**
  + * mongoc_stream_tls_should_retry:
  + *
  + * If the stream should be retried
  + */
  +bool
  +mongoc_stream_tls_should_retry (mongoc_stream_t *stream)
  +{
  +   mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t 
*)mongoc_stream_get_tls_stream (stream);
  +
  +   BSON_ASSERT (stream_tls);
  +   BSON_ASSERT (stream_tls->should_retry);
  +
  +   return stream_tls->should_retry(stream);
  +}
  +
  +
  +/**
  + * mongoc_stream_tls_should_read:
  + *
  + * If the stream should read
  + */
  +bool
  +mongoc_stream_tls_should_read (mongoc_stream_t *stream)
  +{
  +   mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t 
*)mongoc_stream_get_tls_stream (stream);
  +
  +   BSON_ASSERT (stream_tls);
  +   BSON_ASSERT (stream_tls->should_read);
  +
  +   return stream_tls->should_read(stream);
  +}
  +
  +
  +/**
  + * mongoc_stream_tls_should_write:
  + *
  + * If the stream should write
  + */
  +bool
  +mongoc_stream_tls_should_write (mongoc_stream_t *stream)
  +{
  +   mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t 
*)mongoc_stream_get_tls_stream (stream);
  +
  +   BSON_ASSERT (stream_tls);
  +   BSON_ASSERT (stream_tls->should_write);
  +
  +   return stream_tls->should_write(stream);
  +}
  +
  +
  +/**
  + * mongoc_stream_tls_check_cert:
  + *
  + * check the cert returned by the other party
  + */
  +bool
  +mongoc_stream_tls_check_cert (mongoc_stream_t *stream,
  +  const char  *host)
  +{
  +   mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t 
*)mongoc_stream_get_tls_stream (stream);
  +
  +   BSON_ASSERT (stream_tls);
  +   BSON_ASSERT (stream_tls->check_cert);
  +
  +   return stream_tls->check_cert(stream, host);
  +}
  +
  +
  +/*
  + *--
  + *
  + * mongoc_stream_tls_new --
  + *
  + *   Creates a new mongoc_stream_tls_t to communicate with a remote
  + *   server using a TLS stream.
  + *
  + *   @base_stream should be a stream that will become owned by the
  + *   resulting tls stream. It will be used for raw I/O.
  + *
  + *   @trust_store_dir should be a path to the SSL cert db to use for
  + *   verifying trust of the remote server.
  + *
  + * Returns:
  + *   NULL on failure, otherwise a mongoc_stream_t.
  + *
  + * Side effects:
  + *   None.
  + *
  + *--
  + */
  +
  +mongoc_stream_t *
  +mongoc_stream_tls_new (mongoc_stream_t  *base_stream,
  +   mongoc_ssl_opt_t *opt,
  +   int   client)
  +{
  +   BSON_ASSERT (base_stream);
  +
  +   switch(MONGOC_TLS_TYPE)
  +   {
  +#ifdef MONGOC_ENABLE_OPENSSL
  +  case MONGOC_TLS_OPENSSL:
  + return mongoc_stream_tls_openssl_new (base_stream, opt, client);
  + break;
  +#endif
  +
  +  default:
  + MONGOC_ERROR("Unknown crypto engine");
  + return NULL;
  +   }
  +}
  +
  +#endif
  +
   
   /*=