Author: remy.maucherat(a)jboss.com
Date: 2007-08-04 12:57:43 -0400 (Sat, 04 Aug 2007)
New Revision: 212
Modified:
trunk/native/connector/include/tcn_version.h
trunk/native/connector/os/win32/libtcnative.rc
trunk/native/connector/src/network.c
Log:
- Native code update: add methods which look like the original write methods.
Modified: trunk/native/connector/include/tcn_version.h
===================================================================
--- trunk/native/connector/include/tcn_version.h 2007-07-31 12:56:33 UTC (rev 211)
+++ trunk/native/connector/include/tcn_version.h 2007-08-04 16:57:43 UTC (rev 212)
@@ -17,7 +17,7 @@
/*
*
* @author Mladen Turk
- * @version $Revision: 525206 $, $Date: 2007-04-03 18:42:27 +0200 (mar., 03 avr. 2007) $
+ * @version $Revision: 562478 $, $Date: 2007-08-03 16:33:51 +0200 (ven., 03 août 2007) $
*/
#ifndef TCN_VERSION_H
@@ -69,7 +69,7 @@
#define TCN_MINOR_VERSION 1
/** patch level */
-#define TCN_PATCH_VERSION 11
+#define TCN_PATCH_VERSION 12
/**
* This symbol is defined for internal, "development" copies of TCN. This
Modified: trunk/native/connector/os/win32/libtcnative.rc
===================================================================
--- trunk/native/connector/os/win32/libtcnative.rc 2007-07-31 12:56:33 UTC (rev 211)
+++ trunk/native/connector/os/win32/libtcnative.rc 2007-08-04 16:57:43 UTC (rev 212)
@@ -3,7 +3,7 @@
LANGUAGE 0x9,0x1
1 11 logmessages.bin
-#define TCN_COPYRIGHT "Copyright 2000-2006 The Apache Software " \
+#define TCN_COPYRIGHT "Copyright 2000-2007 The Apache Software " \
"Foundation or its licensors, as applicable."
#define TCN_LICENSE "Licensed under the Apache License, Version 2.0 " \
@@ -19,7 +19,7 @@
"specific language governing permissions and " \
"limitations under the License."
-#define TCN_VERISON "1.1.11"
+#define TCN_VERISON "1.1.12"
1000 ICON "apache.ico"
1001 DIALOGEX 0, 0, 252, 51
@@ -35,8 +35,8 @@
END
1 VERSIONINFO
- FILEVERSION 1,1,11,0
- PRODUCTVERSION 1,1,11,0
+ FILEVERSION 1,1,12,0
+ PRODUCTVERSION 1,1,12,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Modified: trunk/native/connector/src/network.c
===================================================================
--- trunk/native/connector/src/network.c 2007-07-31 12:56:33 UTC (rev 211)
+++ trunk/native/connector/src/network.c 2007-08-04 16:57:43 UTC (rev 212)
@@ -17,7 +17,7 @@
/*
*
* @author Mladen Turk
- * @version $Revision: 523024 $, $Date: 2007-03-27 20:23:06 +0200 (mar., 27 mars 2007) $
+ * @version $Revision: 562478 $, $Date: 2007-08-03 16:33:51 +0200 (ven., 03 août 2007) $
*/
#include "tcn.h"
@@ -540,6 +540,40 @@
}
}
+TCN_IMPLEMENT_CALL(jint, Socket, sendib)(TCN_STDARGS, jlong sock,
+ jobject buf, jint offset, jint len)
+{
+ tcn_socket_t *s = J2P(sock, tcn_socket_t *);
+ apr_size_t nbytes = (apr_size_t)len;
+ char *bytes;
+ apr_status_t ss = APR_SUCCESS;
+
+ UNREFERENCED(o);
+ if (!sock) {
+ tcn_ThrowAPRException(e, APR_ENOTSOCK);
+ return -(jint)APR_ENOTSOCK;
+ }
+ TCN_ASSERT(s->opaque != NULL);
+ TCN_ASSERT(buf != NULL);
+#ifdef TCN_DO_STATISTICS
+ sp_max_send = TCN_MAX(sp_max_send, nbytes);
+ sp_min_send = TCN_MIN(sp_min_send, nbytes);
+ sp_tot_send += nbytes;
+ sp_num_send++;
+#endif
+
+ bytes = (char *)(*e)->GetDirectBufferAddress(e, buf);
+
+ ss = (*s->net->send)(s->opaque, bytes + offset, &nbytes);
+
+ if (ss == APR_SUCCESS)
+ return (jint)nbytes;
+ else {
+ TCN_ERROR_WRAP(ss);
+ return -(jint)ss;
+ }
+}
+
TCN_IMPLEMENT_CALL(jint, Socket, sendbb)(TCN_STDARGS, jlong sock,
jint offset, jint len)
{
@@ -577,6 +611,37 @@
}
}
+TCN_IMPLEMENT_CALL(jint, Socket, sendibb)(TCN_STDARGS, jlong sock,
+ jint offset, jint len)
+{
+ tcn_socket_t *s = J2P(sock, tcn_socket_t *);
+ apr_size_t nbytes = (apr_size_t)len;
+ apr_status_t ss = APR_SUCCESS;
+
+ UNREFERENCED(o);
+ if (!sock) {
+ tcn_ThrowAPRException(e, APR_ENOTSOCK);
+ return -(jint)APR_ENOTSOCK;
+ }
+ TCN_ASSERT(s->opaque != NULL);
+ TCN_ASSERT(s->jsbbuff != NULL);
+#ifdef TCN_DO_STATISTICS
+ sp_max_send = TCN_MAX(sp_max_send, nbytes);
+ sp_min_send = TCN_MIN(sp_min_send, nbytes);
+ sp_tot_send += nbytes;
+ sp_num_send++;
+#endif
+
+ ss = (*s->net->send)(s->opaque, s->jsbbuff + offset, &nbytes);
+
+ if (ss == APR_SUCCESS)
+ return (jint)nbytes;
+ else {
+ TCN_ERROR_WRAP(ss);
+ return -(jint)nbytes;
+ }
+}
+
TCN_IMPLEMENT_CALL(jint, Socket, sendv)(TCN_STDARGS, jlong sock,
jobjectArray bufs)
{