Skip to content

Commit

Permalink
Fix numeric sorting & rare response-duplication with empty responses
Browse files Browse the repository at this point in the history
  • Loading branch information
albinowax committed Feb 8, 2019
1 parent 69bb0ff commit 5650500
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RequestTable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class RequestTable(val service: IHttpService, val handler: AttackHandler): JPane
}


override fun add(req: Request) {
@Synchronized override fun add(req: Request) {
model.addRequest(req)
}

Expand Down
11 changes: 11 additions & 0 deletions src/RequestTableModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ class RequestTableModel : AbstractTableModel() {
return columns[column]
}

override fun getColumnClass(columnIndex: Int): Class<*> {
return when (columnIndex) {
0 -> java.lang.Integer::class.java
1 -> String::class.java
2 -> java.lang.Integer::class.java
3 -> java.lang.Integer::class.java
4 -> java.lang.Integer::class.java
else -> throw RuntimeException()
}
}

override fun getValueAt(rowIndex: Int, columnIndex: Int): Any? {
val request = requests[rowIndex]

Expand Down
1 change: 1 addition & 0 deletions src/ThreadedRequestEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ open class ThreadedRequestEngine(url: String, val threads: Int, maxQueueSize: In

if (bodyStart+4 == buffer.length) {
// no need to read the body
buffer = ""
}
else if (contentLength != -1) {
val responseLength = bodyStart + contentLength + 4
Expand Down

0 comments on commit 5650500

Please sign in to comment.