Esempio n. 1
0
int
tds_connection_read(TDSSOCKET * tds, unsigned char *buf, int buflen)
{
	TDSCONNECTION *conn = tds->conn;

	if (conn->tls_session)
		return tds_ssl_read(conn, buf, buflen);

#if ENABLE_ODBC_MARS
	return tds_socket_read(conn, tds, buf, buflen);
#else
	return tds_goodread(tds, buf, buflen);
#endif
}
Esempio n. 2
0
static int
goodread(TDSSOCKET * tds, unsigned char *buf, int buflen)
{
#ifdef NCBI_FTDS_ALLOW_TDS_80
#ifdef HAVE_GNUTLS
	if (tds->tls_session)
		return gnutls_record_recv(tds->tls_session, buf, buflen);
#elif defined(HAVE_OPENSSL)
	if (tds->tls_session)
		return SSL_read((SSL*) tds->tls_session, buf, buflen);
#endif
#endif
	return tds_goodread(tds, buf, buflen, 0);
}
Esempio n. 3
0
static SSL_RET
tds_pull_func(SSL_PULL_ARGS)
{
	TDSCONNECTION *conn = (TDSCONNECTION *) SSL_PTR;
	TDSSOCKET *tds;

	tdsdump_log(TDS_DBG_INFO1, "in tds_pull_func\n");

#if ENABLE_ODBC_MARS
	tds = conn->in_net_tds;
	assert(tds);
#else
	tds = (TDSSOCKET *) conn;
#endif

	/* already initialized (crypted TDS packets) */

	/* read directly from socket */
	/* TODO we block write on other sessions */
	/* also we should already have tested for data on socket */
	return tds_goodread(tds, (unsigned char*) data, len);
}