tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1681291 - in /tomcat/native/trunk/native/src: file.c network.c
Date Sat, 23 May 2015 08:42:59 GMT
Author: rjung
Date: Sat May 23 08:42:58 2015
New Revision: 1681291

URL: http://svn.apache.org/r1681291
Log:
Sync trunk with 1.1 branch: Forward ports

r1350280 | rjung | 2012-06-14 16:54:48 +0200 (Thu, 14 Jun 2012) | 3 lines
Cast pointers to fix compiler warnings about
pointer signedness differences on Solaris.

r1403635 | mturk | 2012-10-30 08:27:04 +0100 (Tue, 30 Oct 2012) | 1 line
Try to fix BZ54064. In case nothing was written, don't loop endlesly

Modified:
    tomcat/native/trunk/native/src/file.c
    tomcat/native/trunk/native/src/network.c

Modified: tomcat/native/trunk/native/src/file.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/file.c?rev=1681291&r1=1681290&r2=1681291&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/file.c (original)
+++ tomcat/native/trunk/native/src/file.c Sat May 23 08:42:58 2015
@@ -381,13 +381,13 @@ TCN_IMPLEMENT_CALL(jint, File, writev)(T
     for (i = 0; i < nvec; i++) {
         ba[i] = (*e)->GetObjectArrayElement(e, bufs, i);
         vec[i].iov_len  = (*e)->GetArrayLength(e, ba[i]);
-        vec[i].iov_base = (*e)->GetByteArrayElements(e, ba[i], NULL);
+        vec[i].iov_base = (void *)((*e)->GetByteArrayElements(e, ba[i], NULL));
     }
 
     ss = apr_file_writev(f, vec, nvec, &written);
 
     for (i = 0; i < nvec; i++) {
-        (*e)->ReleaseByteArrayElements(e, ba[i], vec[i].iov_base, JNI_ABORT);
+        (*e)->ReleaseByteArrayElements(e, ba[i], (jbyte *)vec[i].iov_base, JNI_ABORT);
     }
     if (ss == APR_SUCCESS)
         return (jint)written;
@@ -415,7 +415,7 @@ TCN_IMPLEMENT_CALL(jint, File, writevFul
     for (i = 0; i < nvec; i++) {
         ba[i] = (*e)->GetObjectArrayElement(e, bufs, i);
         vec[i].iov_len  = (*e)->GetArrayLength(e, ba[i]);
-        vec[i].iov_base = (*e)->GetByteArrayElements(e, ba[i], NULL);
+        vec[i].iov_base = (void *)((*e)->GetByteArrayElements(e, ba[i], NULL));
     }
 #if (APR_VERSION_MAJOR >= 1) && (APR_VERSION_MINOR >= 1)
     ss = apr_file_writev_full(f, vec, nvec, &written);
@@ -424,7 +424,7 @@ TCN_IMPLEMENT_CALL(jint, File, writevFul
 #endif
 
     for (i = 0; i < nvec; i++) {
-        (*e)->ReleaseByteArrayElements(e, ba[i], vec[i].iov_base,
+        (*e)->ReleaseByteArrayElements(e, ba[i], (jbyte *)vec[i].iov_base,
                                        JNI_ABORT);
     }
     if (ss == APR_SUCCESS)

Modified: tomcat/native/trunk/native/src/network.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/network.c?rev=1681291&r1=1681290&r2=1681291&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/network.c (original)
+++ tomcat/native/trunk/native/src/network.c Sat May 23 08:42:58 2015
@@ -601,7 +601,7 @@ TCN_IMPLEMENT_CALL(jint, Socket, sendbb)
     while (sent < nbytes) {
         apr_size_t wr = nbytes - sent;
         ss = (*s->net->send)(s->opaque, s->jsbbuff + offset + sent, &wr);
-        if (ss != APR_SUCCESS)
+        if (ss != APR_SUCCESS || wr == 0)
             break;
         sent += wr;
     }
@@ -666,13 +666,13 @@ TCN_IMPLEMENT_CALL(jint, Socket, sendv)(
     for (i = 0; i < nvec; i++) {
         ba[i] = (*e)->GetObjectArrayElement(e, bufs, i);
         vec[i].iov_len  = (*e)->GetArrayLength(e, ba[i]);
-        vec[i].iov_base = (*e)->GetByteArrayElements(e, ba[i], NULL);
+        vec[i].iov_base = (void *)((*e)->GetByteArrayElements(e, ba[i], NULL));
     }
 
     ss = (*s->net->sendv)(s->opaque, vec, nvec, &written);
 
     for (i = 0; i < nvec; i++) {
-        (*e)->ReleaseByteArrayElements(e, ba[i], vec[i].iov_base, JNI_ABORT);
+        (*e)->ReleaseByteArrayElements(e, ba[i], (jbyte*)vec[i].iov_base, JNI_ABORT);
     }
     if (ss == APR_SUCCESS || ((APR_STATUS_IS_EAGAIN(ss) || ss == TCN_EAGAIN) && written
> 0))
         return (jint)written;
@@ -1219,12 +1219,12 @@ TCN_IMPLEMENT_CALL(jlong, Socket, sendfi
     for (i = 0; i < nh; i++) {
         hba[i] = (*e)->GetObjectArrayElement(e, headers, i);
         hvec[i].iov_len  = (*e)->GetArrayLength(e, hba[i]);
-        hvec[i].iov_base = (*e)->GetByteArrayElements(e, hba[i], NULL);
+        hvec[i].iov_base = (void *)((*e)->GetByteArrayElements(e, hba[i], NULL));
     }
     for (i = 0; i < nt; i++) {
         tba[i] = (*e)->GetObjectArrayElement(e, trailers, i);
         tvec[i].iov_len  = (*e)->GetArrayLength(e, tba[i]);
-        tvec[i].iov_base = (*e)->GetByteArrayElements(e, tba[i], NULL);
+        tvec[i].iov_base = (void *)((*e)->GetByteArrayElements(e, tba[i], NULL));
     }
     hdrs.headers = &hvec[0];
     hdrs.numheaders = nh;
@@ -1242,11 +1242,11 @@ TCN_IMPLEMENT_CALL(jlong, Socket, sendfi
 #endif
 
     for (i = 0; i < nh; i++) {
-        (*e)->ReleaseByteArrayElements(e, hba[i], hvec[i].iov_base, JNI_ABORT);
+        (*e)->ReleaseByteArrayElements(e, hba[i], (jbyte*)hvec[i].iov_base, JNI_ABORT);
     }
 
     for (i = 0; i < nt; i++) {
-        (*e)->ReleaseByteArrayElements(e, tba[i], tvec[i].iov_base, JNI_ABORT);
+        (*e)->ReleaseByteArrayElements(e, tba[i], (jbyte*)tvec[i].iov_base, JNI_ABORT);
     }
     /* Return Number of bytes actually sent,
      * including headers, file, and trailers



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


Mime
View raw message