tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/jni jk_jni_aprImpl.c
Date Sat, 11 May 2002 00:07:26 GMT
costin      02/05/10 17:07:26

  Modified:    jk/native2/jni jk_jni_aprImpl.c
  Log:
  Similar warnings if the array is not pinned.
  
  Revision  Changes    Path
  1.17      +20 -11    jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c
  
  Index: jk_jni_aprImpl.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_jni_aprImpl.c	9 May 2002 23:47:32 -0000	1.16
  +++ jk_jni_aprImpl.c	11 May 2002 00:07:26 -0000	1.17
  @@ -436,18 +436,23 @@
   JNIEXPORT jint JNICALL 
   Java_org_apache_jk_apr_AprImpl_unRead(JNIEnv *jniEnv, jobject _jthis, 
                                         jlong poolJ, jlong unSocketJ,
  -                                      jbyteArray bufJ, jint from, jint cnt)
  +                                      jbyteArray jbuf, jint from, jint cnt)
   {
       apr_pool_t *pool=(apr_pool_t *)(void *)(long)poolJ;
       jbyte *nbuf;
       int rd;
  -    jboolean iscommit;
  +    jboolean iscopy;
   
  -    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, bufJ, &iscommit);
  +    /* We can't use Critical with blocking ops. 
  +     */
  +    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, jbuf, &iscopy);
       if( ! nbuf ) {
           return -1;
       }
   
  +    if( iscopy==JNI_TRUE )
  +        fprintf( stderr, "aprImpl.unRead() get java bytes iscopy %d\n", iscopy);
  +
       while( 1 ) {
           /* Read */
           rd=read( (int)unSocketJ, nbuf + from, cnt );
  @@ -458,29 +463,29 @@
               } else {
                   fprintf(stderr, "Error reading %d %d %s\n",
                           (int)unSocketJ, errno, strerror(errno));
  -                (*jniEnv)->ReleaseByteArrayElements(jniEnv, bufJ, nbuf, 0);
  +                (*jniEnv)->ReleaseByteArrayElements(jniEnv, jbuf, nbuf, 0);
                   return -1;
               }
           }
   /*         fprintf(stderr, "Read %d from %d\n", */
   /*                 rd, unSocketJ); */
       
  -        (*jniEnv)->ReleaseByteArrayElements(jniEnv, bufJ, nbuf, 0);
  +        (*jniEnv)->ReleaseByteArrayElements(jniEnv, jbuf, nbuf, 0);
           return (jint)rd;
       }
   }
   
   JNIEXPORT jint JNICALL 
   Java_org_apache_jk_apr_AprImpl_unWrite(JNIEnv *jniEnv, jobject _jthis, 
  -                                     jlong poolJ, jlong unSocketJ, jbyteArray bufJ, jint
from, jint cnt)
  +                                     jlong poolJ, jlong unSocketJ, jbyteArray jbuf, jint
from, jint cnt)
   {
       apr_status_t status;
       apr_pool_t *pool=(apr_pool_t *)(void *)(long)poolJ;
       jbyte *nbuf;
       int rd;
  -    jboolean iscommit;
  +    jboolean iscopy;
   
  -    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, bufJ, &iscommit);
  +    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, jbuf, &iscopy);
       if( ! nbuf ) {
           return -1;
       }
  @@ -488,7 +493,7 @@
       /* write */
       write( (int) unSocketJ, nbuf + from, cnt );
       
  -    (*jniEnv)->ReleaseByteArrayElements(jniEnv, bufJ, nbuf, 0);
  +    (*jniEnv)->ReleaseByteArrayElements(jniEnv, jbuf, nbuf, 0);
       return (jint)rd;
   }
   
  @@ -707,7 +712,7 @@
       jk_endpoint_t *ep = compCtx->object;
   
       jbyte *nbuf;
  -    jboolean iscommit;
  +    jboolean iscopy;
   
       int cnt=0;
       jint rc = -1;
  @@ -715,7 +720,11 @@
   
       /*env->l->jkLog(env, env->l, JK_LOG_INFO,"jkInvoke()\n"); */
           
  -    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, data, &iscommit);
  +    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, data, &iscopy);
  +
  +    if( iscopy )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO,
  +                      "aprImpl.jkInvoke() get java bytes iscopy %d\n", iscopy);
   
       if(nbuf==NULL) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message