Guest User

Untitled

a guest
Jun 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. diff --git a/src/Manos/Manos.Http/HttpMultiPartFormDataHandler.cs b/src/Manos/Manos.Http/HttpMultiPartFormDataHandler.cs
  2. index f44fd98..12c9e01 100644
  3. --- a/src/Manos/Manos.Http/HttpMultiPartFormDataHandler.cs
  4. +++ b/src/Manos/Manos.Http/HttpMultiPartFormDataHandler.cs
  5. @@ -37,6 +37,8 @@ namespace Manos.Http {
  6.  
  7. private enum State {
  8.  
  9. + Error,
  10. +
  11. InHeaderKey,
  12. InHeaderValue,
  13. PostHeader1,
  14. @@ -88,8 +90,13 @@ namespace Manos.Http {
  15. // string str_data = encoding.GetString (data.Bytes, pos, len);
  16. byte [] str_data = data.Bytes;
  17.  
  18. - pos = -1;
  19. - len = str_data.Length;
  20. + Console.WriteLine ("POSITION: '{0}' LENGTH: '{1}'", pos, len);
  21. + Console.WriteLine ("the boundary: " + boundary);
  22. + Console.WriteLine ("STR DATA: current state: {1}\n{0}\n\n", encoding.GetString (data.Bytes, pos, len), state);
  23. +
  24. + int begin = pos;
  25. + pos = begin - 1;
  26. + len = data.Length;
  27.  
  28. while (pos < len - 1 && state != State.Finished) {
  29.  
  30. @@ -119,6 +126,11 @@ namespace Manos.Http {
  31. stream.Write (str_data, pos + 1, str_data.Length - pos - 1);
  32. str_data = stream.ToArray ();
  33.  
  34. + Console.WriteLine ("no longer in boundary: '{0}' '{1}' '{2}' '{3}'", (char) c, pos - begin, index, boundary [index]);
  35. + Console.WriteLine ("new data:");
  36. + Console.WriteLine (encoding.GetString (str_data));
  37. + Console.WriteLine ();
  38. +
  39. pos = -1;
  40. len = str_data.Length;
Add Comment
Please, Sign In to add comment