Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Bug fix for HTTP GET!!
  • Loading branch information
Talos-Martin authored Apr 22, 2021
1 parent e3b01e2 commit c13b4fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.29
- BUGFIX: HTTP GET was broken after version 1.28, since it showed the
file as being sent from client to server, not the otehr way round.
Both HTTP POST and GET now show the correct directions in transferring
the files. Thanks again Nick!

1.28
- Bugfix in the http module. The POST should obviously have the client
upload data to the server, not the other way round. Fixed now.
Expand Down
1 change: 1 addition & 0 deletions file2pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ int httpPost(struct handover *ho) {

tcpHandshake(ho);
httpPostRequest(ho);
ho->direction = TO_SERVER;
httpTransferFile(ho);
httpPostFinalBoundary(ho);
tcpShutdown(ho);
Expand Down
2 changes: 1 addition & 1 deletion file2pcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <netinet/in.h> // struct ip6_hdr


#define VERSION "1.28"
#define VERSION "1.29"

#define INTERVAL 13000 //About 70 packets per second
#define READ_SIZE 1200
Expand Down
6 changes: 3 additions & 3 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,19 @@ int httpTransferFile(struct handover *ho) {
}
else if(ho->httpEncoder == ENC_HTTP_CHUNKED)
{
tcpSendHttpChunked(ho, NULL, 0, TO_SERVER);
tcpSendHttpChunked(ho, NULL, 0, ho->direction);
}

return 0;
}

if(ho->httpEncoder == ENC_HTTP_CHUNKED || ho->httpEncoder == ENC_HTTP_GZIP_CHUNKED)
{
tcpSendHttpChunked(ho, buffer, count, TO_SERVER);
tcpSendHttpChunked(ho, buffer, count, ho->direction);
}
else
{
tcpSendData(ho, buffer, count, TO_SERVER);
tcpSendData(ho, buffer, count, ho->direction);
}

}
Expand Down

0 comments on commit c13b4fd

Please sign in to comment.