anchor.diff:      AppServerSocket = WorkerState#fcgi_worker_state.app_server_socket,
       case gen_tcp:recv(AppServerSocket, Length, Timeout) of
           {error, Reason} ->
  -            fcgi_worker_fail(WorkerState, {send_to_application_server_failed, Reason});
  +            fcgi_worker_fail(WorkerState,
  +                             {"recv from application server failed", Reason});
           {ok, Data} ->
               {ok, Data}
       end.
  
positive.code:             <<AppStatus:32/signed, ProtStatus:8, _Reserved:24>> = ContentData,
              fcgi_worker_fail_if(ProtStatus < ?FCGI_STATUS_REQUEST_COMPLETE,
                                  WorkerState,
                                  {received_unknown_protocol_status, ProtStatus}),
              fcgi_worker_fail_if(ProtStatus > ?FCGI_STATUS_UNKNOWN_ROLE,
                                  WorkerState,
                                  {received_unknown_protocol_status, ProtStatus}),
              if
                  ProtStatus /= ?FCGI_STATUS_REQUEST_COMPLETE ->
                      error_logger:error_msg("FastCGI protocol error: ~p (~s)~n",
  
negative.code:     <<Version:8, Type:8, RequestId:16, ContentLength:16,
        PaddingLength:8, Reserved:8>> = Header,
      fcgi_worker_fail_if(Version /= 1, WorkerState,
                          {"received unsupported version", Version}),
      case Type of
          ?FCGI_TYPE_END_REQUEST ->
              fcgi_worker_fail_if(RequestId /= ?FCGI_REQUEST_ID_APPLICATION,
                                  WorkerState,
                                  {"unexpected request id", RequestId}),
              fcgi_worker_fail_if(ContentLength /= 8, WorkerState,
                                  {"incorrect content length for end request",
                                   ContentLength}),
              ok;
          ?FCGI_TYPE_STDOUT ->
              fcgi_worker_fail_if(RequestId /= ?FCGI_REQUEST_ID_APPLICATION,
                                  WorkerState,
                                  {"unexpected request id", RequestId}),
              ok;
          ?FCGI_TYPE_STDERR ->
              fcgi_worker_fail_if(RequestId /= ?FCGI_REQUEST_ID_APPLICATION,
                                  WorkerState,
                                  {"unexpected request id", RequestId}),
              ok;
          ?FCGI_TYPE_UNKNOWN_TYPE ->
              fcgi_worker_fail_if(RequestId /= ?FCGI_REQUEST_ID_MANAGEMENT,
                                  WorkerState,
                                  {"unexpected request id", RequestId}),
              fcgi_worker_fail_if(ContentLength /= 8, WorkerState,
                                  {"incorrect content length for unknown type",
                                   ContentLength}),
              ok;
          OtherType ->
              throw({"received unexpected type", OtherType})
      end,
      case fcgi_receive_binary(WorkerState, ContentLength,
                               ?FCGI_READ_TIMEOUT_MSECS) of
          {error, Reason} ->
              fcgi_worker_fail(WorkerState,
                               {"unable to read content data", Reason});
          {ok, ContentData} ->
              case fcgi_receive_binary(WorkerState, PaddingLength,
                                       ?FCGI_READ_TIMEOUT_MSECS) of
                  {error, Reason} ->
                      fcgi_worker_fail(
                        WorkerState,
                        {"unable to read record padding data", Reason});
                  {ok, PaddingData} ->
                      fcgi_trace_protocol(WorkerState, "Receive",
                                          Version, Type, RequestId, ContentLength,
  