cvs commit: jakarta-tomcat-connectors/jni/native/src network.c

2005-05-30 Thread mturk
mturk   2005/05/29 23:15:53

  Modified:jni/native/src network.c
  Log:
  Add atomic ops for counting statistic data.
  
  Revision  ChangesPath
  1.23  +10 -8 jakarta-tomcat-connectors/jni/native/src/network.c
  
  Index: network.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/network.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- network.c 28 May 2005 07:48:29 -  1.22
  +++ network.c 30 May 2005 06:15:52 -  1.23
  @@ -26,10 +26,12 @@
   #include tcn.h
   
   #ifdef TCN_DO_STATISTICS
  -static int sp_created  = 0;
  -static int sp_closed   = 0;
  -static int sp_cleared  = 0;
  -static int sp_accepted = 0;
  +#include apr_atomic.h
  +
  +static volatile apr_uint32_t sp_created  = 0;
  +static volatile apr_uint32_t sp_closed   = 0;
  +static volatile apr_uint32_t sp_cleared  = 0;
  +static volatile apr_uint32_t sp_accepted = 0;
   /* Fake private pool struct to deal with APR private's socket
* struct not exposing function to access the pool.
*/
  @@ -58,7 +60,7 @@
   
   static apr_status_t sp_socket_cleanup(void *data)
   {
  -sp_cleared++;
  +apr_atomic_inc32(sp_cleared);
   return APR_SUCCESS;
   }
   
  @@ -201,7 +203,7 @@
   TCN_ASSERT(sock != 0);
   
   #ifdef TCN_DO_STATISTICS
  -sp_closed++;
  +apr_atomic_inc32(sp_closed);
   apr_pool_cleanup_kill(((fake_apr_socket_t *)s)-pool, s, 
sp_socket_cleanup);
   #endif
   
  @@ -243,7 +245,7 @@
   
   #ifdef TCN_DO_STATISTICS
   if (n) {
  -sp_accepted++;
  +apr_atomic_inc32(sp_accepted);
   apr_pool_cleanup_register(p, (const void *)n,
 sp_socket_cleanup,
 apr_pool_cleanup_null);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/jni/native/src file.c

2005-05-30 Thread mturk
mturk   2005/05/29 23:16:39

  Modified:jni/native/src file.c
  Log:
  Rename tcn_dup_string to tcn_strdup
  
  Revision  ChangesPath
  1.7   +2 -2  jakarta-tomcat-connectors/jni/native/src/file.c
  
  Index: file.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/file.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- file.c24 May 2005 09:24:40 -  1.6
  +++ file.c30 May 2005 06:16:39 -  1.7
  @@ -97,7 +97,7 @@
   {
   apr_pool_t *p = J2P(pool, apr_pool_t *);
   apr_file_t *f = NULL;
  -char *ctempl = tcn_dup_string(e, templ);
  +char *ctempl = tcn_strdup(e, templ);
   
   UNREFERENCED(o);
   if (!ctempl) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/jni/native/src jnilib.c

2005-05-30 Thread mturk
mturk   2005/05/29 23:17:14

  Modified:jni/native/src jnilib.c
  Log:
  Rename tcn_dup_string to tcn_strdup and add tcn_pstrdup
  
  Revision  ChangesPath
  1.7   +19 -2 jakarta-tomcat-connectors/jni/native/src/jnilib.c
  
  Index: jnilib.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/jnilib.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jnilib.c  28 May 2005 08:18:09 -  1.6
  +++ jnilib.c  30 May 2005 06:17:14 -  1.7
  @@ -26,6 +26,8 @@
   #include apr_network_io.h
   #include apr_file_io.h
   #include apr_mmap.h
  +#include apr_atomic.h
  +#include apr_strings.h
   
   #include tcn.h
   #include tcn_version.h
  @@ -67,6 +69,7 @@
   return JNI_ERR;
   
   apr_initialize();
  +
   return  JNI_VERSION_1_4;
   }
   
  @@ -136,7 +139,7 @@
   return result;
   }
   
  -char *tcn_dup_string(JNIEnv *env, jstring jstr)
  +char *tcn_strdup(JNIEnv *env, jstring jstr)
   {
   char *result = NULL;
   const char *cjstr;
  @@ -149,6 +152,19 @@
   return result;
   }
   
  +char *tcn_pstrdup(JNIEnv *env, jstring jstr, apr_pool_t *pool)
  +{
  +char *result = NULL;
  +const char *cjstr;
  +
  +cjstr = (const char *)((*env)-GetStringUTFChars(env, jstr, 0));
  +if (cjstr) {
  +result = apr_pstrdup(pool, cjstr);
  +(*env)-ReleaseStringUTFChars(env, jstr, cjstr);
  +}
  +return result;
  +}
  +
   TCN_IMPLEMENT_CALL(jboolean, Library, initialize)(TCN_STDARGS)
   {
   
  @@ -157,6 +173,7 @@
   if (apr_pool_create(tcn_global_pool, NULL) != APR_SUCCESS) {
   return JNI_FALSE;
   }
  +apr_atomic_init(tcn_global_pool);
   }
   return JNI_TRUE;
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/jni/native/src ssl.c sslutils.c

2005-05-30 Thread mturk
mturk   2005/05/29 23:17:54

  Modified:jni/native/include ssl_private.h tcn.h
   jni/native/src ssl.c sslutils.c
  Log:
  Add random seed functions for PRNG initialization.
  
  Revision  ChangesPath
  1.4   +100 -2
jakarta-tomcat-connectors/jni/native/include/ssl_private.h
  
  Index: ssl_private.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jni/native/include/ssl_private.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_private.h 24 May 2005 09:24:39 -  1.3
  +++ ssl_private.h 30 May 2005 06:17:54 -  1.4
  @@ -18,7 +18,7 @@
* @author Mladen Turk
* @version $Revision$, $Date$
*/
  - 
  +
   #ifndef SSL_PRIVATE_H
   #define SSL_PRIVATE_H
   
  @@ -38,6 +38,104 @@
   #include openssl/engine.h
   #endif
   
  +#ifndef RAND_MAX
  +#include limits.h
  +#define RAND_MAX INT_MAX
  +#endif
  +
  +#define SSL_ALGO_UNKNOWN (0)
  +#define SSL_ALGO_RSA (10)
  +#define SSL_ALGO_DSA (11)
  +#define SSL_ALGO_ALL (SSL_ALGO_RSA|SSL_ALGO_DSA)
  +
  +#define SSL_AIDX_RSA (0)
  +#define SSL_AIDX_DSA (1)
  +#define SSL_AIDX_MAX (2)
  +
  +/*
  + * Define IDs for the temporary RSA keys and DH params
  + */
  +
  +#define SSL_TMP_KEY_RSA_512  (0)
  +#define SSL_TMP_KEY_RSA_1024 (1)
  +#define SSL_TMP_KEY_DH_512   (2)
  +#define SSL_TMP_KEY_DH_1024  (3)
  +#define SSL_TMP_KEY_MAX  (4)
  +
  +/*
  + * Define the SSL options
  + */
  +#define SSL_OPT_NONE   (0)
  +#define SSL_OPT_RELSET (10)
  +#define SSL_OPT_STDENVVARS (11)
  +#define SSL_OPT_EXPORTCERTDATA (13)
  +#define SSL_OPT_FAKEBASICAUTH  (14)
  +#define SSL_OPT_STRICTREQUIRE  (15)
  +#define SSL_OPT_OPTRENEGOTIATE (16)
  +#define SSL_OPT_ALL
(SSL_OPT_STDENVVARS|SSL_OPT_EXPORTCERTDATA|SSL_OPT_FAKEBASICAUTH|SSL_OPT_STRICTREQUIRE|SSL_OPT_OPTRENEGOTIATE)
  +
  +/*
  + * Define the SSL Protocol options
  + */
  +#define SSL_PROTOCOL_NONE  (0)
  +#define SSL_PROTOCOL_SSLV2 (10)
  +#define SSL_PROTOCOL_SSLV3 (11)
  +#define SSL_PROTOCOL_TLSV1 (12)
  +#define SSL_PROTOCOL_ALL   
(SSL_PROTOCOL_SSLV2|SSL_PROTOCOL_SSLV3|SSL_PROTOCOL_TLSV1)
  +
  +/* public cert/private key */
  +typedef struct {
  +/*
  + * server only has 1-2 certs/keys
  + * 1 RSA and/or 1 DSA
  + */
  +const char  *cert_files[SSL_AIDX_MAX];
  +const char  *key_files[SSL_AIDX_MAX];
  +X509*certs[SSL_AIDX_MAX];
  +EVP_PKEY*keys[SSL_AIDX_MAX];
  +
  +/* Certificates which specify the set of CA names which should be
  + * sent in the CertificateRequest message: */
  +const char  *ca_name_path;
  +const char  *ca_name_file;
  +} ssl_pks_t;
  +
  +typedef struct {
  +/* client can have any number of cert/key pairs */
  +const char  *cert_file;
  +const char  *cert_path;
  +STACK_OF(X509_INFO) *certs;
  +} ssl_pkc_t;
  +
  +struct tcn_ssl_ctxt {
  +apr_pool_t  *pool;
  +SSL_CTX *ctx;
  +unsigned char   vhost_id[MD5_DIGEST_LENGTH];
  +
  +int protocol;
  +/* we are one or the other */
  +int mode;
  +union {
  +ssl_pks_t   s;
  +ssl_pkc_t   c;
  +} pk;
  +
  +const char  *cert_chain;
  +/* certificate revocation list */
  +const char  *crl_path;
  +const char  *crl_file;
  +X509_STORE  *crl;
  +
  +/* known/trusted CAs */
  +const char  *ca_cert_path;
  +const char  *ca_cert_file;
  +const char  *cipher_suite;
  +/* for client or downstream server authentication */
  +int verify_depth;
  +int verify_mode;
  +
  +};
   
  +typedef struct tcn_ssl_ctxt tcn_ssl_ctxt_t;
   
   #endif /* SSL_PRIVATE_H */
  
  
  
  1.9   +4 -3  jakarta-tomcat-connectors/jni/native/include/tcn.h
  
  Index: tcn.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- tcn.h 28 May 2005 08:29:14 -  1.8
  +++ tcn.h 30 May 2005 06:17:54 -  1.9
  @@ -55,13 +55,14 @@
   #define TCN_IMPLEMENT_CALL(RT, CL, FN)  \
   JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN
   
  -
  +/* Private helper functions */
   void tcn_Throw(JNIEnv *env, const char *cname, const char *msg);
   void tcn_ThrowException(JNIEnv *env, const char *msg);
   void tcn_ThrowAPRException(JNIEnv *env, apr_status_t err);
   jstring tcn_new_string(JNIEnv *env, const char *str);
   char *tcn_get_string(JNIEnv *env, jstring jstr);
  -char *tcn_dup_string(JNIEnv *env, jstring jstr);
  +char *tcn_strdup(JNIEnv *env, jstring jstr);
  +char *tcn_pstrdup(JNIEnv *env, jstring jstr, apr_pool_t *p);
   apr_status_t tcn_load_finfo_class(JNIEnv *env);
   apr_status_t 

cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni SSL.java

2005-05-30 Thread mturk
mturk   2005/05/29 23:18:06

  Modified:jni/java/org/apache/tomcat/jni SSL.java
  Log:
  Add random seed functions for PRNG initialization.
  
  Revision  ChangesPath
  1.4   +26 -2 
jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSL.java
  
  Index: SSL.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSL.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SSL.java  20 May 2005 09:25:39 -  1.3
  +++ SSL.java  30 May 2005 06:18:06 -  1.4
  @@ -88,7 +88,6 @@
   public static final int SSL_VERIFY_CLIENT_ONCE  = 4;
   public static final int SSL_VERIFY_PEER_STRICT  = 
(SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
   
  -
   /* Return OpenSSL version number */
   public static native int version();
   
  @@ -106,5 +105,30 @@
*/
   public static native int initialize(String engine);
   
  +/**
  + * Add content of the file to the PRNG
  + * @param filename Filename containing random data.
  + *If null the default file will be tested.
  + *The seed file is $RANDFILE if that environment variable is
  + *set, $HOME/.rnd otherwise.
  + */
  +public static native boolean randLoad(String filename);
  +
  +/**
  + * Writes a number of random bytes (currently 1024) to
  + * file @filename which can be used to initialize the PRNG by calling
  + * randLoad in a later session.
  + * @param filename Filename to save the data
  + */
  +public static native boolean randSave(String filename);
  +
  +/**
  + * Creates random data to filename
  + * @param filename Filename to save the data
  + * @len   The length of random sequence in bytes
  + * @base64 Output the data in Base64 encoded format
  + */
  +public static native boolean randMake(String filename, int length,
  +  boolean base64);
   
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Build Tomcat from NSIS

2005-05-30 Thread Jean-Philippe Encausse


Hi,

I have a little developper/user question.
I didn't find answer with jakarta docs/google

I like to build a Windows Install for Tomcat 5.0.x
with my own webapps and configuration inside, using NSIS.

Where can I find a Tutorial, Step by Step How to,
for building a tomcat using:
- Tomcat binary zip (no need to download CVS nor build anything)
- tomcat.nsi from source release
- adding my own configuration and webapp

Or may be you have an easier solution ?

Best Regards

--
Jean-Philippe Encausse - RD Jalios SA
[EMAIL PROTECTED] - http://www.encausse.com - http://www.jalias.com
ICQ: 109796741 - AOL: NextOne - MSN: [EMAIL PROTECTED]
Mob: +33 6 80 75 71 09 Office: +33 1 39 23 92 83 Home: +33 1 39 18 90 15
Do it Once, Use it Twice ~ Do it Twice, Make It Once


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 35124] New: - catalina stop problem, uses kill approach

2005-05-30 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=35124.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35124

   Summary: catalina stop problem, uses kill approach
   Product: Tomcat 5
   Version: 5.0.1
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P3
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


catalina.sh script uses 'kill' approach for stopping catalina. For killing it 
finds tomcat pid using 
tomcat_process=`netstat -anp | grep 8009 | awk '{print $NF}' | cut -d/ -f1`
kill -9 $tomcat_process
problem with this approach is that when any connection is in timewait state, 
then the kill command will become 'kill -9 -' which actually kills the current 
shell as well.
Other thing is that it uses 8009 port for finding pid of tomcat. Now this port 
is subject to change by the user. So it might create problem.
Kill approach causes other commands not to be executed, after catalina.sh stop.
We uses in httpd service, so it creates problem in starting httpd service from 
midway.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DO NOT REPLY [Bug 35124] New: -

2005-05-30 Thread support
Ceci est un répondeur automatique.

Face à la recrudescence du spam et des virus sur Internet, nous ne traitons 
plus les messages envoyés directement à une adresse email. 

IMPORTANT:  VOTRE COURRIER N A PAS ETE OUVERT ET NOTRE EQUIPE N A PAS PU EN 
PRENDRE CONNAISSANCE. 

Pour nous contacter, nous vous remercions de nous écrire à partir du formulaire 
'Contactez nous', disponible sur nos différents portails.

Nous vous remercions pour votre compréhension.

A très bientôt.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 35128] New: - Cannot pass -ea to Tomcat JRE

2005-05-30 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=35128.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35128

   Summary: Cannot pass -ea to Tomcat JRE
   Product: Tomcat 5
   Version: 5.5.9
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Native:Integration
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Adding enable asserts on the Tomcat JRE startup arguments causes the service
to refuse to start up properly. This used to work with earlier Tomcat 5.5 
builds.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 35124] - catalina stop problem, uses kill approach

2005-05-30 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=35124.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35124


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-05-31 02:14 ---
The following command is used for the kill:
   kill -9 `cat $CATALINA_PID`

Your linux distro must be repackaging and doing bad things.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]