server/crypto.c
/* Write buffer to GnuTLS and either succeed completely
 * (returns 0) or fail (returns -1).
 */
Write buffer to GnuTLS and either succeed completely
(returns 0) or fail (returns -1).
Write buffer to GnuTLS and either succeed completely ( returns 0 ) or fail ( returns - 1 ) .
static int
crypto_send (struct connection *conn, const void *vbuf, size_t len)
{
  gnutls_session_t *session = connection_get_crypto_session (conn);
  const char *buf = vbuf;
  ssize_t r;
  assert (session != NULL);
  while (len > 0) {
    r = gnutls_record_send (*session, buf, len);
    if (r < 0) {
      if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN)
        continue;
      return -1;
    }
    buf += r;
    len -= r;
  }
  return 0;
}
static int crypto_send ( struct connection * conn , const void * vbuf , size_t len ) { gnutls_session_t * session = connection_get_crypto_session ( conn ) ; const char * buf = vbuf ; ssize_t r ; assert ( session != NULL ) ; while ( len > 0 ) { r = gnutls_record_send ( * session , buf , len ) ; if ( r < 0 ) { if ( r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN ) continue ; return -1 ; } buf += r ; len -= r ; } return 0 ; }
Write buffer to GnuTLS and either succeed completely
 (returns 0) or fail (returns -1).
Write buffer to GnuTLS and either succeed completely ( returns 0 ) or fail ( returns - 1 ) .