Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Extend calls for #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ELynx committed Sep 8, 2016
1 parent 8e8cb90 commit 4b31fc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public interface ModuleManager {
* @param data Data of request
* @return Modified data if changes are made, null otherwise
*/
ByteString processRequest(Requests.RequestType type, ByteString data);
ByteString processRequest(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk);

/**
* Process response from server to client
Expand All @@ -79,5 +79,5 @@ public interface ModuleManager {
* @param data Data of response
* @return Modified data if changes are made, null otherwise
*/
ByteString processResponse(Requests.RequestType type, ByteString data);
ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk);
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public Set<Requests.RequestType> responseTypes() {
return new HashSet<>();
}

public ByteString processRequest(Requests.RequestType type, ByteString data) {
public ByteString processRequest(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) {
return null;
}

public ByteString processResponse(Requests.RequestType type, ByteString data) {
public ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public String userspaceName() {
}

public String userspaceBrief() {
return "Module that does nothing";
return "Module that doubles even responses";
}

public String userspaceInfo() {
Expand All @@ -33,8 +33,8 @@ public Set<Requests.RequestType> responseTypes() {
return types;
}

public ByteString processResponse(Requests.RequestType type, ByteString data) {
if (data.size() < 5) {
public ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) {
if (connectionOk && ((exchangeId & 1) == 0)) {
//TODO valid?
return data.concat(data);
}
Expand Down

0 comments on commit 4b31fc2

Please sign in to comment.