forked from yuxh/gearman-go
		
	Merge pull request #50 from AzuraMeta/patch-1
Fixed WORK_FAIL needing 2 arguments
This commit is contained in:
		
						commit
						ea92c122a5
					
				@ -76,7 +76,7 @@ func decodeResponse(data []byte) (resp *Response, l int, err error) {
 | 
			
		||||
	case dtJobCreated:
 | 
			
		||||
		resp.Handle = string(dt)
 | 
			
		||||
	case dtStatusRes, dtWorkData, dtWorkWarning, dtWorkStatus,
 | 
			
		||||
		dtWorkComplete, dtWorkFail, dtWorkException:
 | 
			
		||||
		dtWorkComplete, dtWorkException:
 | 
			
		||||
		s := bytes.SplitN(dt, []byte{'\x00'}, 2)
 | 
			
		||||
		if len(s) >= 2 {
 | 
			
		||||
			resp.Handle = string(s[0])
 | 
			
		||||
@ -85,6 +85,14 @@ func decodeResponse(data []byte) (resp *Response, l int, err error) {
 | 
			
		||||
			err = fmt.Errorf("Invalid data: %v", data)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	case dtWorkFail:
 | 
			
		||||
		s := bytes.SplitN(dt, []byte{'\x00'}, 2)
 | 
			
		||||
		if len(s) >= 1 {
 | 
			
		||||
			resp.Handle = string(s[0])
 | 
			
		||||
		} else {
 | 
			
		||||
			err = fmt.Errorf("Invalid data: %v", data)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	case dtEchoRes:
 | 
			
		||||
		fallthrough
 | 
			
		||||
	default:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user