Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/danmia/pcapdaemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Murphy committed Sep 21, 2016
2 parents 8ae8d23 + d082539 commit a0ab54a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,23 @@ func captureToBuffer(req Capmsg, iface string) {
if(ferr != nil) {
fmt.Printf("Error writing file: %s", ferr)
log.Printf("Error writing file: %s", ferr)
} else {
log.Printf("Written locally file: %s", config.Gen.Localdir + "/" + fileName)
fmt.Printf("Written locally file: %s", config.Gen.Localdir + "/" + fileName)
}

}

if(config.Cs.Upload) {
log.Printf("Uploading to Cloudshark file: %s", fileName)
fmt.Printf("Uploading to Cloudshark file: %s", fileName)
postBufferCloudshark(config.Cs.Scheme, config.Cs.Host, config.Cs.Port, config.Cs.Token, f, fileName, tagstr)
}

if(config.Aws.Upload) {
log.Printf("Uploading to S3 file: %s", fileName)
log.Printf("Uploading to S3 file: %s", fileName)

var msgfolder string
var msgbucket string
var msgacl string
Expand Down Expand Up @@ -223,6 +232,9 @@ func captureToBuffer(req Capmsg, iface string) {
msgconfig.Region = &msgregion
msgconfig.Endpoint = &msgep

log.Printf("Uploading to S3 file: %s", msgbucket + ":" + msgfolder + "/" + fileName)
fmt.Printf("Uploading to S3 file: %s", msgbucket + ":" + msgfolder + "/" + fileName)

postS3(*msgconfig, msgbucket, f, fileName, tagstr, msgfolder, msgacl, msgenc)
}

Expand Down
2 changes: 2 additions & 0 deletions postdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func postBufferCloudshark(scheme string, host string, port int, token string, bu
fmt.Println(resp.StatusCode)
fmt.Println(resp.Header)
fmt.Println(body)
log.Println("Successfully uploaded ", filename, " to Cloudshark")
fmt.Println("Successfully uploaded ", filename, " to Cloudshark")
}
}

Expand Down

0 comments on commit a0ab54a

Please sign in to comment.