mirror of
				https://github.com/pion/webrtc.git
				synced 2025-10-31 10:46:39 +08:00 
			
		
		
		
	Pad out each chunk
This commit is contained in:
		 John R. Bradley
					John R. Bradley
				
			
				
					committed by
					
						 Sean DuBois
						Sean DuBois
					
				
			
			
				
	
			
			
			 Sean DuBois
						Sean DuBois
					
				
			
						parent
						
							22e98b0dfb
						
					
				
				
					commit
					a1874f912d
				
			| @@ -115,6 +115,14 @@ func (i *InitCommon) Marshal() ([]byte, error) { | ||||
| 		} | ||||
|  | ||||
| 		out = append(out, pp...) | ||||
|  | ||||
| 		// Chunks (including Type, Length, and Value fields) are padded out | ||||
| 		// by the sender with all zero bytes to be a multiple of 4 bytes | ||||
| 		// long.  This padding MUST NOT be more than 3 bytes in total.  The | ||||
| 		// Chunk Length value does not include terminating padding of the | ||||
| 		// chunk.  *However, it does include padding of any variable-length | ||||
| 		// parameter except the last parameter in the chunk.*  The receiver | ||||
| 		// MUST ignore the padding. | ||||
| 		if idx != len(i.params)-1 { | ||||
| 			padding := make([]byte, getPadding(len(pp), 4)) | ||||
| 			out = append(out, padding...) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user