Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
bugfix: use rawUrl to interact with source server
Browse files Browse the repository at this point in the history
Signed-off-by: Starnop <starnop@163.com>
  • Loading branch information
starnop committed Jul 24, 2019
1 parent c5d0873 commit 1462972
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dfdaemon/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (proxy *Proxy) handleHTTP(w http.ResponseWriter, req *http.Request) {
copyHeader(w.Header(), resp.Header)
w.WriteHeader(resp.StatusCode)
if _, err := io.Copy(w, resp.Body); err != nil {
logrus.Errorf("failed to write http body")
logrus.Errorf("failed to write http body: %v", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion supernode/daemon/mgr/cdn/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (cm *Manager) TriggerCDN(ctx context.Context, task *types.TaskInfo) (*types
pieceContSize := task.PieceSize - config.PieceWrapSize

// start to download the source file
resp, err := cm.download(ctx, task.ID, task.TaskURL, task.Headers, startPieceNum, httpFileLength, pieceContSize)
resp, err := cm.download(ctx, task.ID, task.RawURL, task.Headers, startPieceNum, httpFileLength, pieceContSize)
if err != nil {
return getUpdateTaskInfoWithStatusOnly(types.TaskInfoCdnStatusFAILED), err
}
Expand Down
2 changes: 1 addition & 1 deletion supernode/daemon/mgr/task/manager_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (tm *Manager) addOrUpdateTask(ctx context.Context, req *types.TaskCreateReq
}

// get fileLength with req.Headers
fileLength, err := getHTTPFileLength(taskID, task.TaskURL, req.Headers)
fileLength, err := getHTTPFileLength(taskID, task.RawURL, req.Headers)
if err != nil {
logrus.Errorf("failed to get file length from http client for taskID(%s): %v", taskID, err)
}
Expand Down

0 comments on commit 1462972

Please sign in to comment.