Skip to content

Commit

Permalink
Found a server problem with operation length > J_STRIPE_SIZE, added F…
Browse files Browse the repository at this point in the history
…IXME to server.c
  • Loading branch information
oliver-pola committed Mar 3, 2019
1 parent b80129f commit 81732b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ jd_on_run (GThreadedSocketService* service, GSocketConnection* connection, GObje
length = j_message_get_8(message);
offset = j_message_get_8(message);

// FIXME Easy to create an operation with length > J_STRIPE_SIZE
// that will never fit into any memory chunk, reset and use the
// full cache of size J_STRIPE_SIZE is no solution
// TODO Split such operation
buf = j_memory_chunk_get(memory_chunk, length);

if (buf == NULL)
Expand Down Expand Up @@ -287,6 +291,8 @@ jd_on_run (GThreadedSocketService* service, GSocketConnection* connection, GObje
offset = j_message_get_8(message);

/* Check whether we can merge two consecutive operations. */
// FIXME Easy to create an operation with length > J_STRIPE_SIZE
// TODO Consider split of operations requested too large
if (merge_length > 0 && merge_offset + merge_length == offset && merge_length + length <= J_STRIPE_SIZE)
{
merge_length += length;
Expand Down

0 comments on commit 81732b7

Please sign in to comment.