When a body is not allowed to be sent on an outgoing message, certain
headers need modification -- except for an outgoing Response to a HEAD
request.

@param msg
504232
protected void updateBodyLengthHeaders(HttpBaseMessage msg) {

        // don't change headers if this was in response to a HEAD request
        if (!getRequestImpl().getMethodValue().equals(MethodValues.HEAD)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Body not valid on response, fixing headers");
            }
            if (0 < msg.getContentLength()) {
                // 366388
                msg.removeHeader(HttpHeaderKeys.HDR_CONTENT_LENGTH);
            }
            msg.setTransferEncoding(TransferEncodingValues.NOTSET);
        }
    }
1142130
private void blockUntilSendable(final AbstractBody msg) {
        assertLocked();

        while (isWorking() && !isImmediatelySendable(msg)) {
            try {
                notFull.await();
            } catch (InterruptedException intx) {
                LOG.log(Level.FINEST, INTERRUPTED, intx);
            }
        }
    }
272658
public void setMessage(String data) throws HttpMalformedHeaderException {
        clear();
        try {
            if (!this.parse(data)) {
                mMalformedHeader = true;
            }
        } catch (Exception e) {
            mMalformedHeader = true;
        }

        if (mMalformedHeader) {
            throw new HttpMalformedHeaderException();
        }

    }
1149805
protected boolean sendMessageToEndpoint(final LogoutHttpMessage msg, final SingleLogoutRequest request, final SingleLogoutMessage logoutMessage) {
        return this.httpClient.sendMessageToEndPoint(msg);
    }
62929
public void handleMessage(T message) throws Fault {
        if (LOG.isLoggable(Level.FINEST)) {
            LOG.finest("FlowIdProducerOut Interceptor called. isOutbound: "
                    + MessageUtils.isOutbound(message) + ", isRequestor: "
                    + MessageUtils.isRequestor(message));
        }

        if (MessageUtils.isRequestor(message)) {
            handleRequestOut(message);
        } else {
            handleResponseOut(message);
        }

        // Don't write flowId for Oneway responses
        if (isOnewayResponse(message)) {
            return;
        }

        // write FlowId to HTTP and Soap layer
        String flowId = FlowIdHelper.getFlowId(message);
        FlowIdProtocolHeaderCodec.writeFlowId(message, flowId);
        FlowIdSoapCodec.writeFlowId(message, flowId);

    }
49273
public boolean sendToMatching(Msg msg)
    {
        //  Is this end of a multipart message?
        boolean msgMore = msg.hasMore();

        //  Push the message to matching pipes.
        distribute(msg);

        //  If mutlipart message is fully sent, activate all the eligible pipes.
        if (!msgMore) {
            active = eligible;
        }

        more = msgMore;

        return true;
    }
168919
public void error( String msg, Throwable t )
    {
        if( m_delegate.isErrorEnabled() )
        {
            m_delegate.error( msg, t );
        }
    }
942985
protected function showError($msg = null)
    {
        if ($msg === null) {
            $msg = 'Sitemap is not available, please check your configuration';
        }

        header('HTTP/1.0 503 Service Unavailable');
        $GLOBALS['TSFE']->pageErrorHandler(true, null, $msg);
        exit;
    }
1051828
@Override
    public boolean isBodyAllowed() {

        if (super.isBodyAllowed()) {

            // sending a body with the response is not valid for a HEAD request
            if (getServiceContext().getRequestMethod().equals(MethodValues.HEAD)) {
                return false;
            }

            // if that worked, then check the status code flag
            return this.myStatusCode.isBodyAllowed();
        }

        // no body allowed on this message
        return false;
    }
183016
private void sendLayoutMessage(final String msg) {
      if (sqw != null) {
          String packet = msg;
          String hdr = getPacketHeader(new Date().getTime());
          if(facilityPrinting || hdr.length() > 0) {
              StringBuffer buf = new StringBuffer(hdr);
              if(facilityPrinting) {
                  buf.append(facilityStr);
              }
              buf.append(msg);
              packet = buf.toString();
          }
          sqw.setLevel(6);
          sqw.write(packet);
      }
  }
1278646
public boolean hasValidKey(HttpMessage msg) {
		try {
			HttpRequestHeader requestHeader = msg.getRequestHeader();
			return this.hasValidKey(requestHeader, getParams(requestHeader));
		} catch (ApiException e) {
			logger.error(e.getMessage(), e);
			return false;
		}
	}
623357
public void sendMessage(byte[] msgdata, boolean isActivity)
			throws SshException {

		synchronized (kexqueue) {

			if (currentState == PERFORMING_KEYEXCHANGE
					&& !isTransportMessage(msgdata[0])) {
				kexqueue.addElement(msgdata);
				return;
			}

			if (Log.isDebugEnabled()) {
				if (verbose) {
					Log.debug(this,
							"Sending transport protocol message");
				}
			}

			try {
				outgoingMessage.reset();

				int padding = 4;

				// Compress the payload if necersary
				if (outgoingCompression != null && isOutgoingCompressing) {
					msgdata = outgoingCompression.compress(msgdata, 0,
							msgdata.length);
				}

				// Determine the padding length
				padding += ((outgoingCipherLength - ((msgdata.length + 5 + padding) % outgoingCipherLength)) % outgoingCipherLength);

				// Write the packet length field
				outgoingMessage.writeInt(msgdata.length + 1 + padding);

				// Write the padding length
				outgoingMessage.write(padding);

				// Write the message payload
				outgoingMessage.write(msgdata, 0, msgdata.length);

				// Create some random data for the padding
				ComponentManager
						.getInstance()
						.getRND()
						.nextBytes(outgoingMessage.array(),
								outgoingMessage.size(), padding);
				outgoingMessage.move(padding);

				// Generate the MAC
				if (outgoingMac != null) {
					outgoingMac.generate(outgoingSequence,
							outgoingMessage.array(), 0, outgoingMessage.size(),
							outgoingMessage.array(), outgoingMessage.size());

				}

				// Perfrom encrpytion
				if (encryption != null) {
					encryption.transform(outgoingMessage.array(), 0,
							outgoingMessage.array(), 0, outgoingMessage.size());
				}

				outgoingMessage.move(outgoingMacLength);
				outgoingBytes += outgoingMessage.size();

				// Send!
				transportOut.write(outgoingMessage.array(), 0,
						outgoingMessage.size());
				transportOut.flush();

				if (isActivity)
					lastActivity = System.currentTimeMillis();

				if (Log.isDebugEnabled()) {
					if (verbose) {
						Log.debug(
								this,
								"Sent "
										+ outgoingMessage.size()
										+ " bytes of transport data outgoingSequence="
										+ outgoingSequence
										+ " totalBytesSinceKEX="
										+ numOutgoingBytesSinceKEX);
					}
				}

				outgoingSequence++;
				numOutgoingBytesSinceKEX += msgdata.length;
				numOutgoingPacketsSinceKEX++;

				if (outgoingSequence >= 4294967296L) {
					outgoingSequence = 0;
				}

				if (!transportContext.isKeyReExchangeDisabled()) {
					if (numOutgoingBytesSinceKEX >= MAX_NUM_BYTES_BEFORE_REKEY
							|| numOutgoingPacketsSinceKEX >= MAX_NUM_PACKETS_BEFORE_REKEY) {

						if (Log.isDebugEnabled()) {
							Log.debug(this,
									"Requesting key re-exchange");
						}
						sendKeyExchangeInit(false);
					}
				}
			} catch (IOException ex) {
				internalDisconnect();
				throw new SshException("Unexpected termination: "
						+ ex.getMessage(), SshException.UNEXPECTED_TERMINATION);
			}
		}

	}
1024597
private void checkMessage(Message msg) throws MessagingException {
        if (msg == null) {
            throw new MessagingException("Message is null");
        }
        if (!(msg instanceof MimeMessage)) {
            throw new MessagingException(
                    "AWS Mail Service can only send MimeMessages");
        }
    }
1198539
@Override
    public void sendError(int sc, String msg) throws IOException {
        this.checkState();
        super.sendError(sc, msg);
    }
73754
public static void throwAsIAE(Throwable t, String msg) {
        throwIfRTE(t);
        throwIfError(t);
        throw new IllegalArgumentException(msg, t);
    }
764190
public void setHttpMessage(HttpMessage httpMessage) {
        this.httpMessage = httpMessage;
        setParamNames(httpMessage.getParamNames());
        this.alertUrl.setText(httpMessage.getRequestHeader().getURI().toString());
        this.historyRef = null;
    }
11525
public void warn(String msg) {
        if (logger.isLoggable(Level.WARNING)) {
            log(SELF, Level.WARNING, msg, null);
        }
    }