You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2011/11/01 17:39:25 UTC

svn commit: r1196108 - /tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Author: mturk
Date: Tue Nov  1 16:39:24 2011
New Revision: 1196108

URL: http://svn.apache.org/viewvc?rev=1196108&view=rev
Log:
Fix log line endings. Having CR LF appended results in CR CR LF to get written. MSVCRT automatically sets CRLF instead LF unless the file is opened in binary mode

Modified:
    tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1196108&r1=1196107&r2=1196108&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Tue Nov  1 16:39:24 2011
@@ -2525,7 +2525,7 @@ static int init_logger(int rotate, jk_lo
     /* Close the current log file if required, and the effective log file name has changed */
     if (log_open && strncmp(log_file_name, log_file_effective, strlen(log_file_name)) != 0) {
         FILE* lf = ((jk_file_logger_t* )logger->logger_private)->logfile;
-        fprintf(lf, "Log rotated to %s\r\n", log_file_name);
+        fprintf(lf, "Log rotated to %s\n", log_file_name);
         fflush(lf);
         rc = jk_close_file_logger(&logger);
         log_open = JK_FALSE;
@@ -2595,19 +2595,21 @@ static int JK_METHOD iis_log_to_file(jk_
         rc = JK_TRUE;
 
         if (p->logfile) {
+#if 0
             what[used++] = '\r';
+#endif
             what[used++] = '\n';
             what[used] = '\0';
 
             /* Perform logging within critical section to protect rotation */
-            JK_ENTER_CS(&(log_cs), rc);
-            if (rc && rotate_log_file(&l)) {
+            JK_ENTER_CS(&log_cs, rc);
+            if (rotate_log_file(&l)) {
                 /* The rotation process will reallocate the jk_logger_t structure, so refetch */
                 FILE *rotated = ((jk_file_logger_t *)l->logger_private)->logfile;
                 fputs(what, rotated);
                 fflush(rotated);
-                JK_LEAVE_CS(&(log_cs), rc);
             }
+            JK_LEAVE_CS(&log_cs, rc);
         }
     }
     return rc;



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