loudmouth/lm-connection.c
changeset 443 5dd3b432c53e
parent 442 33224064e97a
child 445 64c212f13709
equal deleted inserted replaced
442:33224064e97a 443:5dd3b432c53e
   481 	connection_log_send (connection, str, len);
   481 	connection_log_send (connection, str, len);
   482 
   482 
   483 	/* Check to see if there already is an output buffer, if so, add to the
   483 	/* Check to see if there already is an output buffer, if so, add to the
   484 	   buffer and return */
   484 	   buffer and return */
   485 
   485 
   486 	if (lm_old_socket_output_is_buffered (connection->socket, str, len)) {
       
   487 		return TRUE;
       
   488 	}
       
   489 
       
   490 	b_written = lm_old_socket_do_write (connection->socket, str, len);
   486 	b_written = lm_old_socket_do_write (connection->socket, str, len);
   491 
   487 
   492 	if (b_written < 0) {
   488 	if (b_written < 0) {
   493 		g_set_error (error,
   489 		g_set_error (error,
   494 			     LM_ERROR,
   490 			     LM_ERROR,
   495 			     LM_ERROR_CONNECTION_FAILED,
   491 			     LM_ERROR_CONNECTION_FAILED,
   496 			     "Server closed the connection");
   492 			     "Server closed the connection");
   497 		return FALSE;
   493 		return FALSE;
   498 	}
       
   499 
       
   500 	if (b_written < len) {
       
   501 		lm_old_socket_setup_output_buffer (connection->socket, 
       
   502                                                    str + b_written, 
       
   503                                                    len - b_written);
       
   504 	}
   494 	}
   505 
   495 
   506 	return TRUE;
   496 	return TRUE;
   507 }
   497 }
   508 
   498