Loading .gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ stages: variables: GIT_STRATEGY: clone CONTAINER_RDM_URL: "${CI_REGISTRY_IMAGE}/remote-data-broker" TAG: 0.2.0 TAG: 0.2.1 # This import is for the func_rse_docker_* functions before_script: Loading CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ SET(CPACK_RPM_PACKAGE_MAINTAINER "ORNL") set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "2") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_VERSION_PATCH "1") INCLUDE(CPack) Loading src/http_server/download_remote.go +15 −5 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package http_server import ( "encoding/json" "errors" "fmt" "github.com/google/uuid" "github.com/gorilla/mux" "io" Loading Loading @@ -37,19 +36,30 @@ func routeFileUpload(w http.ResponseWriter, r *http.Request) { return } buffer := make([]byte, chunkSize) timeout := time.Second * time.Duration(common.Settings.Http.Timeout) timer := time.NewTimer(timeout) for { bytesRead, err := r.Body.Read(buffer) if bytesRead > 0 { select { case ch <- buffer[:bytesRead]: default: log.Error("no message sent") timer.Reset(timeout) case <-timer.C: log.WithFields(map[string]interface{}{ "name": id, "mode": "as user, from remote", }).Error("Receiving file from RMQ client timeout") utils.WriteServerError(w, errors.New("request timeout"), http.StatusInternalServerError) return } } if err != nil { if err != io.EOF { fmt.Println(err) log.WithFields(map[string]interface{}{ "name": id, "error": err, }).Error("Error receiving file from RMQ client") } break } Loading @@ -60,7 +70,7 @@ func routeFileUpload(w http.ResponseWriter, r *http.Request) { var channels = make(map[string]chan []byte, 0) func downloadFromRemote(w http.ResponseWriter, downloadRequest fileDownloadRequest, remoteQueue string) { channel := make(chan []byte) channel := make(chan []byte, 32000) id := uuid.New().String() channels[id] = channel Loading Loading
.gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ stages: variables: GIT_STRATEGY: clone CONTAINER_RDM_URL: "${CI_REGISTRY_IMAGE}/remote-data-broker" TAG: 0.2.0 TAG: 0.2.1 # This import is for the func_rse_docker_* functions before_script: Loading
CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ SET(CPACK_RPM_PACKAGE_MAINTAINER "ORNL") set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "2") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_VERSION_PATCH "1") INCLUDE(CPack) Loading
src/http_server/download_remote.go +15 −5 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package http_server import ( "encoding/json" "errors" "fmt" "github.com/google/uuid" "github.com/gorilla/mux" "io" Loading Loading @@ -37,19 +36,30 @@ func routeFileUpload(w http.ResponseWriter, r *http.Request) { return } buffer := make([]byte, chunkSize) timeout := time.Second * time.Duration(common.Settings.Http.Timeout) timer := time.NewTimer(timeout) for { bytesRead, err := r.Body.Read(buffer) if bytesRead > 0 { select { case ch <- buffer[:bytesRead]: default: log.Error("no message sent") timer.Reset(timeout) case <-timer.C: log.WithFields(map[string]interface{}{ "name": id, "mode": "as user, from remote", }).Error("Receiving file from RMQ client timeout") utils.WriteServerError(w, errors.New("request timeout"), http.StatusInternalServerError) return } } if err != nil { if err != io.EOF { fmt.Println(err) log.WithFields(map[string]interface{}{ "name": id, "error": err, }).Error("Error receiving file from RMQ client") } break } Loading @@ -60,7 +70,7 @@ func routeFileUpload(w http.ResponseWriter, r *http.Request) { var channels = make(map[string]chan []byte, 0) func downloadFromRemote(w http.ResponseWriter, downloadRequest fileDownloadRequest, remoteQueue string) { channel := make(chan []byte) channel := make(chan []byte, 32000) id := uuid.New().String() channels[id] = channel Loading