diff src/org/eclipse/jetty/http/HttpGenerator.java @ 1074:6b7ff30bb990

rename putQ() to put()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 10 Nov 2016 02:37:15 -0700
parents b4ba8a4d5a16
children ebb0f1343ef6
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Thu Nov 10 02:33:09 2016 -0700
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Thu Nov 10 02:37:15 2016 -0700
@@ -150,19 +150,19 @@
 				if (_bufferChunked)
 				{
 					JBuffer nc = _buffers.getBuffer(_content.remaining()+CHUNK_SPACE+content.remaining());
-					nc.putQ(_content);
-					nc.putQ(HttpTokens.CRLF);
+					nc.put(_content);
+					nc.put(HttpTokens.CRLF);
 					BufferUtil.putHexInt(nc, content.remaining());
-					nc.putQ(HttpTokens.CRLF);
-					nc.putQ(content);
+					nc.put(HttpTokens.CRLF);
+					nc.put(content);
 					nc.flip();
 					content = nc;
 				}
 				else
 				{
 					JBuffer nc = _buffers.getBuffer(_content.remaining()+content.remaining());
-					nc.putQ(_content);
-					nc.putQ(content);
+					nc.put(_content);
+					nc.put(content);
 					nc.flip();
 					content = nc;
 				}
@@ -186,7 +186,7 @@
 		{
 //System.out.println("qqqqqqqqqqqqqqqqqqq c");
 			// Copy _content to buffer;
-			_buffer.putQ(_content);
+			_buffer.put(_content);
 			if (!_content.hasRemaining())
 				_content = null;
 		}
@@ -236,8 +236,8 @@
 		if (status==null)
 			throw new IllegalArgumentException(code+"?");
 
-		_header.putQ(status._responseLine);
-		_header.putQ(HttpTokens.CRLF);
+		_header.put(status._responseLine);
+		_header.put(HttpTokens.CRLF);
 
 		try
 		{
@@ -294,31 +294,31 @@
 
 				if (status==null)
 				{
-					_header.putQ(HttpVersions.HTTP_1_1_BYTES);
-					_header.putQ((byte) ' ');
-					_header.putQ((byte) ('0' + _status / 100));
-					_header.putQ((byte) ('0' + (_status % 100) / 10));
-					_header.putQ((byte) ('0' + (_status % 10)));
-					_header.putQ((byte) ' ');
+					_header.put(HttpVersions.HTTP_1_1_BYTES);
+					_header.put((byte) ' ');
+					_header.put((byte) ('0' + _status / 100));
+					_header.put((byte) ('0' + (_status % 100) / 10));
+					_header.put((byte) ('0' + (_status % 10)));
+					_header.put((byte) ' ');
 					if (_reason==null)
 					{
-						_header.putQ((byte) ('0' + _status / 100));
-						_header.putQ((byte) ('0' + (_status % 100) / 10));
-						_header.putQ((byte) ('0' + (_status % 10)));
+						_header.put((byte) ('0' + _status / 100));
+						_header.put((byte) ('0' + (_status % 100) / 10));
+						_header.put((byte) ('0' + (_status % 10)));
 					}
 					else
-						_header.putQ(_reason);
-					_header.putQ(HttpTokens.CRLF);
+						_header.put(_reason);
+					_header.put(HttpTokens.CRLF);
 				}
 				else
 				{
 					if (_reason==null)
-						_header.putQ(status._responseLine);
+						_header.put(status._responseLine);
 					else
 					{
-						_header.putQ(status._schemeCode);
-						_header.putQ(_reason);
-						_header.putQ(HttpTokens.CRLF);
+						_header.put(status._schemeCode);
+						_header.put(_reason);
+						_header.put(HttpTokens.CRLF);
 					}
 				}
 
@@ -331,7 +331,7 @@
 
 					if (_status!=101 )
 					{
-						_header.putQ(HttpTokens.CRLF);
+						_header.put(HttpTokens.CRLF);
 						_state = STATE_CONTENT;
 						return;
 					}
@@ -514,11 +514,11 @@
 						if (content_length == null && !_noContent)
 						{
 							// known length but not actually set.
-							_header.putQ(HttpHeaders.CONTENT_LENGTH_BYTES);
-							_header.putQ(HttpTokens.COLON);
-							_header.putQ((byte) ' ');
+							_header.put(HttpHeaders.CONTENT_LENGTH_BYTES);
+							_header.put(HttpTokens.COLON);
+							_header.put((byte) ' ');
 							BufferUtil.putDecLong(_header, _contentLength);
-							_header.putQ(HttpTokens.CRLF);
+							_header.put(HttpTokens.CRLF);
 						}
 					}
 					else
@@ -530,7 +530,7 @@
 
 				case HttpTokens.NO_CONTENT:
 					if (content_length == null && _status >= 200 && _status != 204 && _status != 304)
-						_header.putQ(CONTENT_LENGTH_0);
+						_header.put(CONTENT_LENGTH_0);
 					break;
 
 				case HttpTokens.EOF_CONTENT:
@@ -558,7 +558,7 @@
 						throw new IllegalArgumentException("BAD TE");
 				}
 				else
-					_header.putQ(TRANSFER_ENCODING_CHUNKED);
+					_header.put(TRANSFER_ENCODING_CHUNKED);
 			}
 
 			// Handle connection if need be
@@ -570,38 +570,38 @@
 
 			if (!_persistent && (close || _version > HttpVersions.HTTP_1_0_ORDINAL))
 			{
-				_header.putQ(CONNECTION_CLOSE);
+				_header.put(CONNECTION_CLOSE);
 				if (connection!=null)
 				{
 					_header.position(_header.position()-2);
-					_header.putQ((byte)',');
-					_header.putQ(connection.toString().getBytes());
-					_header.putQ(CRLF);
+					_header.put((byte)',');
+					_header.put(connection.toString().getBytes());
+					_header.put(CRLF);
 				}
 			}
 			else if (keep_alive)
 			{
-				_header.putQ(CONNECTION_KEEP_ALIVE);
+				_header.put(CONNECTION_KEEP_ALIVE);
 				if (connection!=null)
 				{
 					_header.position(_header.position()-2);
-					_header.putQ((byte)',');
-					_header.putQ(connection.toString().getBytes());
-					_header.putQ(CRLF);
+					_header.put((byte)',');
+					_header.put(connection.toString().getBytes());
+					_header.put(CRLF);
 				}
 			}
 			else if (connection!=null)
 			{
-				_header.putQ(CONNECTION_);
-				_header.putQ(connection.toString().getBytes());
-				_header.putQ(CRLF);
+				_header.put(CONNECTION_);
+				_header.put(connection.toString().getBytes());
+				_header.put(CRLF);
 			}
 
 			if (!has_server && _status>199)
-				_header.putQ(SERVER);
+				_header.put(SERVER);
 
 			// end the header.
-			_header.putQ(HttpTokens.CRLF);
+			_header.put(HttpTokens.CRLF);
 			_state = STATE_CONTENT;
 
 		}
@@ -704,7 +704,7 @@
 							// an addContent that caused a buffer flush.
 							if (_content != null && _content.remaining() < _buffer.remaining() && _state != STATE_FLUSHING)
 							{
-								_buffer.putQ(_content);
+								_buffer.put(_content);
 								_content = null;
 							}
 						}
@@ -757,7 +757,7 @@
 			// Refill buffer if possible
 			if (!_bypass && _content != null && _content.hasRemaining() && _buffer.hasRemaining())
 			{
-				_buffer.putQ(_content);
+				_buffer.put(_content);
 				if (!_content.hasRemaining())
 					_content = null;
 			}
@@ -775,12 +775,12 @@
 					if (_needCRLF)
 					{
 						if (_header.position() > 0) throw new IllegalStateException("EOC");
-						_header.putQ(HttpTokens.CRLF);
+						_header.put(HttpTokens.CRLF);
 						_needCRLF = false;
 					}
 					// Add the chunk size to the header
 					BufferUtil.putHexInt(_header, size);
-					_header.putQ(HttpTokens.CRLF);
+					_header.put(HttpTokens.CRLF);
 
 					// Need a CRLF after the content
 					_needCRLF = true;
@@ -796,15 +796,15 @@
 						if (_needCRLF)
 						{
 							if (_header.position() > 0) throw new IllegalStateException("EOC");
-							_header.putQ(HttpTokens.CRLF);
+							_header.put(HttpTokens.CRLF);
 							_needCRLF = false;
 						}
 						BufferUtil.putHexInt(_header, size);
-						_header.putQ(HttpTokens.CRLF);
+						_header.put(HttpTokens.CRLF);
 
 						// Add end chunk trailer.
 						if (_buffer.remaining() >= 2)
-							_buffer.putQ(HttpTokens.CRLF);
+							_buffer.put(HttpTokens.CRLF);
 						else
 							_needCRLF = true;
 					}
@@ -814,14 +814,14 @@
 				if (_needEOC && (_content == null || !_content.hasRemaining()))
 				{
 					if (_needCRLF && _buffer.remaining() >= HttpTokens.CRLF.length) {
-						_buffer.putQ(HttpTokens.CRLF);
+						_buffer.put(HttpTokens.CRLF);
 						_needCRLF = false;
 					}
 
 					if (!_needCRLF && _needEOC && _buffer.remaining() >= LAST_CHUNK.length) {
 						if (!_head)
 						{
-							_buffer.putQ(LAST_CHUNK);
+							_buffer.put(LAST_CHUNK);
 							_bufferChunked = true;
 						}
 						_needEOC = false;
@@ -1010,9 +1010,9 @@
 			{
 				char ch = reason.charAt(i);
 				if (ch!='\r'&&ch!='\n')
-					_reason.putQ((byte)ch);
+					_reason.put((byte)ch);
 				else
-					_reason.putQ((byte)' ');
+					_reason.put((byte)' ');
 			}
 			_reason.flip();
 		}