void _dbus_message_loader_get_buffer (DBusMessageLoader *loader,
DBusString **buffer);
void _dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer,
- int bytes_read);
+ DBusString *buffer);
dbus_bool_t _dbus_message_loader_get_unix_fds (DBusMessageLoader *loader,
int **fds,
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer,
_dbus_string_get_byte (data, i));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_copy (data, 0, buffer,
_dbus_string_get_length (buffer));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
if ((i+1) < len)
_dbus_string_append_byte (buffer,
_dbus_string_get_byte (data, i+1));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
/* Write the body data one byte at a time */
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
#ifdef HAVE_UNIX_FD_PASSING
*
* @param loader the loader.
* @param buffer the buffer.
- * @param bytes_read number of bytes that were read into the buffer.
*/
void
_dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer,
- int bytes_read)
+ DBusString *buffer)
{
_dbus_assert (loader->buffer_outstanding);
_dbus_assert (buffer == &loader->data);
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_len (buffer, str, len);
- _dbus_message_loader_return_buffer (loader, buffer, len);
+ _dbus_message_loader_return_buffer (loader, buffer);
if (!_dbus_message_loader_queue_messages (loader))
goto fail_oom;
if (bytes_read > 0)
{
- int orig_len;
-
_dbus_message_loader_get_buffer (transport->loader,
&buffer);
- orig_len = _dbus_string_get_length (buffer);
-
if (!_dbus_auth_decode_data (transport->auth,
&socket_transport->encoded_incoming,
buffer))
{
_dbus_verbose ("Out of memory decoding incoming data\n");
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) - orig_len);
+ buffer);
oom = TRUE;
goto out;
}
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) - orig_len);
+ buffer);
_dbus_string_set_length (&socket_transport->encoded_incoming, 0);
_dbus_string_compact (&socket_transport->encoded_incoming, 2048);
if (!_dbus_message_loader_get_unix_fds(transport->loader, &fds, &n_fds))
{
_dbus_verbose ("Out of memory reading file descriptors\n");
- _dbus_message_loader_return_buffer (transport->loader, buffer, 0);
+ _dbus_message_loader_return_buffer (transport->loader, buffer);
oom = TRUE;
goto out;
}
}
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- bytes_read < 0 ? 0 : bytes_read);
+ buffer);
}
if (bytes_read < 0)
orig_len);
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) -
- orig_len);
+ buffer);
_dbus_auth_delete_unused_bytes (transport->auth);
orig_len);
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) -
- orig_len);
+ buffer);
if (succeeded)
_dbus_auth_delete_unused_bytes (transport->auth);