Exemple #1
0
int ssl_pending(void *conn)
{
	struct scd *c = (struct scd *)conn;

	if (c == NULL) {
		return 0;
	}

	return (c->established && SSL_DataPending(c->prfd) > 0);
}
JNIEXPORT jint JNICALL
Java_org_mozilla_jss_ssl_SSLSocket_socketAvailable(
    JNIEnv *env, jobject self)
{
    jint available;
    JSSL_SocketData *sock = NULL;

    if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) {
        goto finish;
    }

    available = SSL_DataPending(sock->fd);
    PR_ASSERT(available >= 0);

finish:
    EXCEPTION_CHECK(env, sock)
    return available;
}