syslog-ng-users April 2011 archive
Main Archive Page > Month Archives  > syslog-ng-users archives
syslog-ng-users: [syslog-ng] Openssl SSL3_WRITE_PENDING error co

[syslog-ng] Openssl SSL3_WRITE_PENDING error correction

From: Juhasz Viktor <jviktor_at_nospam>
Date: Fri Apr 01 2011 - 12:28:53 GMT
To: syslog-ng@lists.balabit.hu

Hi All!

We've found a bug in the log_proto_framed_client.
The bug is the following:
- using ssl communication between the server and client.
- using syslog protocol
- If client send messages faster than the server can process messages,
then the client go into the SSL3_WRITE_PENDING openssl error and close
the connection.

partial message handling correction:
   
    the flush is called only if proto have partially sent message
    after flush is called log_proto_text_client_post have to return
because the post send one message per call
    it is important in case of framed messages

diff --git a/lib/logproto.c b/lib/logproto.c
index d821275..7f2f897 100644
--- a/lib/logproto.c
+++ b/lib/logproto.c
@@ -145,9 +145,13 @@ log_proto_text_client_post(LogProto *s, guchar
*msg, gsize msg_len, gboolean *co
   g_assert(self->super.convert == (GIConv) -1);
 
   *consumed = FALSE;
- rc = log_proto_flush(s);
- if (rc == LPS_ERROR)
- goto write_error;
+ if(self->partial)
+ {
+ rc = log_proto_flush(s);
+ if (rc == LPS_ERROR)
+ goto write_error;
+ return rc;
+ }
 
   /* OK, partial buffer empty, now flush msg that we just got */
  
@@ -1774,6 +1778,7 @@ log_proto_framed_client_new(LogTransport *transport)
 
   self->super.super.prepare = log_proto_text_client_prepare;
   self->super.super.post = log_proto_framed_client_post;
+ self->super.super.flush = log_proto_text_client_flush;
   self->super.super.transport = transport;
   self->super.super.convert = (GIConv) -1;
   return &self->super.super;

Best Regards,
Viktor

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.campin.net/syslog-ng/faq.html