Skip to content

Conversation

@borsanza
Copy link

Hi Pablo,
I noticed a small issue in the fragmentation logic: the remaining variable incorrectly subtracts the header size from the payload, which results in undercounting the actual data to be sent.
This pull request fixes that by assigning dataSize directly to remaining, as the header size is already handled separately in each fragment.
Thanks for the great tool!

Hola Pablo,
He detectado un pequeño error en la lógica de fragmentación: la variable remaining resta incorrectamente el tamaño de la cabecera, lo que hace que se envíen menos datos de los necesarios.
Este pull request lo corrige asignando directamente dataSize a remaining, ya que el tamaño de la cabecera ya se descuenta correctamente en cada fragmento.
¡Gracias por esta herramienta tan útil!

@borsanza
Copy link
Author

How to reproduce the issue:
Use the following values:

dataSize = 2000
mtuSize = 1000

With the original code, the fragments generated are:
976 + 976 + 28 = 1980 bytes (20 bytes missing)

With this fix, you get:
976 + 976 + 48 = 2000 bytes total, which is correct.

Cómo reproducir el problema:
Usa estos valores:

dataSize = 2000
mtuSize = 1000

Con el código original, los fragmentos generados son:
976 + 976 + 28 = 1980 bytes (faltan 20 bytes)

Con la corrección, se obtiene:
976 + 976 + 48 = 2000 bytes en total, como debe ser.

@borsanza
Copy link
Author

image

This is correct!

@fixmycode
Copy link
Owner

Apparently @amandoee detected the same issue a year ago in PR #4, and I'm the worst at maintaining projects, I really appreciate that you consider this tool useful :) I'll check out the fixes as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants