MCPcopy
hub / github.com/cubefs/cubefs / sendResumeRequest

Function sendResumeRequest

client/fuse.go:227–255  ·  view source on GitHub ↗
(port string)

Source from the content-addressed store, hash-verified

225}
226
227func sendResumeRequest(port string) (err error) {
228 var (
229 req *http.Request
230 resp *http.Response
231 data []byte
232 )
233
234 url := fmt.Sprintf("http://%s:%s/resume", DefaultIP, port)
235 if req, err = http.NewRequest("POST", url, nil); err != nil {
236 log.LogErrorf("Failed to get new request: %v\n", err)
237 return err
238 }
239 req.Header.Set("Content-Type", "application/text")
240
241 client := http.DefaultClient
242 if resp, err = client.Do(req); err != nil {
243 log.LogErrorf("Failed to post request: %v\n", err)
244 return err
245 }
246 defer resp.Body.Close()
247
248 if data, err = io.ReadAll(resp.Body); err != nil {
249 log.LogErrorf("Failed to read response: %v\n", err)
250 return err
251 }
252
253 log.LogInfof("data: %s\n", string(data))
254 return nil
255}
256
257func doSuspend(uds string, port string) (*os.File, error) {
258 var fud *os.File

Callers 1

doSuspendFunction · 0.85

Calls 6

LogErrorfFunction · 0.92
LogInfofFunction · 0.92
SetMethod · 0.65
DoMethod · 0.65
CloseMethod · 0.65
ReadAllMethod · 0.65

Tested by

no test coverage detected